- This API can be used for managing tasks. It is a REST API built with Node.js, Express.js and PostgreSQL.
- To manage migrations we have used sequelize-cli and sequelize-orm.
- This API supports JWT authentication and authorization.
- This API follows robus error-handeling, Object Oriented Programming and MVC architecture.
git clone https://github.com/alpha951/Task-management-API.git
cd Task-management-API
npm install
- Create a .env file similar to
.example.env
file and add your environment variables. - Run
npx sequelize init
to setup sequelize. - Configure your ./config/config.json file to connect to your database.
- Run
npx sequelize db:migrate
to run migrations. - Run
npx sequelize db:seed 20230921112358-demo-users.js
to seed the database with users. - Run
npx sequelize db:seed 20230921081302-demo-tasks.js
to seed the database with tasks.
Following are the API endpoints and their usage.
- POST
- http://localhost:3000/api/v1/user/signup
- BODY : name, email, password
- POST
- http://localhost:3000/api/v1/user/signin
- BODY : name, email, password
- http://localhost:3000/api/v1/task
- POST
- http://localhost:3000/api/v1/task
- BODY : description, status
- HEADER : x-access-token : JWT-TOKEN
- GET
- http://localhost:3000/api/v1/task
- HEADER : x-access-token : JWT-TOKEN
- GET
- http://localhost:3000/api/v1/task/:id
- HEADER : x-access-token : JWT-TOKEN
- PATCH
- http://localhost:3000/api/v1/task/:id
- HEADER : x-access-token : JWT-TOKEN
- DELETE
- http://localhost:3000/api/v1/task/:id
- HEADER : x-access-token : JWT-TOKEN