✦saranzafar
HomeProjectsAboutBlogContact
✦saranzafar© 2026 Saran Zafar. All rights reserved.

Made with ❤️ in Azad Kashmir, Pakistan

Back to blog
18 Jan 20268 min

The NestJS Patterns I Actually Reach For

Modules, providers, guards — the framework gives you a lot. Here's the small subset I keep returning to after twenty production apps.

The NestJS Patterns I Actually Reach For

NestJS gives you a generous toolbox. After a few years and a few dozen apps in production, I've ended up using a small subset of it most of the time — and the rest only when I really need it.

Modules-by-feature, not modules-by-layer. Every feature gets a folder, a controller, a service, a few DTOs, and a handful of tests. No 'controllers/', no 'services/' — those structures don't survive past about ten features.

Guards for auth, interceptors for logging, pipes for validation. That's the trinity. Custom decorators only when there's an obvious win, and never for the sake of cleverness.

And one rule that's saved me more times than I can count: services don't talk to other services across feature boundaries. They go through events.

#NestJS#Backend#Patterns

More posts

See all
Why I Stopped Reaching for the Monolith First

Why I Stopped Reaching for the Monolith First

12 Mar 2026

Calm Software for Loud Industries

Calm Software for Loud Industries

02 Jan 2026

The Quiet Power of Feature Flags

The Quiet Power of Feature Flags

10 Nov 2025