Skip to content

bilal-rauf-dev/taskflow-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation


TaskFlow

Node.js  Express  MongoDB  React  Vite  TailwindCSS  JWT  Swagger


A complete full-stack task management platform with JWT authentication, role-based access control, task CRUD operations, Swagger docs, and a polished responsive UI.



Tech Stack

Layer Technology
Node.js Node.js, Express.js
Frontend React, Vite, Tailwind CSS
Database MongoDB, Mongoose
Auth JWT, bcryptjs
Docs Swagger UI, swagger-jsdoc

Prerequisites

Node  MongoDB  npm


Setup

Backend

# Install dependencies
cd backend
npm install

# Configure environment
copy .env.example .env

# Start development server
npm run dev

# Seed demo data
npm run seed

Frontend

# In a second terminal
cd frontend
npm install
npm run dev

Environment Variables

Variable Description Example
PORT Express server port 5000
MONGO_URI MongoDB connection string mongodb://localhost:27017/intern_db
JWT_SECRET JWT signing secret your_super_secret_key
JWT_EXPIRES_IN JWT expiration duration 7d
NODE_ENV Runtime environment development

API Reference

Base URL: http://localhost:5000/api/v1

Auth

Method Endpoint Auth Description
POST /auth/register Register a new user
POST /auth/login Login and receive JWT
GET /auth/me Required Fetch authenticated user

Tasks

Method Endpoint Auth Description
GET /tasks Required Get tasks (all if admin)
POST /tasks Required Create a new task
GET /tasks/:id Required Get one task by ID
PUT /tasks/:id Required Update a task
DELETE /tasks/:id Required Delete a task
GET /tasks/admin/all Admin only All tasks with owner info

Default Credentials

Run npm run seed after connecting MongoDB to populate these accounts and five sample tasks.

Role Email Password
Admin admin@admin.com admin123
User test@test.com test123

Docs & Testing

Swagger UI: http://localhost:5000/api/docs

Postman: Import postman_collection.json — includes environment variables, folder organization, and sample requests for auth, tasks, and admin endpoints.


Scalability Notes

The backend can be placed behind an Nginx reverse proxy or cloud load balancer for horizontal scaling, zero-downtime deployments, and improved throughput.

Redis is a natural next step for caching frequently accessed data, auth metadata, and rate-limit state — reducing repeated reads against MongoDB.

MongoDB Atlas with replica sets provides high availability, automated backups, and a seamless path from local development to a production-managed cluster.

Docker & Docker Compose can package all services into reproducible containers. As the product grows, the monolith can be split into dedicated Auth, Task, and Notification services. Rate limiting and input validation are already in place as the baseline security layer for that path.

About

A Full-stack task management platform built with a MERN stack.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages