A full-stack Employee Leave Management System built using the MERN stack. The application enables employees to apply for leave, manage profiles, track leave balances, and monitor leave requests, while managers can review requests, manage employees, and monitor workforce availability through a dedicated dashboard.
- JWT-based authentication
- Secure password hashing using bcrypt
- Role-based access control
- Employee and Manager roles
- Protected frontend and backend routes
- Persistent login sessions
- View personal profile
- Update profile information
- Upload profile picture
- Change password
- Apply for leave requests
- Select leave type
- Add leave reason
- Upload supporting documents
- Automatic leave duration calculation
- Leave balance validation
- View leave history
- Track leave request status
- View manager remarks
- Personal leave statistics
- Available leave balance
- Leave request summary
- View all employees
- Search employees by:
- Name
- Employee ID
- View detailed employee profiles
- Update employee department
- Update employee designation
- Review leave requests
- View leave reasons
- View leave attachments
- Approve requests
- Reject requests
- Add manager remarks
- Track request status
- View workforce availability for any date
- Quick access to:
- Yesterday
- Today
- Tomorrow
- Custom date selection
- View:
- Total Employees
- Employees On Duty
- Employees On Leave
- Direct navigation to employee details
- Real-time workforce availability tracking
- Employee count
- Approved leave count
- Rejected leave count
- Pending leave count
- Leave request statistics
- Leave overlap detection
- Automatic leave balance deduction
- Leave balance validation
- Leave duration calculation
- Leave approval workflow
- Leave status tracking
- Leave attachment support
- React.js
- Vite
- Tailwind CSS
- React Router DOM
- Axios
- Lucide React
- Node.js
- Express.js
- MongoDB Atlas
- Mongoose
- JWT Authentication
- bcryptjs
- Multer
Employee Leave Management System
│
├── backend
│ ├── config
│ ├── controllers
│ ├── middleware
│ ├── models
│ ├── routes
│ ├── uploads
│ ├── utils
│ └── package.json
│
├── frontend
│ ├── src
│ │ ├── api
│ │ ├── components
│ │ ├── context
│ │ ├── layout
│ │ ├── pages
│ │ └── routes
│ └── package.json
│
└── README.md
Before running the project, ensure you have:
- Node.js (v18 or above)
- npm
- MongoDB Atlas Account
- Git
git clone https://github.com/YOUR_USERNAME/employee-leave-management-system.git
cd employee-leave-management-systemcd backend
npm installCreate a .env file:
PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_secret_key
JWT_EXPIRES_IN=7dStart the backend server:
npm run devBackend runs at:
http://localhost:5000
cd frontend
npm install
npm run devFrontend runs at:
http://localhost:5173
After configuring MongoDB and installing dependencies:
cd backend
npm run create-managerExample:
Name: John Doe
Email: manager@example.com
Password: password123
Department: HR
Designation: Senior Manager
- Register Employee
- Login
- JWT Verification
- View Profile
- Update Profile
- Upload Profile Picture
- Change Password
- Apply Leave
- View Leave History
- Track Leave Status
- Upload Leave Attachments
- View Employees
- Search Employees
- Review Leave Requests
- Approve Requests
- Reject Requests
- Add Remarks
- Employee Statistics
- Leave Statistics
- Approval Metrics
- Workforce Availability
{
name,
email,
password,
role,
department,
designation,
employeeId,
annualLeaveBalance,
profileImage,
createdAt,
updatedAt
}{
employee,
leaveType,
fromDate,
toDate,
totalDays,
reason,
attachment,
status,
managerRemarks,
reviewedBy,
reviewedAt,
createdAt
}Add screenshots before publishing:
- Login Page
- Employee Dashboard
- Apply Leave
- Leave History
- Employee Profile
- Manager Dashboard
- Leave Approval Panel
- Employee Directory
- Employee Details Page
- Workforce Availability (Manpower Module)
- JWT Authentication
- Password Hashing (bcrypt)
- Protected API Routes
- Role-Based Access Control
- Secure File Upload Handling
- Environment Variable Protection
- Email Notifications
- Password Reset
- Leave Calendar View
- Public Holiday Management
- Advanced Leave Analytics Dashboard
- Export Reports
- Multi-Level Approval Workflow
- Admin Role
Aditya Anand Zalke
B.Tech Computer Science Engineering
This project is developed for educational and learning purposes.