Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/JamieLivingstone/node-clean-architecture
A project template that follows the clean architecture principles and encourages established practices.
https://github.com/JamieLivingstone/node-clean-architecture
boilerplate clean-architecture fastify node nodejs prisma template typescript zod
Last synced: 27 days ago
JSON representation
A project template that follows the clean architecture principles and encourages established practices.
- Host: GitHub
- URL: https://github.com/JamieLivingstone/node-clean-architecture
- Owner: JamieLivingstone
- License: mit
- Created: 2022-03-31T16:45:20.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-25T19:47:26.000Z (10 months ago)
- Last Synced: 2024-11-22T14:12:11.878Z (30 days ago)
- Topics: boilerplate, clean-architecture, fastify, node, nodejs, prisma, template, typescript, zod
- Language: TypeScript
- Homepage:
- Size: 335 KB
- Stars: 162
- Watchers: 7
- Forks: 23
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Clean Architecture Template
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/JamieLivingstone/node-clean-architecture/blob/main/LICENSE)
[![Test Coverage](https://api.codeclimate.com/v1/badges/f2520d575fe754ae7032/test_coverage)](https://codeclimate.com/github/JamieLivingstone/node-clean-architecture/test_coverage)
[![Maintainability](https://api.codeclimate.com/v1/badges/f2520d575fe754ae7032/maintainability)](https://codeclimate.com/github/JamieLivingstone/node-clean-architecture/maintainability)
[![Known Vulnerabilities](https://snyk.io/test/github/JamieLivingstone/node-clean-architecture/badge.svg)](https://snyk.io/test/github/JamieLivingstone/node-clean-architecture)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)
- Automatic API documentation via Swagger
- Built with scalability and performance in mind by using Fastify (see [benchmarks](https://www.fastify.io/benchmarks))
- Built in logging with Pino
- Comprehensive testing including unit and functional tests
- Prisma ORM integration## Getting Started
1. Install the latest [Node.js LTS](https://nodejs.org/en/)
2. Install Docker and ensure that it is running
3. Create .env file `cp .env.example .env`
4. Install project dependencies by running `npm install`
5. Start Docker (local Postgres instance) `docker-compose up -d`
6. Create database `npx prisma migrate deploy`
7. Start development server `npm run dev`
8. Navigate to Swagger ([http://localhost:3000/api-docs](http://localhost:3000/api-docs))## Scripts
**Build production bundle**
```
npm run build
```**Lint project (eslint)**
```
npm run lint
```**Start development server**
```
npm run dev
```**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.](https://github.com/JamieLivingstone/node-clean-architecture/blob/main/LICENSE)
## Credits
The project's inspiration is [Jason Taylor's clean architecture template](https://github.com/jasontaylordev/CleanArchitecture) for C#.