This project was built following the training of Rodrigo Manguinho on Udemy and has the purpose of learning to build Web Services with NodeJS following best practices, applying SOLID, TDD, Design Patterns, Clean Architecture, DDD, and so on. We also added Swagger, Docker, and CI/CD with Travis, which I modified to run in Github Actions.
- Git
- Node version 16.x
- MongoDB version 5.x
- Docker
- Docker Compose
$ git clone https://github.com/lucaswilliameufrasio/clean-ts-api.git
- Navigate to project's folder
$ cd clean-ts-api
- Install dependencies
$ yarn install
- Copy environment file:
$ cp .env.example .env
The .env file could be like the example below:
MONGO_URL=mongodb://localhost:27017/clean-node-api
PORT=7777
JWT_SECRET=IhTqDm7i1QzKd5k7Bf9CXbU3KZt1Kddgifn2MH5gff1xWjsB
- To run the app in development mode:
$ yarn build
$ yarn debug
-
Then open http://localhost:7777/api/docs
-
To run tests:
$ yarn test:ci