This project is a task tracking system designed to help you keep track of your tasks and manage your to-do lists effectively by using API Calls. Whether you're working on personal projects or collaborating with a team, this system can help you stay organized and productive.
Before you can run the task tracking system, you'll need the following prerequisites:
- Node.js installed on your system
- npm (Node Package Manager) installed
- MongoDB installed and running
- Postman installed and running
-
Clone the repository to your local machine:
git clone https://github.com/shrey-suri/task-tracking-system.git
-
Navigate to the project directory:
cd task-tracking-system
cd backend
-
Install the project dependencies:
npm install
-
Create a
.env
file in the project root directory and specify your MongoDB connection string:MONGODB_URI=your_mongodb_connection_string_here
npm install express --save
npm install mongodb
npm install mongoose --save
npm install body-parser --save
npm install jest --save-dev
task {
name: {
type: String,
required: true,
},
description: {
type: String,
},
status: {
type: String,
default: 'open'
},
Creation and Modification dates
}
To create a new task, follow these steps:
- Run the application:
- Dev:
npm run server-dev
- Production
npm run server-prod
-
Open your web browser and navigate to
http://localhost:3000
, unless another port mentioned in.env
file -
Use
Postman
and navigate tohttp://localhost:3000/api/tasks
. -
Make a
post
request body with the task details, such as the task name, description, status. -
Click the "Send" button to create the task.
You various API calls are:
- API to create a task: "Post
http://localhost:3000/api/tasks
" (provide request body) - API to get all tasks, paginated: "Get
http://localhost:3000/api/tasks?pageNum=n
" - API to get task by id: "Get
http://localhost:3000/api/tasks/id
" (id needs to be provided) - API to update a task: "Put
http://localhost:3000/api/tasks
" (provide id in the request body) - API to get task metrics like counts tasks on basis of status and timeline: "Get
http://localhost:3000/api/tasks/metrics
"
This project includes pagination to help manage large lists of tasks efficiently. The current pagination configuration is: pagination: 3
. You can modify and try it out. Modify the pagination configuration at: backend/config/pagination.js
Jest is used for testing in this project. To run the tests, provide the mongoDB url and use the following command:
npm run test
You can create your own tests at: backend/__tests__/databaseCall.js