Back-end to organize tasks on republic, kind of to-do list management using Typescript.
Republic Tasks is an app maked to organize your tasks republic, with you colegues, for always keep home tasks on day. You can create new tasks and keep up with you how many tasks each person need to do. Every week, your group can reset the tasks to "incomplete" state and, restart all the loop.
- Typescript / Express
- dotenv
- joi
- pg
- Clone this repository
- install all dependencies
npm i
The postgres database already have a few itens for us to test it;
First you need to create and import the database using the data inside the dump.sql file.
psql dbname < dumpfile
After that, execute this command:
npx nodemon src/app.ts
Then we can start testing it!
Using an API Tester (such as ThunderClient), you can verify any router in description below!
will return all the tasks listened on API as
{
name: string;
description: string;
completed: boolean;
}
Will update as done one task of you choose. The taskId need to send by QUERY on the route. IF sucefully, API will send code 200.
Will return a counter of incomplete tasks of one person. The userId need to send by QUERY on the route. The respost is like
{
name: string;
taskToDo: number;
}
Body: { "text": "Limpar os tapetes", "userId": "2" }
Will create a new task for user, choose by ID. Default of completed camp is False. IF sucefully, API will send code 201.
Body: { "taskId": 3 }
Will delete from app the task who correspond to select ID send in the body. IF sucefully, API will send code 200.
This route use to reset to default all tasks listened on API. IF sucefully, API will send code 200.