Watch the working demo here:
https://drive.google.com/file/d/1Cb9Za9NvSNw2RTyJlRkEOI-7oYftYB3s/view
This project is an enhanced version of a Task Management API built using Node.js and Express.js. It extends the core functionality by introducing event-driven features such as task reminders, categorization, tagging, and simulated webhook integration.
The system demonstrates backend design concepts including asynchronous processing, modular architecture, and external service communication.
- Node.js
- Express.js
- MongoDB (Mongoose)
- PostgreSQL (User Authentication)
- JWT Authentication
- bcrypt.js
- dotenv
task-manager-api/
│── src/
│ ├── config/ # DB connections
│ ├── controllers/ # Business logic
│ ├── middleware/ # Auth & error handling
│ ├── models/ # Mongoose schemas
│ ├── routes/ # API routes
│ ├── utils/ # Reminder & webhook logic
│ └── app.js # Entry point
│
│── .env
│── package.json
git clone <your-repo-link>
cd task-manager-api
npm install
Create a .env file:
PORT=5000
JWT_SECRET=supersecretkey
PG_HOST=localhost
PG_USER=postgres
PG_PASSWORD=yourpassword
PG_DATABASE=taskdb
PG_PORT=5432
MONGO_URI=your_mongodb_connection_string
WEBHOOK_URL=https://webhook.site/your-unique-url
node src/app.js
Server will start on:
http://localhost:5000
POST /api/auth/register
POST /api/auth/login
GET /api/auth/profile
POST /api/tasks
GET /api/tasks
GET /api/tasks/:id
PATCH /api/tasks/:id
DELETE /api/tasks/:id
- When a task is created with a due date, a reminder is scheduled.
- Reminder triggers before due time.
- Output is logged in console.
-
Tasks support:
- Category (e.g., Work, Personal)
- Tags (array of strings)
-
Enables filtering and better organization.
Tasks can be filtered using query parameters:
GET /api/tasks?category=Work
GET /api/tasks?tag=urgent
-
When a task is marked completed, a POST request is sent to an external webhook.
-
Payload includes:
- Task ID
- Title
- User ID
- Completion time
- Webhook retries up to 3 times
- Uses exponential backoff strategy
- Ensures reliability in case of failure
-
Hybrid Database Approach
- PostgreSQL for authentication (structured data)
- MongoDB for tasks (flexible schema)
-
Event Handling
- Used
setTimeoutfor lightweight scheduling - Suitable for small-scale/demo systems
- Used
-
Webhook Simulation
- External service simulated using webhook.site
The demo video includes:
- Creating a task with due date
- Reminder trigger in console
- Adding category and tags
- Fetching tasks
- Marking task as completed
- Webhook payload received
- Reminder system is in-memory (resets on server restart)
- Filtering and authentication simplified for demo purposes
- Designed for demonstration, not production-scale deployment
Mukul B.Tech CSE Backend Developer Intern Applicant