NestJS Cheat Sheet
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. The reference material consulted while preparing these pages is listed in the section bibliography. |
A single-page, colour-coded summary of the NestJS essentials, written against NestJS 12.1 (@nestjs/core 12.1.2),
the Nest CLI 12.0.8, Node.js 22/24 LTS, TypeScript 6, Express 5 and Fastify 5 (versions verified 2026-10-02) — what
NestJS is and is not, the CLI and monorepo mode, bootstrap options, modules, controllers and providers, the request
lifecycle, pipes and validation, exception filters, dynamic modules and lifecycle hooks, configuration, data access
and caching, HTTP features, authentication and authorization, OpenAPI, GraphQL, WebSockets, microservices, CQRS and
reliability packages, testing, production, and a strip of what changed since older tutorials — handy for quick
memorization or as a downloadable PDF desk reference.
For the full explanation, every option, and additional examples, see the dedicated pages:
Start here — NestJS.
Foundations — NestJS vs Next.js, Introduction & Architecture, Getting Started & CLI, TypeScript for NestJS, and Project Structure & Workspaces.
Building blocks — Modules, Controllers & Routing, Providers & Dependency Injection, Middleware, Exception Filters & Error Handling, Pipes & Validation, Guards, Interceptors, Custom Decorators, and Request Lifecycle.
Fundamentals — Dynamic Modules, Injection Scopes, ModuleRef, Circular Dependencies & Lazy Loading, Execution Context, Reflector & Discovery, Lifecycle Events & Shutdown, and Platform Agnosticism & Standalone Apps.
Application — Configuration, Serialization, Logging, Events, Scheduling & Queues, HTTP Client, and i18n, Mail & File Storage.
Data — Data Overview & TypeORM, Prisma, Drizzle, MikroORM & Sequelize, MongoDB with Mongoose, and Caching.
HTTP — Versioning & Global Prefix, Cookies & Sessions, File Upload & Streaming, Server-Sent Events, MVC, Static Files & Compression, Fastify & HTTP Platforms, and Webhooks.
Security — Authentication, Authorization, Security Headers, CORS & CSRF, Rate Limiting & Encryption, and Security Best Practices.
OpenAPI — OpenAPI & Swagger.
GraphQL — GraphQL: Code-First & Schema-First, GraphQL: Subscriptions, Security & Plugins, and GraphQL: Federation.
WebSockets — WebSockets.
Microservices — Microservices Fundamentals, Microservice Transports, Microservices Architecture & Patterns, and CQRS.
Reliability — Resilience, Idempotency & Locks and Outbox & Durable Workflows.
Testing — Testing, Testing GraphQL, WebSockets & Microservices, and Debugging & Devtools.
Production — Health Checks & Observability, Performance Optimization, Deployment, and CI/CD.
Beyond the basics — Recipes & Tooling, Case Studies, What’s Changed & Migration, and Bibliography.