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.
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.
- React.js
- TailwindCSS
- Framer Motion
- Axios
- React Context API
- React Router DOM
- Node.js
- Express.js
- MongoDB (Mongoose)
- JWT Authentication
- bcrypt for password hashing
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/
β
βββ 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
ββββββββββββββββββββββ
β Frontend β
β React + Tailwind β
βββββββββββ¬βββββββββββ
β
β HTTP (Axios + JWT)
βΌ
ββββββββββββββββββββββ
β Backend β
β Node + Express β
ββββββββββββββββββββββ€
β Auth Middleware β
β Controllers β
β Error Middleware β
βββββββββββ¬βββββββββββ
β
β Mongoose ORM
βΌ
ββββββββββββββββββββββ
β MongoDB β
β User + Task Data β
ββββββββββββββββββββββ
- User interacts with React frontend
- Axios sends requests with JWT token
- Express middleware validates token
- Controller handles business logic
- Mongoose interacts with MongoDB
- Response sent back to frontend
The architecture follows clear separation of concerns and is designed for scalability.
- User registers β password hashed with bcrypt
- JWT token generated on login
- Token stored in localStorage
- Axios interceptor attaches token automatically
- Protected routes validate token via middleware
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.
POST /api/auth/register
POST /api/auth/login
GET /api/auth/profile
GET /api/tasks
POST /api/tasks
PUT /api/tasks/:id
DELETE /api/tasks/:id
- Password hashing using bcrypt
- JWT authentication
- Protected route middleware
- Token validation
- User ownership verification for tasks
- Error handling middleware
- Environment variable configuration
- 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
This application can be deployed using:
- Render
- Vercel
Backend:
PORT
MONGO_URI
JWT_SECRET
NODE_ENV=production
Frontend:
VITE_API_BASE_URL=https://your-backend-url/api
A Postman collection is included for API testing.
- Open Postman
- Import the file:
postman_collection.json - Set environment variable:
base_url = http://localhost:5000/api || https://your-backend-url/api - Test:
- Register
- Login (copy JWT token)
- Add token in Authorization β Bearer Token
- Test all task routes
git clone https://github.com/Vivek-DK/TaskManagement.git
cd TaskManagementcd backend
npm install
PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_secret_key
NODE_ENV=development
node server.js
cd Frontend
npm install
npm run dev
VITE_API_BASE_URL= 'https://your-backend-url/api'
https://task-management-vivek.vercel.app/
https://taskmanagement-cgzz.onrender.com
- Refresh token rotation
- Role-based authorization
- Redis caching
- Pagination for tasks
- Docker containerization
- CI/CD pipeline
- Glassmorphism dashboard layout
- Smooth animations via Framer Motion
- Responsive design
- Clean dark theme dashboard
- Interactive task cards
- Register a new user
- Login
- Create tasks
- Edit and delete tasks
- Refresh page (session persists)
- Logout and confirm protected route restriction
This project was built as part of a Frontend Developer Internship assessment to demonstrate:
- Full-stack integration
- Secure authentication
- Clean UI/UX
- Scalable architecture
Vivek D K
Frontend Developer