A robust, modular NestJS & TypeScript application implementing Domain‑Driven Design (DDD) and Clean Architecture principles. Each domain feature is organized into its own module with clearly separated layers (Domain, Application, Infrastructure, Interfaces) to promote maintainability, testability, and future scalability.
This monolithic application is architected according to DDD and Clean Architecture:
- Domain Layer: Encapsulates core entities, and value objects.
- Application Layer: Defines use‑cases (services), DTOs, and ports (interfaces) that orchestrate domain operations.
- Infrastructure Layer: Contains concrete implementations of repositories.
- Interface Layer: Exposes HTTP controllers that map incoming requests to application use‑cases.
This vertical slice (feature‑first) organization ensures each module is self‑contained and can be extracted into a standalone service if required.
-
Install dependencies
npm install
-
Configure environment
- Copy
.env.exampleto.envand set database and API keys.
- Copy
-
Run database migrations
npm run migrate
-
Start the server
npm run start:dev
-
Access API
- Swagger UI:
http://localhost:4000/api-docs
- Swagger UI:
- Framework: NestJS
- Language: TypeScript
- ORM: TypeORM
- Database: PostgreSQL
- Validation: class-validator / class-transformer
- Testing: Jest