A Leave Management System built with React, Node.js, Express, and MySQL. It supports multi-role architecture: Employee, Manager, HR, and Admin, with features like multi-level approvals, real-time calendar view of team leaves, Redis queueing for bulk operations, and detailed leave policies and balances.
- Employee, Manager, HR:
- Submit leave requests
- View leave balance and history
- Cancel leaves
- Change their password
- Manager, HR:
- View incoming leave requests from their team
- Approve or reject leave requests
- View team leave calendar
- Admin:
- Full access to leave requests and approvals
- Manage users and leave types/policies
- View who's on leave today
- Upload users in bulk using Redis and Bull
- Approve/Reject as per special criteria
- ✅ Multi-level leave approval workflow
- 📊 Accurate leave balance tracking with used, remaining, and max limits
- ❌ Overlapping leave prevention
- 📦 Bulk user upload with Redis + Bull
- 📆 Calendar UI to visualize team leave status
- 🔐 Password update capability
- 🧭 Role-based access control with middleware
- 🔁 Reusable Express middleware for authentication and role checking
users– User detailsroles– Defines available rolesleave_requests– Leave submissionsleave_approvals– Tracks each level of approvalleave_types– Types of leavesleave_policies– Policy metadataleave_balances– Tracks current leave balances and used leaves per user
POST /login– Login as a userPOST /register– [Admin only] Register a new userGET /users– [Admin only] Fetch all usersPOST /upload-users– [Admin only] Bulk upload users using Excel + RedisPUT /password/:userId– Update user password
POST /request– Submit a leave requestPUT /cancel/:leaveRequestId– Cancel a submitted leaveGET /history/:userId– Get leave history for a userGET /requests/history/:userId– Get all requests submitted by the user
GET /balance/:userId– Get leave balance for a specific user
GET /requests/:userId– View incoming leave requests (Manager, HR, Admin)PUT /approve/:approveId– Approve a pending leavePUT /reject/:rejectId– Reject a pending leave
GET /types/:userId– Fetch leave types applicable to the user’s roleGET /types– Fetch all leave typesPOST /types– [Admin only] Create a new leave typePUT /types/:id– [Admin only] Update a leave typeDELETE /types/:id– [Admin only] Delete a leave type
GET /on-leave-today– [Admin only] List users on leave todayGET /team-leaves– View team leave status in a calendar-style view
- React.js
- React Router for navigation
- Recharts for charts
- Custom calendar and dashboard components
- Node.js + Express.js
- MySQL + TypeORM (ORM)
- Redis + Bull for queueing (bulk uploads)
- Role-based access control
- Middleware-based authentication using JWT
- MySQL:
- Normalized structure
- Support for multi-approver workflows
- Optimized indexes and relations
This project includes seeder scripts, so when you run the backend with synchronize: true enabled in your TypeORM configuration:
- You just need to create a db and mention that in env
- All required tables will be created automatically
- Initial data like roles, leave types, and default admin user will be inserted automatically