Assignment 4: CRUD with Client-Side Rendering
A full-stack MERN task management dashboard designed for open-source collaboration, feature branching, and pull request reviews.
TaskFlow is a modern, responsive web application for collaborative team task management. Built with a React (Vite) frontend and a Node.js/Express/MongoDB backend, it implements strict Role-Based Access Control (Admin and Standard User), JWT authentication, password hashing, and clean RESTful API standards.
This repository is intentionally published with exactly six isolated features left incomplete for Assignment 4. External contributors can fork the repository, pick one documented issue, implement the solution on a dedicated branch, and submit a Pull Request for review.
- 🔐 Authentication & Security: Secure registration and login using bcrypt password hashing, JWT Bearer tokens, and protected API endpoints.
- 👥 Role-Based Authorization (RBAC):
- Admin: Full CRUD capabilities — create tasks, update any task, assign tasks, and delete tasks.
- Standard User: Scoped visibility — view only tasks assigned to them, and update status of their own tasks.
- 📊 Dashboard Overview: Live metric widgets (Total Permitted Tasks, In Progress, Completed, High Priority) and recent tasks table.
- 📋 Task Directory: Responsive table displaying task titles, description excerpts, assignees, priorities, statuses, and due dates.
- 🔍 Task Details View: Detailed modal/page view displaying full metadata, timestamps, assignees, and quick status switcher.
- ⚡ Dynamic Status Transitions: Quick status switcher allowing permitted users to transition tasks between
TODO,IN_PROGRESS, andCOMPLETED. - 🎨 Modern SaaS Design: Built with custom Vanilla CSS tokens, Plus Jakarta Sans typography, sleek cards, status badges, and mobile-responsive drawer navigation.
- 🧪 Automated Testing Suite: 16 automated integration tests using Jest and Supertest validating authentication, task CRUD, role restrictions, and validation rules.
The following six features are deliberately incomplete and correspond to open issues:
- Task Search: Search bar accepts input, but does not filter tasks by title or description.
- Task Status Filter: Status dropdown updates value, but does not filter tasks by
TODO,IN_PROGRESS, orCOMPLETED. - Priority Filter: Priority dropdown updates value, but does not filter tasks by
LOW,MEDIUM, orHIGH. - Task Form Validation: Client-side form allows submitting blank/whitespace titles without inline error messages.
- Admin Task Assignment: Assignee selector loads users, but does not attach
assignedToto the submitted payload. - Task Pagination: All tasks render at once; page numbers and previous/next buttons are non-functional.
| Layer | Technologies |
|---|---|
| Frontend | React 19, Vite, React Router DOM v7, Axios, Lucide React, Vanilla CSS |
| Backend | Node.js (v20+), Express.js, MongoDB Atlas / Local MongoDB, Mongoose 8 |
| Authentication | JSON Web Tokens (jsonwebtoken), bcryptjs password hashing |
| Testing | Jest, Supertest |
| Deployment Targets | Vercel (Frontend), Render (Backend) |
- Project Author & Maintainer: Aman Kumar
- Open Source Contributors: Open for community pull requests via GitHub Issues.
task-management-system/
├── backend/
│ ├── src/
│ │ ├── config/ # Database configuration (db.js)
│ │ ├── controllers/ # Route controllers (authController, taskController, userController)
│ │ ├── middleware/ # Auth & centralized error handling (auth.js, errorHandler.js)
│ │ ├── models/ # Mongoose models (User.js, Task.js)
│ │ ├── routes/ # REST route handlers (authRoutes, taskRoutes, userRoutes)
│ │ ├── utils/ # Database seed script (seed.js)
│ │ ├── app.js # Express app instance and middleware
│ │ └── server.js # Server listener and database connector
│ ├── tests/ # Automated API tests (api.test.js)
│ ├── .env.example # Backend environment variable template
│ ├── .gitignore # Backend gitignore rules
│ └── package.json # Backend scripts and dependencies
├── frontend/
│ ├── public/ # Static public assets
│ ├── src/
│ │ ├── components/ # Reusable UI (Navbar, Sidebar, TaskTable, TaskFilters, TaskForm, etc.)
│ │ ├── context/ # React Context (AuthContext.jsx)
│ │ ├── hooks/ # Custom hooks (useTasks.js)
│ │ ├── pages/ # Route views (Dashboard, Tasks, TaskDetail, CreateTask, EditTask, Auth)
│ │ ├── services/ # API client and service layers (api.js, authService.js, taskService.js)
│ │ ├── App.jsx # Route declarations and app shell
│ │ ├── index.css # Vanilla CSS design system
│ │ └── main.jsx # React application entry point
│ ├── index.html # HTML template
│ ├── .env.example # Frontend environment variable template
│ ├── .gitignore # Frontend gitignore rules
│ └── package.json # Frontend scripts and dependencies
├── issues/ # The 6 issue specifications for contributors
│ ├── issue-1-task-search.md
│ ├── issue-2-task-status-filter.md
│ ├── issue-3-priority-filter.md
│ ├── issue-4-task-form-validation.md
│ ├── issue-5-admin-task-assignment.md
│ └── issue-6-pagination.md
├── scripts/
│ └── create-github-issues.sh # Script to publish the 6 issues to GitHub
├── .gitignore # Root gitignore rules
├── package.json # Root workspace runner scripts
└── README.md # Project documentation
All endpoints are prefixed with /api. Protected routes require a valid Authorization: Bearer <token> header.
| Method | Endpoint | Access | Description |
|---|---|---|---|
POST |
/api/auth/register |
Public | Register new standard user account (name, email, password) |
POST |
/api/auth/login |
Public | Authenticate user credentials and return JWT token |
GET |
/api/auth/me |
Private | Retrieve authenticated user profile |
| Method | Endpoint | Access | Description |
|---|---|---|---|
GET |
/api/tasks |
Private | Retrieve tasks (Admin: all tasks; Standard User: assigned tasks only) |
GET |
/api/tasks/:id |
Private | Retrieve specific task (Admin: any; Standard User: assigned only) |
POST |
/api/tasks |
Private / Admin | Create a new task with title, description, priority, and due date |
PUT |
/api/tasks/:id |
Private / Admin | Update entire task record |
PATCH |
/api/tasks/:id/status |
Private / Admin & Assigned User | Update task status (TODO, IN_PROGRESS, COMPLETED) |
DELETE |
/api/tasks/:id |
Private / Admin | Permanently delete a task |
| Method | Endpoint | Access | Description |
|---|---|---|---|
GET |
/api/users |
Private / Admin | Fetch list of users for task assignment dropdown |
PORT=5000
MONGODB_URI=mongodb://localhost:27017/taskflow
JWT_SECRET=your_jwt_secret_key_change_in_production
JWT_EXPIRES_IN=7d
CLIENT_URL=http://localhost:5173
NODE_ENV=development
VITE_API_URL=http://localhost:5000/api
- Node.js >= 18.x
- MongoDB (running locally or a MongoDB Atlas connection string)
- Git
git clone https://github.com/armnkumar321-spec/task-management-system.git
cd task-management-system
cd backend
cp .env.example .env
# Adjust MONGODB_URI or JWT_SECRET in .env if needed
npm install
npm run seed # Seeds demo users and sample tasks into MongoDB
npm run dev # Starts Express API server on http://localhost:5000
In a new terminal window:
cd frontend
cp .env.example .env
npm install
npm run dev # Starts Vite development server on http://localhost:5173
From the project root:
npm run install:all— Installs dependencies for both backend and frontend.npm run dev:backend— Starts backend development server.npm run dev:frontend— Starts frontend development server.npm run seed— Re-seeds the database with demo data.npm run test— Runs automated Jest backend integration test suite.npm run build— Validates frontend build production bundle.
Use these pre-seeded accounts to explore role-based permissions:
| Role | Password | Permissions | |
|---|---|---|---|
| Admin | [email protected] |
Admin@123456 |
Full access: create, edit, assign, delete any task |
| Standard User | [email protected] |
User@123456 |
View assigned tasks, update assigned task status |
| Team Member 1 | [email protected] |
User@123456 |
View assigned tasks, update assigned task status |
| Team Member 2 | [email protected] |
User@123456 |
View assigned tasks, update assigned task status |
Contributors can choose one of the following isolated issues:
| # | Title | Issue Link | Spec File | Suggested Label |
|---|---|---|---|---|
| 1 | [Feature] Implement task search by title and description | #1 on GitHub | issue-1-task-search.md | enhancement, good first issue |
| 2 | [Feature] Fix task status filtering | #2 on GitHub | issue-2-task-status-filter.md | enhancement, good first issue |
| 3 | [Feature] Implement priority filtering | #3 on GitHub | issue-3-priority-filter.md | enhancement, good first issue |
| 4 | [Bug] Add client-side task form validation | #4 on GitHub | issue-4-task-form-validation.md | bug, good first issue |
| 5 | [Feature] Complete Admin task assignment functionality | #5 on GitHub | issue-5-admin-task-assignment.md | enhancement |
| 6 | [Feature] Add pagination to the task list | #6 on GitHub | issue-6-pagination.md | enhancement, good first issue |
We welcome contributions from everyone participating in Assignment 4! Follow these steps:
- Fork the Repository: Click the Fork button on GitHub to create your own copy.
- Clone your fork:
git clone https://github.com/<your-username>/<repo-name>.git cd <repo-name> - Create a Feature Branch: Branch name should reference the issue:
git checkout -b feature/issue-1-task-search - Implement the Solution: Refer to the corresponding issue specification in the
issues/directory and inlineTODOcomments. - Test Your Solution:
- Confirm backend tests pass:
npm run test - Confirm frontend builds cleanly:
npm run build - Test manually in the browser.
- Confirm backend tests pass:
- Commit and Push:
git add . git commit -m "feat(tasks): implement search by title and description (#1)" git push origin feature/issue-1-task-search - Open a Pull Request: Open a PR against the
mainbranch of the upstream repository with a clear description and testing proof.
- Create a Web Service on Render.
- Root directory:
backend. - Build command:
npm install. - Start command:
node src/server.js. - Set environment variables:
PORT=5000,MONGODB_URI,JWT_SECRET,CLIENT_URL.
- Import repository on Vercel.
- Framework Preset: Vite.
- Root directory:
frontend. - Build command:
npm run build. - Output directory:
dist. - Set environment variable:
VITE_API_URL=https://<your-render-backend-url>/api.
This project is open-source under the MIT License.