NestJsTemplate
Reusable NestJS (Fastify) backend template with modular architecture, and structured API design. Built with NestJS (Fastify) and TypeScript.
Tech Stack
README
NestJsTemplate
Overview
This is a reusable backend template built with NestJS (Fastify), designed to provide a structured and scalable starting point for API development.
It includes a modular architecture, validation layer, and clear separation of responsibilities to support building reliable backend systems.
Purpose
- provide a consistent backend foundation
- enforce structured API design
- handle validation and business logic securely
Core Structure
Modules
Feature based module organisation
Each module encapsulates:
- routes (controllers)
- services (business logic)
- validation
API Layer
- Controllers define API endpoints
- Services handle all business logic
- Clear separation between request handling and logic
Validation
- Input validation using DTOs
- Ensures all incoming data is validated before processing
- Prevents invalid or unsafe operations
Technical Architecture
Backend
- NestJS (Fastify)
Handles:
- API routing and request handling
- validation and business logic
- structured service layer
Structure
root/
└── src/
├── modules/ # feature modules
├── common/ # shared utilities and helpers
├── config/ # environment and configuration
└── main.ts # application entry point
Features
- modular architecture
- structured API design
- validation layer using DTOs
- separation of concerns (controller / service)
- scalable foundation for backend systems
Usage
This template is intended to be used as a starting point:
- clone the repository
- install dependencies
- define modules and endpoints
- build features within the existing structure
Related Projects
- EloFlos
- EloFlosMerch
- NextJsTemplate
- Portfolio
Status
- Stable base structure
- Actively used for backend development
Notes
This template is intentionally focused on:
- structure
- scalability
- maintainability
It reflects the backend patterns used across my systems.