TaskFlow is a production-ready, modular RESTful backend API and a premium dark-themed Single Page Application (SPA) frontend. Built using Node.js, Express.js, and MongoDB, it follows the MVC (Model-View-Controller) architecture, implements secure JWT authentication/authorization, and provides centralized error handling.
Access the deployed application on any mobile, tablet, or desktop web browser here: 👉 TaskFlow Live App
- Modern Dark Theme: Radial background gradients with glassmorphic cards (
backdrop-filter). - Micro-Animations: Smooth button scale transformations, shimmer loading states for tasks, and slide-in alerts.
- Alert Toast System: Dynamic, non-intrusive notifications (success, warning, info, error) that automatically slide out.
- Fully Responsive: Crafted with vanilla CSS grid and flexbox to fit mobile, tablet, and desktop viewports.
- JWT-Based Authentication: Secure token generation and verification using JSON Web Tokens.
- Session Persistence: Automatic login restoration via
localStoragestate checks. - Secure Cryptography: Password hashing using
bcryptjswith salting pre-save hooks. - Role-Based Access Control: Route guards (
protect&restrictTo) to manage standarduservs.adminpermissions.
- Full CRUD Operations: Users can create, read, update, and delete their own tasks.
- Real-time Stats Board: Live metrics counters showing Total Tasks, Pending/In Progress, and Completed tasks.
- Filters & Searching: Advanced query features to search task titles and filter by priority or status.
- Admin Controls: Administrative privileges to view, edit, or delete tasks belonging to any user.
- Backend: Node.js, Express.js
- Database: MongoDB Atlas (Cloud Database), Mongoose ODM
- Frontend: HTML5, Vanilla CSS3 (Custom Variables, Keyframe Animations), Modern JS (ES Modules)
- Icons & Typography: Lucide Icons, Google Fonts (Inter)
- Security: JSON Web Tokens (JWT), BcryptJS
- Hosting: Render.com
REST_FULL_backend_API/
├── public/ # Static Frontend SPA Assets
│ ├── css/
│ │ └── style.css # Custom Glassmorphic CSS Styling
│ ├── js/
│ │ └── app.js # Client-side State & Fetch Controller
│ └── index.html # Dashboard Markup & Structures
├── src/ # Backend Source Code
│ ├── config/
│ │ └── db.js # Mongoose MongoDB Connection Config
│ ├── controllers/
│ │ ├── authController.js
│ │ └── taskController.js
│ ├── middleware/
│ │ ├── authMiddleware.js # JWT guards & Role authorization checks
│ │ └── errorMiddleware.js# Centralized global error handler
│ ├── models/
│ │ ├── User.js # Mongoose User Schema & Encryptions
│ │ └── Task.js # Mongoose Task Schema (references User)
│ ├── routes/
│ │ ├── authRoutes.js
│ │ └── taskRoutes.js
│ ├── utils/
│ │ ├── appError.js # Custom Operational Error constructor
│ │ └── catchAsync.js # Wrapper to eliminate try-catch boilerplate
│ └── app.js # Express core configurations & middleware
├── .env.example # Environment variables template
├── server.js # Main Server entrypoint & global error handlers
└── verify.js # Programmatic end-to-end API test script
| HTTP Method | Route | Description | Auth Required |
|---|---|---|---|
POST |
/api/v1/auth/register |
Register a new user | No |
POST |
/api/v1/auth/login |
Login user & retrieve JWT token | No |
GET |
/api/v1/auth/me |
Fetch authenticated user profile details | Yes |
| HTTP Method | Route | Description | Auth Required |
|---|---|---|---|
POST |
/api/v1/tasks |
Create a new task (automatically owned by user) | Yes |
GET |
/api/v1/tasks |
Get all tasks (User's own tasks, or all tasks for Admin) | Yes |
GET |
/api/v1/tasks/:id |
Fetch specific task (with ownership authorization) | Yes |
PATCH |
/api/v1/tasks/:id |
Update task details (title, description, status, priority) | Yes |
DELETE |
/api/v1/tasks/:id |
Delete a specific task | Yes |
Make sure you have Node.js and MongoDB installed locally.
-
Clone the Repository
git clone https://github.com/Parasjain1234/RESTful-Backend-API.git cd RESTful-Backend-API -
Install Dependencies
npm install
-
Configure Environment Variables Create a
.envfile in the root directory based on the.env.example:PORT=5000 NODE_ENV=development MONGODB_URI=mongodb://127.0.0.1:27017/taskmanager JWT_SECRET=your-32-character-long-secret-key-string JWT_EXPIRES_IN=90d
-
Run the Server
- Development Mode (with auto-reload):
npm run dev
- Production Mode:
npm start
- Development Mode (with auto-reload):
-
Access the App Open your browser and navigate to:
http://localhost:5000