Systems & architecture
NestJS in production
One NestJS modular monolith, from the request lifecycle and module boundaries, through background jobs that never lose work, to passkeys and sessions done right.
3 parts67 min readUpdated Sep 5, 2026
Parts
Part 1
NestJS in production: the request lifecycle, dependency injection and module boundaries that scaleWhat NestJS does under the hood — the order of middleware, guards, interceptors, pipes and filters; DI, scopes and durable providers; dynamic modules — and how to use it to structure a large API as a clean modular monolith with a consistent error model, request context and graceful shutdown.
22 min
Part 2
Reliable background jobs in NestJS with BullMQ: retries, idempotency and the transactional outboxHow to build background jobs in NestJS 12 with BullMQ 6 that never silently lose work and never charge a customer twice: at-least-once delivery and idempotency, the transactional outbox, retries with error classification, dead letters, rate limiting, graceful shutdown and observability.
25 min
Part 3
NestJS Auth Done Right: Passkeys, Sessions vs JWT, and Refresh Token RotationAn honest authentication design for a NestJS API and a Next.js frontend: when to use sessions, when to use JWT, how to rotate refresh tokens with reuse detection, passkey sign-in with SimpleWebAuthn, and the guards, rate limits and CSRF protection that go with it.
20 min
Series review
0/6 answered · 0 correct
6 questions drawn from the parts of this series. Answers here count toward each post's own quiz.
Other series
Series- AI engineering for web developers4 parts · 86 min read0/4 read
- Web performance from the ground up8 parts · 74 min read0/8 read
- Modern CSS and the web platform5 parts · 46 min read0/5 read
- Frontend architecture that lasts5 parts · 30 min read0/5 read
- The engineering craft4 parts · 21 min read0/4 read
- Frontend in depth7 parts · 129 min read0/7 read
- Business analysis for product teams6 parts · 147 min read0/6 read
- Web application security9 parts · 168 min read0/9 read