Clean Architecture Template
A Node template that follows the Clean Architecture principles and encourages established practices.
Features
- TypeScript first
- Dependency injection via Awilix
- CQRS (Command Query Responsibility Segregation)
- High test coverage (unit, integration and functional tests)
- Automatic error handling
- Logging
- Versioned APIs
- Swagger
- Prisma ORM
Getting Started
- Install the latest Node.js LTS
- Install Docker and ensure that it is running
- Create .env file
cp .env.example .env
- Install project dependencies by running
npm install
- Start Docker (local Postgres instance)
docker-compose up -d
- Create database
npx prisma migrate deploy
- Start development server
npm start
- Navigate to Swagger ( http://localhost:3000/api-docs)
Scripts
Build production bundle
npm run build
Lint project (eslint)
npm run lint
Start development server
npm start
Run all tests
npm test
Run unit tests
npm run test:unit
Run functional tests (API tests)
npm run test:functional
License
This project is licensed with the MIT license.
Credits
The project's inspiration is Jason Taylor's clean architecture template for C#.