How saluki/nestjs-template works
Main Components Identification
The system is a NestJS-based REST API with the following key components:
• API Layer (NestJS + Fastify)
• Database Layer (PostgreSQL with Prisma ORM)
• Authentication/Security Layer
• Module Structure
• External Interfaces (REST endpoints)
Common Module
• Health Controller
• Configuration Provider
• Logger Service
• Security Guards (Guest, Health, Restricted)
• Joi Validation Pipe
Passenger Module
• Controller
• Service
• Data Models (Input/Output)
• Custom Pipes
Infrastructure Services
• Prisma Provider
• JWT Authentication
• Configuration Service
D. Database Layer (Bottom)
• PostgreSQL Database
• Prisma ORM Layer
• Migrations
Specific Implementation Details
a. Modular Architecture:
• Clear separation between Common and Passenger modules
• Hierarchical structure (app.module as parent)
b. Request Flow:
• Incoming HTTP request
• Middleware/Guard processing
• Controller routing
• Service processing
• Database interaction
• Response flow
c. Security Layer:
• JWT authentication flow
• Guard implementation points
• Health check token validation
Technical Stack Callouts
Technologies:
• NestJS 10
• Fastify
• Prisma ORM
• PostgreSQL
• Joi Validation
• Winston Logger
• JWT Authentication