NestJS for absolute beginners: a REST API with PostgreSQL (Part 8a)
Sadman Sakib
0:00 / 0:00
NestJS for absolute beginners: a REST API with PostgreSQL (Part 8a)
41 просмотр · 10 дн. назад
Sadman Sakib
807 подписчиков
41 просмотр · 10 дн. назад
LINUX FROM ZERO, PART 8a: your first REST API with NestJS #nestjs #restapi #nodejs
Today PhotoWall gets its backend, from an empty folder, on Ubuntu 26.04 with Docker: what a backend and an API are (the restaurant's menu and order window, GET, POST and DELETE, JSON, status codes), Node.js installed with nvm (and why Ubuntu's own Node is too old for NestJS 12), just enough TypeScript (types, functions, async/await, and why Node runs a file with a type error), your first NestJS 12 app (nest new, controllers, services, modules, decorators, dependency injection, watch mode, and a test that catches our change), PhotoWall's endpoints with nest g resource (GET, POST, DELETE, a 404 and a 400 read aloud), the API moving into Docker Compose next to its database (a healthcheck, a small Dockerfile, and the one package the slim Node image is missing), real data from part 7's tables through Drizzle ORM (drizzle-kit pull, a DbModule, the SQL it sends, part 7's JOIN), and your first migration: a NOT NULL column that fails on purpose, reading the database's log, and the fix. Every chapter ends with a quick quiz. Login, validation, a Redis cache and tests come in part 8b.
The course so far:
1. Linux from zero: computers, Linux and the terminal
2. Be the boss of your Linux: users, sudo, permissions, apt, services, logs, SSH
3. How the internet works: IP addresses, routers, DNS, ports, HTTPS
4. Your own web server: nginx, reverse proxy, ufw, HTTPS
5. A real firewall: OPNsense and a WireGuard VPN
6. Docker: containers, images, volumes, networks, Compose
7. Data: PostgreSQL and Redis
8a. Your first REST API with NestJS (this video)
8b. NestJS login, validation and a Redis cache (next)
🔗 Links
Parts 1 to 7 of the course: / @sadmansakib
Node.js download (nvm for Linux): https://nodejs.org/en/download
nvm, the Node version manager: https://github.com/nvm-sh/nvm
Node.js release schedule (Node 26: LTS from October 28, 2026): https://github.com/nodejs/Release
Node.js: running TypeScript natively: https://nodejs.org/en/learn/typescrip...
NestJS docs: first steps: https://docs.nestjs.com/first-steps
NestJS docs: controllers: https://docs.nestjs.com/controllers
NestJS docs: providers (dependency injection): https://docs.nestjs.com/providers
NestJS docs: migrating to version 12: https://docs.nestjs.com/migration-guide
Drizzle docs: drizzle-kit pull: https://orm.drizzle.team/docs/drizzle...
Drizzle docs: drizzle-kit generate: https://orm.drizzle.team/docs/drizzle...
Drizzle docs: drizzle-kit migrate: https://orm.drizzle.team/docs/drizzle...
Drizzle docs: drizzle-kit drop: https://orm.drizzle.team/docs/drizzle...
Docker official image: node: https://hub.docker.com/_/node
jq, the JSON printer: https://github.com/jqlang/jq
VS Code in the browser (openvscode-server): https://github.com/gitpod-io/openvsco...
⏱️ Chapters
0:00 Welcome
2:15 What an API is
4:16 Node.js and TypeScript
8:48 Your first NestJS app
14:42 PhotoWall's endpoints
21:16 The API moves into Compose
25:47 Real data through an ORM
34:51 Your first migration
38:35 Recap & homework
Everything in this video really ran: Node.js 26.12.1 (installed with nvm 0.40.8), NestJS 12, TypeScript 6, Vitest 4 and Drizzle ORM 0.45 with drizzle-kit 0.31, in Docker 29 with the official node:26-slim image, on Ubuntu 26.04 in a virtual machine on my Mac (an ARM computer, so everything is arm64), with real terminal output (October 2026). Node 26 becomes the long-term support version on October 28, 2026. VS Code is the open-source VS Code in the browser, itself running as a container in that virtual machine, and the browser at the start is my Mac's, asking the API through the lab's forwarded port. The pretty JSON in the terminal comes from jq: if you don't have it yet, sudo apt install jq. The database password and every name you see are practice values for this lab only; part 11 moves the real secrets into a vault.
The narration is my own voice, recreated with AI from a recording of me.
Subscribe for part 8b and the whole course: https://www.youtube.com/@sadmansakib?...
#nestjs #restapi #linuxforbeginners