Map of content for NestJS. Links marked planned are pending topics. They will get filled in over time.
Fundamentals
What you need to master before any advanced pattern.
- Modules: feature, shared, core (planned)
- DI container: providers, scopes, custom providers (planned)
- Lifecycle hooks: OnModuleInit, OnApplicationBootstrap (planned)
- Request lifecycle: middleware, guards, interceptors, pipes, filters
Recipes
Task-oriented how-tos. See all recipes.
- File uploads with Multer
- NestJS CLI monorepos
- throttler
- Response serialization with class-transformer
- Request trace ID propagation
- Request validation with class-validator
Patterns
Architecture patterns that NestJS enables but does not enforce.
- CQRS: commands, queries, events (planned)
- Repository pattern: when yes, when no (planned)
- Domain events: EventEmitter2 vs CQRS events (planned)
- Error handling: filters and exception hierarchy (planned)
Data
- Prisma: setup, transactions, soft delete (planned)
- TypeORM: integration, error handling, relations
- Caching: CacheModule + Redis (planned)
Auth
Testing
- Unit tests with Test.createTestingModule (planned)
- E2E with Supertest + Testcontainers (planned)
- Mocking strategy (planned)
Observability
- Structured logging with Pino (planned)
- OpenTelemetry: traces and metrics (planned)
- Health checks with Terminus (planned)
Deployment
- Docker: multistage builds (planned)
- Graceful shutdown (planned)
- Config validation with Zod (planned)
Gotchas
Problems I already solved and do not want to google again.