Back-end API, a solution to control home tasks.
DrivenPOCTS is a API for storage, insert and update home tasks by residents.
- Clone this repository;
- Install all dependencies: 'npm i';
- Open PSQL by PgAdmin or Terminal
- Create a PSQL database with name: 'drivenpocts';
- Copy all info of dump.sql file that is not a comment and paste the info on a script;
- Run the script;
- Go to the file: ...src/database/database.ts, and insert your info for host, user, password;
- On terminal insert: 'npm start';
- After starting, API can be used on ThunderClient or other similar application;
- The route (get) '/taks' returns all home tasks registred;
- The route (post) '/addTask' insert a task, password of 'responsible' is required and have to be send by 'headers', 'authorization';
Object expected on body: { name: ..., description: ..., day: ..., idResponsible: ..., status: ... }
- The route (post) '/addResponsible' insert a responsible and returns the new responsible password;
Object expected on body: { name:..., age:..., token:... }
- The route (put) '/completeTask/:taskId' set task status to true, that means task is completed, needs the taskId to be updated;
- The route (delete) '/deleteTask/:taskId' delete a task, needs taskId and password of 'responsible', password have to be send by 'headers', 'authorization';
- The route (get) '/taskInfo' returns quantity of tasks by users, if the user has no tasks he will not be showed;