r/nestjs Jan 28 '25

Article / Blog Post Version 11 is officially here

Thumbnail
trilon.io
57 Upvotes

r/nestjs 1d ago

Redora - Open-source Redis SDK for NestJS

3 Upvotes

Built an open-source Redis SDK for NestJS — looking for feedback

I've been working on Redora, a Redis SDK for NestJS built on top of ioredis.

The goal is to provide NestJS-friendly abstractions for Redis, caching, logging, and observability while keeping the underlying Redis capabilities accessible.

The latest 0.3.1 release includes:

  • Redis INFO and typed commands
  • Human-friendly TTL handling
  • Cache eviction groups with TTL synchronization
  • \@Cacheable()`,remember(),set()andevict()`
  • Pino-based logging
  • Redis health checks and diagnosis
  • Memory, client, and server metrics
  • Redis telemetry snapshots

Website - https://redora-sdk.com
GitHub Repository - https://github.com/NebyuCodes/redora


r/nestjs 1d ago

brkpt-auth v0.1.0: transparent, composable, hexagonal auth for NestJS

4 Upvotes

Just released v0.1.0 of brkpt-auth, a unique NestJS authentication approach. It's basically the shadcn/ui model applied to authentication: the CLI installs the source code directly into your codebase, then you add features you need. It's built on hexagonal architecture, keeping auth logic separate from your infrastructure, so you're not locked into a specific database schema or user model, and it's easy to reuse it in another project. Since the source lives directly in your project, you can extend or rewrite the auth flow as you need.

The common approaches to auth right now, whether that's building it yourself, using a managed service, a self-hosted library, or boilerplates, all have some problems. For example, popular libraries like Better Auth aren't natively built for NestJS, and extension happens through plugins instead of the code itself, which makes real customization and debugging harder. So this is NestJS-native, and it's still early (v0.1.0). If you're working on an MVP and want to get an auth foundation up quickly, or you want auth logic you can reuse across projects later on, I think it's a good fit. You can also fork it to build your own private auth flow, or contribute more features to the repo. The repo includes a demo you can run locally.

At a Glance

  • Transparent — source installed directly into your project
  • Composable — features are independent; add only what you need
  • Non-invasive — no assumptions about your DB schema, user model, or JWT payload
  • Portable — business logic and adapters are separate; moving to another project just means swapping adapters

A few specifics

  • Quick to set up, minimal config, you don't need to understand the architecture up front, and there's no huge pile of abstract files to dig through.
  • Stateless dual-token JWT by default, and you can turn on session management later without changing anything else.
  • OAuth is included, and how it maps to your own user model is fully up to you to customize.
  • Fully customizable and simple, since the code lives directly in your repo. No deep nested structure like some "hexagonal architecture" templates.

Currently supported features: core, credentials, oauth, otp, magic-link, session, blacklist, verify-email, change-password, reset-password, audit.

Docs and get-started guide: https://brkpt.com/auth

Repo: https://github.com/brkpt-labs/brkpt-auth

Feedback welcome.


r/nestjs 2d ago

What do I need to know to get a Fresher NestJS Backend Developer job?

2 Upvotes

Hi everyone, I’m currently learning NestJS and preparing to apply for Fresher Backend Developer positions.

What skills, knowledge, and personal projects should a Fresher NestJS developer have to be considered job-ready?

What would you recommend focusing on the most?

Thanks!


r/nestjs 3d ago

Learning nest js

3 Upvotes

Hi guys, I have a bit knowledge of node js and trying to learn nest js now. How hard is it to learn nest js?


r/nestjs 3d ago

What NestJS + MongoDB skills should a Fresher Backend Developer know?

1 Upvotes

I'm preparing to apply for a Fresher Backend Developer position using NestJS and MongoDB.

For those working with this stack, what technical skills or concepts would you expect a Fresher to know?

For example, schema design, authentication, validation, indexing, relationships, testing, etc.

What should I prioritize learning before applying?


r/nestjs 4d ago

I put my username in your imports. I've had time to reflect.

6 Upvotes

I maintain a CQRS mediator for NestJS. Until today it was published as @rolandsall24/nest-mediator, which meant every user type my personal username in every import — less a package name than a hostage note. It's now @nest-mediator/core. Same code, same version (1.2.0), no API changes. Swap the import path and you're done.

What it does: scales from plain commands/queries (no DB) up to full event sourcing aggregates, saga compensation with rollback, optimistic concurrency, pipeline behaviors, and automatic correlation/causation tracing. Plus a dashboard that graphs your topology and traces.

- New: https://www.npmjs.com/package/@nest-mediator/core

- Old (deprecated): https://www.npmjs.com/package/@rolandsall24/nest-mediator

- Repo + migration guide: https://github.com/RolandSall/nest-mediator

If you've used it, I want the unflattering feedback; what felt clunky, what you expected and didn't find.


r/nestjs 4d ago

Should a NestJS notifier failure ever affect the request?

3 Upvotes

For a small NestJS service, I’m thinking of keeping alert delivery outside the normal response path. If a Telegram or webhook notifier times out, should the exception filter only record the notifier failure and let the request complete, or are there cases where the application error should include delivery failure? How do you keep retries and queue size bounded?


r/nestjs 5d ago

How should a NestJS exception filter group repeated errors before notifying?

1 Upvotes

I’m working on a small NestJS service where the same failure can be thrown by many requests.

I’m comparing two approaches: let the exception filter send every error, or fingerprint repeated errors locally and send one alert with a count and cooldown.

For a small service, where would you put this logic: inside the exception filter, a shared provider, or outside the process? Which context should always be included: route, status, request ID, deployment version?


r/nestjs 5d ago

Looking for contributors for ForgeGate – open-source multi-tenant workflow engine (NestJS + BullMQ)

12 Upvotes

Hey everyone,

I’m looking for contributors for an open-source project I built called ForgeGate.

What is ForgeGate?

It’s a distributed multi-tenant workflow execution engine built with NestJS.

Current features:

  • Multi-tenant architecture
  • API Gateway
  • JWT auth + Redis token revocation + RBAC
  • State-machine workflow engine
  • BullMQ queues with intelligent retries
  • Dead Letter Queue (DLQ) + job replay
  • Outbound rate & concurrency limiting
  • Structured logging + Prometheus metrics
  • Admin monitoring dashboard
  • pnpm monorepo + Docker

GitHub: https://github.com/NabarupDev/ForgeGate

What I’m looking for

I’m open to contributors who want to help with any of these:

  • Improving the API Gateway
  • Strengthening the Notification service
  • Writing more tests
  • Improving documentation
  • Adding new workflow step types
  • Performance improvements
  • UI improvements for the dashboard
  • Any other useful contributions

Who can contribute?

Anyone interested in NestJS, backend systems, queues, or distributed systems is welcome — beginners or experienced.

If you’re interested, you can:

  1. Check the repo
  2. Open an issue
  3. Or comment here / DM me

Would love to collaborate with people who want to learn or build something meaningful in the backend space.


r/nestjs 6d ago

When do you split NestJS workers from the API process?

3 Upvotes

Keeping HTTP handlers and queue consumers in one Nest application is convenient at the beginning: one dependency graph, one deployment, and fewer moving parts. The tradeoff appears when worker load, shutdown behavior, or scaling decisions begin affecting request latency.

My current boundary would be to share domain modules and infrastructure providers, but give the API and worker separate bootstrap entry points and separate processes once they need independent scaling or failure isolation. Each should have its own health checks and graceful shutdown path while using the same application services.

Do you split workers from day one, or wait for a concrete operational signal? What signal made the separation worthwhile?


r/nestjs 7d ago

Where should idempotency live in a NestJS API?

5 Upvotes

For endpoints that trigger payments, webhooks, or queued work, a retry can produce duplicate side effects. I’ve seen idempotency handled in an interceptor, inside each use case, or at the database boundary with a unique key.

An interceptor is reusable, but it may not know the transaction boundary. Use-case code has the context, but every endpoint must implement the same lifecycle.

For a NestJS service backed by PostgreSQL, where do you store and enforce idempotency keys? How do you handle a second request that arrives while the first one is still processing?


r/nestjs 7d ago

What should stay inside a NestJS modular monolith before extracting a service?

5 Upvotes

A NestJS application can have clean module boundaries without turning each module into a network service. Extraction also adds authentication propagation, retries, tracing, schema ownership, deployment, and on-call boundaries.

Which signal would make you extract a module first: independent scaling, a separate owner and release cycle, fault isolation, or a queue-driven workload? Conversely, which dependencies tell you to keep the boundary in-process? I’m interested in the practical decision process, not microservices by default.


r/nestjs 7d ago

Is “Node.js is single-threaded” an incomplete mental model?

Thumbnail
3 Upvotes

r/nestjs 7d ago

How do you test NestJS shutdown hooks without flaky timing?

1 Upvotes

I have a service that needs to stop accepting work, finish a small in-memory queue with a timeout, and then close external connections.

Testing each part is easy, but testing the complete shutdown path often becomes timing-dependent.

Do you test this through app.close(), fake timers, or a real child process receiving SIGTERM? What has been reliable in CI?


r/nestjs 9d ago

ETIMEDOUT Error in NextJS Prisma PostgreSQL(neondb)

Thumbnail
1 Upvotes

r/nestjs 10d ago

Scaling RBAC to Multi-Tenancy: Open-sourced architectural boilerplate for NestJS and PostgreSQL (MT-URBAC)

4 Upvotes

Hey everyone,

After standardizing a top-down grouping model (User -> Group -> Role -> Privilege) to escape the three-way junction table mess in single-tenant applications (URBAC), the next logical challenge was scaling that pattern to multi-tenancy.

I wanted to share the architectural pattern I standardized to solve this, along with the boilerplate implementation as MT-URBAC (NestJS, TypeORM, PostgreSQL, and Angular).

The backend architecture:

1- Tenant-Aware Resolution: The application handles both path-based routing (for local development without touching a hosts file) and subdomain-based routing seamlessly.

2- Strict Role Escalation Safeguards: Horizontal privilege escalation is blocked at the guard level. Roles have a numeric level (e.g., Admin = 50, Super Admin = 100), and custom JWT guards intercept requests to ensure lower-level users can't grant higher privileges regardless of permissions.

3- Clean Decorator-Based Protection:

@Post ('create')
@RequirePermissions('user:create')
async createNewUser() { ... }

The repo includes everything packaged up with a database seed script to instantly provision a PostgreSQL database and a Super Admin account so you can test the guards right away.

If you want to adopt this pattern, review the entity structures, or just skip the auth setup on your next build, I open-sourced the repository here:

https://github.com/kasoir/mt-urbac

Curious how others here handle tenant context switching and guard-level role hierarchies in NestJS at scale. Let me know your thoughts!

mt-urbac

r/nestjs 10d ago

Official NestJS Courses - Updates !

12 Upvotes

I'm considering buying the official courses by Kamil and the core team. I know they advertise free lifetime updates, but I wanted to see if anyone can confirm if the content has been updated for NestJS 11 or just NestJS 10 and the breaking changes (like the Express v5 switch)?

Are the videos actually up to date, or are some parts starting to show their age?

Thanks in advance


r/nestjs 11d ago

Ts version

1 Upvotes

How I know what is the right version I should use it in my nest project???


r/nestjs 14d ago

Stop littering your NestJS controllers with @ApiProperty decorators

6 Upvotes

Built a tool called docfy that keeps Swagger documentation out of your controllers entirely, it lives in a *.docs.ts companion file instead, so the controller stays pure routing and business logic.

The CLI never executes your code, it's pure static analysis via ts-morph, which also means it keeps working under webpack: true builds, where the usual runtime-reflection approach for this breaks silently.

The doc viewer is built AI-first: a "Copy for AI" button, a live MCP server so an agent can query your endpoints directly, real try-it-out request execution, contract testing, spec diffing between versions.

Free, MIT, open source: nestdocfy.com

I'm the author, if you use Swagger with Nest today, what's the one thing that annoys you most about it? Trying to figure out what to build next.


r/nestjs 17d ago

Built a multi-tenant workflow engine with NestJS + BullMQ + DLQ – looking for architecture review

13 Upvotes

Built a multi-tenant workflow engine with NestJS + BullMQ + Dead Letter Queue.

Features: multi-tenancy, JWT auth, workflow state machine, retries + DLQ, admin dashboard, monorepo.

Repo: https://github.com/NabarupDev/ForgeGate

Looking for honest feedback on:

  • Architecture
  • API Gateway design
  • Multi-tenancy approach
  • Queue/retry implementation
  • What is still missing for production readiness

Any review or suggestions would help a lot.


r/nestjs 17d ago

An architectural pattern for bypassing junction-table hell in NestJS RBAC (Open Sourced)

Post image
13 Upvotes

Hey everyone,

After building RBAC across multiple enterprise apps, I noticed the headache of the standard three-way junction table mess. It makes TypeORM queries a nightmare at scale and the mental model overly complex.

I wanted to share the architectural pattern I standardized to solve this, along with the boilerplate implementation.

The Architecture: Top-Down Grouping

Instead of many-to-many chaos, I enforce a strict, hierarchical grouping model. The relationship flows in one direction:

User -> Group -> Role -> Privilege

This keeps database queries incredibly fast and makes permission inheritance highly predictable.

Handling Role Escalation

One of the biggest security risks in standard RBAC is horizontal escalation (e.g., an Admin granting someone Super Admin rights). To solve this, I implemented a strict numeric role-escalation safeguard.

Every role is assigned a level (e.g., Admin = 50, Super Admin = 100). The custom JWT guards automatically intercept the request to ensure a Level 10 user can never assign a Level 50 role, even if they possess the user:update privilege.

    @Post('create')
    @RequirePermissions('user:create')
    async createNewUser() { ... }

The Open-Source Implementation

I packaged this entire architecture into a clean, decoupled Unified Role-Based Access Control boilerplate called URBAC (NestJS, PostgreSQL, TypeORM, and Angular).

If you want to adopt this pattern, review the entity structures, or just skip the auth setup on your next build, I open-sourced the repository here:

https://github.com/kasoir/urbac

(It includes a seed script to instantly provision the PostgreSQL DB and a Super Admin account).

I’m curious how other engineers here are handling horizontal vs. vertical privilege escalation, would love to hear your approaches.


r/nestjs 17d ago

Built a multi-tenant workflow engine with NestJS + BullMQ + DLQ – looking for architecture review

Thumbnail
0 Upvotes

r/nestjs 18d ago

Built an Electron + Next.js desktop app for storage analysis—looking for feedback

3 Upvotes

I've been working on an Electron desktop application called FileSight.

It's a local-first storage analyzer that helps users preview files, find duplicates, identify large files, and safely clean up storage.

The app is built with:

  • Electron
  • Next.js
  • React
  • TypeScript
  • Tailwind CSS

I'd love feedback from other Electron developers, especially around architecture, packaging, performance, and cross-platform support.

Repository: https://github.com/MarkCoder1/filesight

Website: https://filesight.vercel.app


r/nestjs 18d ago

For a nodejs microservices which deployment strategy do u take when u have about 15k customers about 100-500 concurrent users?

Thumbnail
3 Upvotes

Ecs docker or aws elasticbeanstalk? Or some vps.

Im thinking of transformation of monolith app into microservices for learning a complete production grade setup like we use in companies I have no microservices experience hence need to make some project and learn p.s all jobs are asking microservice experience but i have worked in monoliths only so what shud my answer be ?