Backend Technologies · JavaScript / TypeScript
NestJS — Free Learning Resources
Free, printable resources for NestJS — practice problems, quick-reference cheatsheet, and an interview prep sheet. No sign-up required.
NestJS — Practice Worksheet
Structured exercises and problems to build hands-on NestJS skills. Work through key concepts step by step.
NestJS — Cheatsheet
One-page quick-reference for NestJS — key syntax, commands, patterns, and best practices at a glance.
NestJS — Interview Sheet
Top NestJS interview questions with concise answers. Get ready for any technical round with this focused prep sheet.
About NestJS
NestJS is a progressive Node.js framework built with TypeScript, heavily inspired by Angular's architecture. It provides a strongly-opinionated structure through modules, decorators, and a powerful dependency injection container. NestJS supports REST, GraphQL, WebSockets, and microservices out of the box and is the dominant TypeScript Node.js framework for enterprise backends.
NestJSCheat Sheet — What's Covered
- ✓Module system — @Module(), feature modules, imports, providers, exports
- ✓Dependency injection — @Injectable(), custom providers, and scopes
- ✓Guards, Interceptors, Pipes, and Exception Filters — the execution pipeline
- ✓TypeORM and Prisma integration with repository and service patterns
- ✓Microservices transport layers: TCP, Redis, NATS, and Kafka
Frequently Asked Questions — NestJS
What is NestJS's module system?
Every NestJS app is a graph of modules. @Module() declares providers (services), controllers, imports (other modules), and exports (providers to share). Feature modules (UserModule, AuthModule) enforce encapsulation and explicit dependency boundaries.
What is the request execution order in NestJS?
Request → Middleware → Guards → Interceptors (before) → Pipes → Route Handler → Interceptors (after) → Exception Filters (on error). Guards control access. Pipes transform/validate input. Interceptors wrap the handler for logging, caching, or response mapping.
How do you implement JWT auth in NestJS?
Install @nestjs/passport and passport-jwt. Create a JwtStrategy extending PassportStrategy, register a JwtAuthGuard, and decorate protected routes with @UseGuards(JwtAuthGuard). Access the authenticated user via @Req() or a custom @User() decorator.
How does dependency injection work in NestJS?
Mark a class with @Injectable() and add it to a module's providers array. NestJS reads constructor parameter types via TypeScript metadata and resolves them. For non-class tokens use @Inject(TOKEN) with useValue, useFactory, or useClass providers.
When should you use NestJS vs plain Express?
Use NestJS for large, team-built applications that benefit from enforced structure, DI, and TypeScript throughout. Use Express for simple services where NestJS's module system is overkill. NestJS runs on Express (or Fastify) internally, so the runtime cost is minimal.
Who Is This For?
TypeScript developers building structured, testable Node.js backends who want Angular-like architecture with built-in support for microservices.