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
yarn install
- Start Docker (local Postgres instance)
docker-compose up -d
- Create database
npx prisma migrate deploy
- Start development server
yarn start
- Navigate to Swagger ( http://localhost:3000/api-docs)
Scripts
Build production bundle
yarn build
Lint project (eslint)
yarn lint
Start development server
yarn start
Run all tests
yarn test
Run unit tests
yarn test:unit
Run functional tests (API tests)
yarn test:functional
License
This project is licensed with the MIT license.
Credits
The project's inspiration is Jason Taylor's clean architecture template…