Organize your work. Track your progress. Stay productive.
Features β’ Screenshots β’ Quick Start β’ API Docs β’ Tech Stack
| Login | Dashboard |
|---|---|
![]() |
![]() |
| Create Task Modal | My Tasks (Search, Filter & Sort) |
|---|---|
![]() |
![]() |
| User Profile | MongoDB Atlas Collections |
|---|---|
![]() |
![]() |
- Secure user registration with field validation
- JWT-based login with configurable token expiry (default 7 days)
- bcrypt password hashing (salt rounds: 12) β plain-text passwords never stored
- Protected API routes β every endpoint validates the JWT
- Data isolation β users can only access their own tasks (enforced at DB query level)
- Sensitive fields (
password) excluded from all API responses
- Create tasks with title, description, priority, status, and due date
- View, update, and delete your tasks
- Status tracking β
PendingβIn ProgressβCompleted - Priority levels β
Low/Medium/High - Overdue highlighting β tasks past their due date are visually flagged
- Case-insensitive partial search by task title
- Filter by status and priority simultaneously
- Sort by creation date (newest/oldest) or due date
- Pagination β 10 tasks per page with navigation controls
- Total tasks count
- Pending / In Progress / Completed counts
- Overdue task count (non-completed tasks past due date)
- Completion percentage β
(Completed / Total) Γ 100 - Animated progress bar
- View your name, email, and account creation date
- Update your display name
| Tool | Version |
|---|---|
| Node.js | v18+ |
| npm | v9+ |
| MongoDB | Local or Atlas |
git clone https://github.com/Keerthanareddy1106/taskflow-mern.git
cd taskflow-merncp server/.env.example server/.envEdit server/.env:
PORT=5000
MONGO_URI=mongodb://localhost:27017/taskflow
JWT_SECRET=your_super_long_random_secret_here
JWT_EXPIRES_IN=7d
NODE_ENV=development
β οΈ Never commit.envto version control. It is already listed in.gitignore.
# Install both server and client dependencies
cd server && npm install
cd ../client && npm installTerminal 1 β Backend (port 5000):
cd server
npm run devTerminal 2 β Frontend (port 5173):
cd client
npm run devhttp://localhost:5173
Register a new account and start managing your tasks!
Base URL: http://localhost:5000/api
Authentication: Add Authorization: Bearer <token> header to all protected requests.
| Method | Endpoint | Auth | Description |
|---|---|---|---|
POST |
/auth/register |
β | Register a new user |
POST |
/auth/login |
β | Login and receive JWT |
GET |
/auth/me |
β | Get current user info |
POST /api/auth/register
Content-Type: application/json
{
"name": "Jane Doe",
"email": "jane@example.com",
"password": "secret123",
"confirmPassword": "secret123"
}POST /api/auth/login
Content-Type: application/json
{
"email": "jane@example.com",
"password": "secret123"
}Response:
{
"success": true,
"data": {
"token": "eyJhbGc...",
"user": { "_id": "...", "name": "Jane Doe", "email": "jane@example.com" }
}
}All task endpoints require
Authorization: Bearer <token>
| Method | Endpoint | Description |
|---|---|---|
POST |
/tasks |
Create a new task |
GET |
/tasks |
Get all tasks (filterable) |
GET |
/tasks/stats |
Get dashboard statistics |
GET |
/tasks/:id |
Get a single task |
PUT |
/tasks/:id |
Update a task |
DELETE |
/tasks/:id |
Delete a task |
| Parameter | Type | Values | Default |
|---|---|---|---|
search |
string | Any text | β |
status |
string | Pending | In Progress | Completed |
β |
priority |
string | Low | Medium | High |
β |
sortBy |
string | createdAt | dueDate | title |
createdAt |
order |
string | asc | desc |
desc |
page |
number | β | 1 |
limit |
number | max 100 |
10 |
Example:
GET /api/tasks?status=Pending&priority=High&sortBy=dueDate&order=asc&page=1&limit=10
Authorization: Bearer <token>{
"title": "Design database schema",
"description": "Define collections, fields, and relationships",
"priority": "High",
"status": "In Progress",
"dueDate": "2024-12-31"
}{
"success": true,
"data": {
"stats": {
"total": 15,
"pending": 5,
"inProgress": 4,
"completed": 6,
"overdue": 2,
"completionPercentage": 40
}
}
}| Method | Endpoint | Description |
|---|---|---|
GET |
/users/profile |
Get user profile |
PATCH |
/users/profile |
Update profile name |
| Code | Meaning |
|---|---|
200 |
Success |
201 |
Created |
400 |
Bad Request / Validation Error |
401 |
Unauthorized (missing / invalid / expired token) |
403 |
Forbidden |
404 |
Not Found |
409 |
Conflict (e.g., duplicate email) |
500 |
Internal Server Error |
{
_id: ObjectId,
name: String (required, 2β50 chars),
email: String (required, unique, lowercase),
password: String (bcrypt hash β never returned in responses),
createdAt: Date,
updatedAt: Date
}{
_id: ObjectId,
title: String (required, max 200 chars),
description: String (optional, max 1000 chars),
status: "Pending" | "In Progress" | "Completed",
priority: "Low" | "Medium" | "High",
dueDate: Date | null,
userId: ObjectId (ref: User), // ownership field
createdAt: Date,
updatedAt: Date
}Indexes:
{ userId: 1 }β fast per-user queries{ userId: 1, status: 1 }β status filtering{ userId: 1, priority: 1 }β priority filtering{ userId: 1, dueDate: 1 }β due date sorting{ title: "text" }β full-text search
taskflow-mern/
β
βββ client/ # React.js frontend (Vite)
β βββ src/
β βββ components/
β β βββ Sidebar.jsx # Navigation sidebar
β β βββ TaskModal.jsx # Create/Edit task form
β β βββ ConfirmDialog.jsx # Delete confirmation
β β βββ Shared.jsx # Badges, Spinner, EmptyState
β βββ context/
β β βββ AuthContext.jsx # Auth state & token management
β βββ pages/
β β βββ Login.jsx # Login page
β β βββ Register.jsx # Registration page
β β βββ Dashboard.jsx # Stats & recent tasks
β β βββ Tasks.jsx # Task list with CRUD
β β βββ Profile.jsx # Profile management
β βββ routes/
β β βββ ProtectedRoute.jsx # Route guards
β βββ services/
β β βββ api.js # Axios instance + interceptors
β β βββ taskflowService.js # API service functions
β βββ App.jsx # Router & providers
β βββ main.jsx # Entry point
β βββ index.css # Custom responsive CSS
β
βββ server/ # Node.js / Express backend
β βββ src/
β βββ config/
β β βββ database.js # MongoDB connection
β βββ controllers/
β β βββ authController.js # Register, Login, GetMe
β β βββ taskController.js # Task CRUD + Stats
β β βββ userController.js # Profile CRUD
β βββ middleware/
β β βββ authMiddleware.js # JWT protect middleware
β β βββ errorMiddleware.js # Centralized error handler
β β βββ validationMiddleware.js
β βββ models/
β β βββ User.js # Mongoose User schema
β β βββ Task.js # Mongoose Task schema
β βββ routes/
β β βββ authRoutes.js
β β βββ taskRoutes.js
β β βββ userRoutes.js
β βββ utils/
β β βββ generateToken.js # JWT signing helper
β βββ validators/
β β βββ authValidators.js # Registration & login rules
β β βββ taskValidators.js # Task create/update rules
β βββ server.js # Express app entry point
β
βββ .gitignore
βββ package.json # Root dev scripts
βββ README.md
| Category | Technology |
|---|---|
| Frontend | React 18, React Router v6, Vite |
| HTTP Client | Axios (with interceptors) |
| Backend | Node.js 18+, Express.js 4.x |
| Database | MongoDB, Mongoose ODM |
| Authentication | JSON Web Tokens (JWT), bcryptjs |
| Validation | express-validator |
| Icons | Lucide React |
| Notifications | react-hot-toast |
- Register β
POST /api/auth/register - Login β
POST /api/auth/loginβ copytoken - Set header
Authorization: Bearer <token>on all task requests - Create tasks β
POST /api/tasks - Test filtering β
GET /api/tasks?status=Pending&priority=High - Test isolation β Register a second user and verify you cannot see the first user's tasks
- Dashboard β
GET /api/tasks/stats
- Register with valid data
- Register with duplicate email β expect
409 - Login with wrong password β expect
401 - Access
/taskswithout token β expect401 - Create task without title β expect
400 - Create, read, update, delete a task
- Filter by status and priority
- Search by partial title (case-insensitive)
- Verify another user's tasks are not returned
- Verify dashboard stats are accurate
| Measure | Implementation |
|---|---|
| Password hashing | bcrypt with 12 salt rounds |
| Token secret | Stored in .env, never in source code |
| Password field | select: false in Mongoose β excluded from all responses |
| Ownership enforcement | userId filter on every task query/mutation |
| Input validation | express-validator on all POST/PUT/PATCH endpoints |
| Error messages | Generic messages for auth failures (no user enumeration) |
| Production errors | Stack traces only in development mode |
| Priority | Feature |
|---|---|
| π΅ High | Automated tests (Jest + Supertest) |
| π΅ High | CI/CD pipeline (GitHub Actions) |
| π‘ Medium | Refresh token + revocation |
| π‘ Medium | Email reminders for approaching deadlines |
| π‘ Medium | Kanban drag-and-drop board |
| π’ Low | Team collaboration & task assignment |
| π’ Low | Real-time updates via Socket.IO |
| π’ Low | Google OAuth login |
| π’ Low | File attachments |
| π’ Low | Admin dashboard |
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -m "feat: add my feature" - Push the branch:
git push origin feature/my-feature - Open a Pull Request
This project is licensed under the MIT License.
Built with β€οΈ using the MERN Stack





