You are tasked with building a system to keep track of your tasks. You will need to write CRUD APIs for managing tasks and API to get the metrics for your tasks. You should use Node.js for the backend, any SQL database for managing database interactions.
- API to create a task.
- API to update a task
- API to get all tasks, make API paginated.
- API to get task metrics like counts tasks on basis of status and timeline.
Example:
{
"open_tasks": 10,
"inprogress_tasks": 30,
"completed_tasks": 50
}
[
{
"date": "July 2023",
"metrics": {
"open_tasks": 0,
"inprogress_tasks": 0,
"completed_tasks": 30
}
},
{
"date": "August 2023",
"metrics": {
"open_tasks": 10,
"inprogress_tasks": 30,
"completed_tasks": 50
}
}
]
- Clone the repo with
git clone https://github.com/WickedBrat/nodejs-rest-api infeedo
-
This project uses
Postgres
as database. To setup Postgresql on your local, follow this guide here -
Create a
.env
at the root of your project and update the creds for your local. Use.env.sample
for your reference. -
Now, install the dependencies for the project using
npm install
oryarn install
-
To run the project using
npm start
oryarn start
-
Use the curl statements to test the APIs