This is an API Rest developed with NodeJs, TypeScript and Clean Architecture.
- node version: 14.17.6
- Database: PostGres SQL
- TypeScript
- Tests made with Jest
- Containers with Docker
-
.env
Rename or copy the .env.example to .env
cp .env.example .env
The .env is configured to use docker database setup
-
build app
In the app root (the same dir where is located the package.json and this README) run:
docker compose up --build -d
Just to make sure node_modules was really installed run npm install
docker exec task-manager-api npm i
To check docker live logging:
docker-compose logs -f --tail 10
You should see the following containers active:
Before start to test the application you should run the migrations and seeder to setup the development database and the test database as well to run the integration tests
-
Running migration for development
docker exec task-manager-api npx sequelize-cli db:migrate
-
Running migration for test
docker exec task-manager-api npx sequelize-cli db:migrate --env test
-
Running seeders for development
docker exec task-manager-api npx sequelize-cli db:seed:all
-
Running seeders for test
docker exec task-manager-api npx sequelize-cli db:seed:all --env test
-
The final result:
-
Normal test
docker-compose exec task-manager-api npx jest
-
With coverage
docker-compose exec task-manager-api npx jest --coverage
Terminal version
Html version
-
Postman Project
- Lucas Sahdo - [email protected]