Printing and PDF export are disabled for this content. View it online at Full Stack Learning Simplified.
NestJS Setup
The Nest CLI scaffolds and manages projects. Install it, generate a project, and you have a working, well-structured app in seconds.
Create a project
bash
npm install -g @nestjs/cli
nest new my-app
cd my-app
npm run start:devThe dev server runs on http://localhost:3000 and reloads on every change.
Generating building blocks
The CLI generates boilerplate consistently β files, tests, and module wiring β so you don't create them by hand.
bash
nest generate module users # or: nest g module users
nest g controller users
nest g service users
nest g resource users # a full CRUD resource in one command| Command | Creates |
|---|---|
g module | a feature module |
g controller | a controller (+ spec) |
g service | a service/provider (+ spec) |
g resource | module + controller + service + DTOs + CRUD |
Useful scripts
bash
npm run start:dev # watch mode (development)
npm run build # compile to dist/
npm run start:prod # run the compiled build
npm run test # run unit testsTip:
nest g resource users is the fastest way to see a complete, idiomatic CRUD feature β a great template to learn from and adapt.Free preview. Sign in and subscribe to unlock all 809 lessons across 25 courses.
Free preview Β· Β© 2026 Full Stack Learning Simplified