Back to Projects
NestJS API Boilerplate Template

NestJS API Boilerplate Template

Feb 2026Jul 2026

Description

Built and open-sourced a production-grade REST API starter template using NestJS 11, PostgreSQL, TypeORM, Redis, RabbitMQ, and Socket.IO — designed to give backend teams a secure, scalable foundation with authentication, RBAC, logging, and messaging built in from day one.

Authentication & Authorization

  • Implemented JWT access/refresh token flow with rotation, Google OAuth, email verification, password reset, and "remember me" extended sessions with multi-device session tracking.
  • Built decorator-based RBAC with fine-grained permissions, auto-discovered from controller routes via NestJS's DiscoveryService.

Architecture & Patterns

  • Designed a layered architecture (Config, Common, Shared, Infrastructure, Feature Modules) using the Provider pattern for single-responsibility business logic and a generic BaseRepository for consistent CRUD, pagination, and transaction handling across TypeORM entities.

Observability & Reliability

  • Built per-request HTTP logging and audit-trail activity logging (user + system level), with centralized error tracking exposing an admin API to inspect, resolve, and alert on unhandled server errors.
  • Added Winston structured logging with AsyncLocalStorage-based request correlation.

Real-Time & Async Processing

  • Integrated Socket.IO for real-time WebSocket updates and RabbitMQ for decoupled background processing, with async-deferred log persistence for high-throughput scenarios.

Security & DevOps

  • Applied Helmet security headers, CORS allowlisting, scrypt password hashing, HIBP breach checks, and Redis-based rate limiting.
  • Included Docker Compose setup, Swagger/OpenAPI auto-documentation, i18n support, and comprehensive test coverage (Jest unit + e2e).

Technologies & Skills

Skills: TypeScript · TypeORM · I18n · MySQL · NestJS · Swagger API · RabbitMQ · Socket.io · Microservices · Docker