Skip to content

Task manager api made with Typescript, NodeJs and Clean Architecture

Notifications You must be signed in to change notification settings

sahdoio/task-manager-api-nodejs-clean-arch

Repository files navigation

Task Manager API

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

How do I get set up?

  • .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:

    alt text

Database Setup

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
    

    alt text

  • 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
    

    alt text

  • Running seeders for test

      docker exec task-manager-api npx sequelize-cli db:seed:all --env test
    
  • The final result:

    alt text

How to run unit tests?

  • Normal test

      docker-compose exec task-manager-api npx jest
    

    alt text

  • With coverage

      docker-compose exec task-manager-api npx jest --coverage
    

    Terminal version

    alt text

    Html version

    alt text

  • Postman Project

    See Postman Collection

Who do I talk to?

About

Task manager api made with Typescript, NodeJs and Clean Architecture

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published