Skip to content

About

Full-stack task management web app with JWT authentication, protected routes, and CRUD operations built using React, Node.js, Express, and MongoDB.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Scalable Task Management Web App

A full-stack web application built with React + Node.js + Express + MongoDB implementing secure authentication, protected routes, and full CRUD functionality with search & filter UI.


πŸ“Œ Project Overview

This project is a scalable task management dashboard featuring:

  • πŸ” JWT-based Authentication (Register / Login / Logout)
  • πŸ›‘ Protected Routes
  • πŸ“¦ Full CRUD Operations on Tasks (Sample Entity)
  • πŸ”Ž Search and Filter UI
  • 🎨 Modern UI with TailwindCSS + Framer Motion
  • πŸ”‘ Password Hashing with bcrypt
  • βš™ Clean Modular Backend Architecture

The system is designed with scalability and maintainability in mind.


πŸ— Tech Stack

Frontend

  • React.js
  • TailwindCSS
  • Framer Motion
  • Axios
  • React Context API
  • React Router DOM

Backend

  • Node.js
  • Express.js
  • MongoDB (Mongoose)
  • JWT Authentication
  • bcrypt for password hashing

πŸ“‚ Project Structure

Backend (Node.js + Express + MongoDB)

backend/
β”‚
β”œβ”€β”€ config/
β”‚   └── db.js                
β”‚
β”œβ”€β”€ controllers/
β”‚   β”œβ”€β”€ authController.js    
β”‚   └── taskController.js    
β”‚
β”œβ”€β”€ middleware/
β”‚   β”œβ”€β”€ authMiddleware.js    
β”‚   └── errorMiddleware.js   
β”‚
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ User.js              
β”‚   └── Task.js              
β”‚
β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ authRoutes.js        
β”‚   └── taskRoutes.js        
β”‚
β”œβ”€β”€ utils/
β”‚   └── generateToken.js     
β”‚
β”œβ”€β”€ .env                     
β”œβ”€β”€ server.js                
└── package.json             

Frontend (React + Vite + Tailwind CSS)

frontend/
β”‚
β”œβ”€β”€ public/
β”‚
β”œβ”€β”€ src/
β”‚   β”‚
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   └── axios.js          
β”‚   β”‚
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ Navbar.jsx
β”‚   β”‚   β”œβ”€β”€ TaskForm.jsx
β”‚   β”‚   └── TaskList.jsx
β”‚   β”‚
β”‚   β”œβ”€β”€ context/
β”‚   β”‚   └── AuthContext.jsx   
β”‚   β”‚
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ Login.jsx
β”‚   β”‚   β”œβ”€β”€ Register.jsx
β”‚   β”‚   └── Dashboard.jsx
β”‚   β”‚
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   └── ProtectedRoute.jsx  
β”‚   β”‚
β”‚   β”œβ”€β”€ App.jsx
β”‚   β”œβ”€β”€ main.jsx
β”‚   └── index.css
β”‚
β”œβ”€β”€ .env                     
└── package.json             



πŸ— Architecture Overview

                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚      Frontend      β”‚
                β”‚  React + Tailwind  β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
                          β”‚ HTTP (Axios + JWT)
                          β–Ό
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚      Backend       β”‚
                β”‚  Node + Express    β”‚
                β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
                β”‚  Auth Middleware   β”‚
                β”‚  Controllers       β”‚
                β”‚  Error Middleware  β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
                          β”‚ Mongoose ORM
                          β–Ό
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚      MongoDB       β”‚
                β”‚  User + Task Data  β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Flow Explanation

  1. User interacts with React frontend
  2. Axios sends requests with JWT token
  3. Express middleware validates token
  4. Controller handles business logic
  5. Mongoose interacts with MongoDB
  6. Response sent back to frontend

The architecture follows clear separation of concerns and is designed for scalability.


πŸ” Authentication Flow

  1. User registers β†’ password hashed with bcrypt
  2. JWT token generated on login
  3. Token stored in localStorage
  4. Axios interceptor attaches token automatically
  5. Protected routes validate token via middleware

πŸ“¦ CRUD Operations (Tasks)

Each authenticated user can:

  • Create a task
  • View their tasks
  • Update their tasks
  • Delete their tasks
  • Search tasks (title/description)
  • Filter by status (Pending / Completed)

Tasks are user-specific and protected by ownership validation.


πŸ”„ API Endpoints

Auth Routes

POST /api/auth/register
POST /api/auth/login
GET /api/auth/profile

Task Routes

GET /api/tasks
POST /api/tasks
PUT /api/tasks/:id
DELETE /api/tasks/:id


πŸ›‘ Security Practices Implemented

  • Password hashing using bcrypt
  • JWT authentication
  • Protected route middleware
  • Token validation
  • User ownership verification for tasks
  • Error handling middleware
  • Environment variable configuration

πŸ“ˆ Scalability Considerations

  • Modular backend architecture
  • Separation of concerns (routes/controllers/models)
  • Context-based frontend auth management
  • Axios interceptor for centralized API config
  • Functional state updates to prevent stale data bugs
  • Defensive UI handling for unexpected API shapes

πŸš€ Production Deployment Notes

This application can be deployed using:

Backend Deployment

  • Render

Frontend Deployment

  • Vercel

Environment Variables Required (Production)

Backend:

PORT
MONGO_URI
JWT_SECRET
NODE_ENV=production

Frontend:

VITE_API_BASE_URL=https://your-backend-url/api

πŸ“¬ API Postman Collection

A Postman collection is included for API testing.

How to Use

  1. Open Postman
  2. Import the file:
    postman_collection.json
    
  3. Set environment variable:
    base_url = http://localhost:5000/api || https://your-backend-url/api
    
  4. Test:
    • Register
    • Login (copy JWT token)
    • Add token in Authorization β†’ Bearer Token
    • Test all task routes

πŸ› οΈ Installation & Setup

1️⃣ Clone the repository

git clone https://github.com/Vivek-DK/TaskManagement.git
cd TaskManagement

2️⃣ Backend Setup

cd backend
npm install

Create .env file inside Backend/

PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_secret_key
NODE_ENV=development

Start backend

node server.js

3️⃣ Frontend Setup

cd Frontend
npm install
npm run dev

Create .env file inside Backend/

VITE_API_BASE_URL= 'https://your-backend-url/api'

Frontend runs on:

https://task-management-vivek.vercel.app/

Backend runs on:

https://taskmanagement-cgzz.onrender.com


Future production improvements could include:

  • Refresh token rotation
  • Role-based authorization
  • Redis caching
  • Pagination for tasks
  • Docker containerization
  • CI/CD pipeline

🎨 UI/UX Highlights

  • Glassmorphism dashboard layout
  • Smooth animations via Framer Motion
  • Responsive design
  • Clean dark theme dashboard
  • Interactive task cards

πŸ§ͺ Testing Instructions

  1. Register a new user
  2. Login
  3. Create tasks
  4. Edit and delete tasks
  5. Refresh page (session persists)
  6. Logout and confirm protected route restriction

πŸ“¬ Submission

This project was built as part of a Frontend Developer Internship assessment to demonstrate:

  • Full-stack integration
  • Secure authentication
  • Clean UI/UX
  • Scalable architecture

πŸ‘¨β€πŸ’» Author

Vivek D K

Frontend Developer

About

Full-stack task management web app with JWT authentication, protected routes, and CRUD operations built using React, Node.js, Express, and MongoDB.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages