A comprehensive Employee Management System that combines Leave Management, Payroll Management, Performance Goals, KPI Tracking, and Attendance Management into a single, powerful HR solution.
- Multi-role system: Employee, Manager, Admin
- JWT-based authentication
- Role-based access control
- Secure password handling
- Auto-logout on unauthorized access
- Leave request submission with validation
- Leave approval workflow (Manager/Admin)
- Leave balance tracking with automatic deduction
- Multiple leave types: Annual, Sick, Personal, Maternity, Paternity
- Leave history and status tracking
- Single-day leave support
- Email notifications for leave status changes
- Real-time notifications for instant updates
- Automated payroll generation with leave integration
- Advanced salary structure (Basic, HRA, DA, TA, PF, Tax, Performance Incentive, Special/Medical/Conveyance/Food/Other Allowances)
- KPI-based performance incentives with 4-category evaluation
- Leave deduction calculation from salary
- Payroll history and detailed breakdown
- Currency formatting (INR)
- PDF payslip generation and download
- Payroll statistics and analytics
- Real-time payroll updates
- Goal assignment by managers/admins
- Goal progress tracking by employees
- Real-time goal notifications (assignment & completion)
- Goal categories and priority levels
- Performance KPI system with 4 evaluation areas:
- Quality Performance (25%)
- Productivity (25%)
- Team Collaboration (25%)
- Goal Achievement (25%)
- Automated incentive calculation based on KPI scores
- Goal completion alerts to managers
- Visual progress tracking with status indicators
- Daily check-in/check-out functionality
- Attendance history and statistics
- Working hours calculation
- Attendance integration with payroll
- Real-time attendance status
- Monthly attendance overview
- Attendance validation (prevent duplicate check-ins)
- Employee profiles with complete information
- Department management
- Manager assignment and team structure
- Advanced salary configuration per employee
- Bank details and payroll information
- User registration with role-based access
- Real-time statistics for leaves and payroll
- Leave balance visualization
- Payroll overview for managers/admins
- Goal progress tracking
- Attendance overview with background cards
- Quick action buttons
- Role-based dashboard content
- Socket.IO-powered real-time updates
- In-app notifications with notification bell
- Email notifications for leave requests and approvals
- Goal assignment notifications
- Goal completion alerts
- Toast notifications for user feedback
- Notification bell with unread count and connection status
- Dynamic notification positioning to prevent cutoff
- File-based data storage (JSON files in
/server/data/) - Automatic data saving on all operations
- Graceful shutdown handling with data preservation
- Auto-save functionality every 5 minutes
- Data recovery on server restart
- Node.js with Express.js
- Socket.IO for real-time notifications
- JWT for authentication
- Nodemailer for email notifications
- File-based data store with JSON persistence
- CORS enabled for frontend integration
- React 18 with functional components
- React Router for navigation
- React Query for data fetching and caching
- Socket.IO Client for real-time updates
- React Hook Form for form management
- Tailwind CSS for styling
- Heroicons for icons
- React Hot Toast for notifications
- Date-fns for date manipulation
- jsPDF & html2canvas for PDF generation
- Node.js (v14 or higher)
- npm or yarn
- Clone the repository
git clone <repository-url>
cd Leave-Management/Leave-Management- Install dependencies
npm install
cd client && npm install
cd ..- Set up environment variables
Create a
.envfile in the root directory:
EMAIL_USER=your-email@gmail.com
EMAIL_PASS=your-gmail-app-password
PORT=5001
JWT_SECRET=your-super-secure-jwt-secret-key
CORS_ORIGIN=http://localhost:3000
NODE_ENV=development- Start the application
# Start backend server
npm run backend
# In another terminal, start frontend
cd client && npm start- Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:5001
| Role | Password | Access | |
|---|---|---|---|
| Admin | admin@company.com | password123 | Full access + KPI management |
| Manager | manager@company.com | password123 | Team management + Goal assignment |
| Employee | employee@company.com | password123 | Leave requests + Goal updates |
- Full system access
- User management (create, edit, delete)
- Department management
- Leave type configuration
- Payroll generation for all employees
- KPI configuration and incentive calculation
- Goal management for all employees
- System statistics
- Email configuration
- Team management (view team members)
- Leave approval for team members
- Payroll generation for team members
- Goal assignment to team members
- KPI evaluation for team members
- Goal completion notifications
- Team statistics
- Leave request submission
- View own leave history
- View own payroll (if generated)
- Goal progress updates
- Performance self-assessment
- Attendance tracking
- Profile management
- Real-time notifications
- Goal Assignment: Managers can assign goals to team members
- Progress Tracking: Employees update goal progress (0-100%)
- Status Management: Pending β In Progress β Completed
- Priority Levels: High, Medium, Low with color coding
- Category Organization: Project Management, Professional Development, Sales, etc.
- Due Date Tracking with overdue indicators
- Notes Support: Progress comments and updates
- 4-Category Evaluation:
- Quality Performance (25% weight)
- Productivity (25% weight)
- Team Collaboration (25% weight)
- Goal Achievement (25% weight)
- Real-time Calculation: Automatic total KPI scoring
- Performance Incentives: Calculated based on KPI scores
- Configurable Rates: Base incentive rate and maximum caps
- Performance Ratings: Excellent (80%+), Good (60-79%), Needs Improvement (<60%)
- Goal Assignment: Employee receives notification when goal is assigned
- Goal Completion: Manager receives notification when employee completes goal
- Real-time Updates: Instant notifications via Socket.IO
- Email Integration: Email notifications for important updates
- Basic Salary: Base compensation
- HRA: House Rent Allowance
- DA: Dearness Allowance
- TA: Transport Allowance
- Performance Incentive: KPI-based variable component
- Special Allowance: Additional allowances
- Medical Allowance: Health benefits
- Conveyance Allowance: Transport benefits
- Food Allowance: Meal benefits
- Other Allowances: Miscellaneous benefits
- PF: Provident Fund (deduction)
- Tax: Income Tax (deduction)
- KPI Evaluation: 4-category performance assessment
- Total KPI Score: Weighted average calculation
- Incentive Amount: (Total KPI Γ· 100) Γ Base Rate Γ 100
- Capped Amount: Respects maximum incentive limits
- Auto-Integration: Seamlessly added to payroll
- Monthly payroll generation
- Leave integration (automatic deduction)
- Working days calculation
- KPI incentives included
- PDF payslip generation
- Detailed breakdown with earnings and deductions
- Leave Request: Manager notification when employee submits
- Leave Approved: Employee notification when approved
- Leave Rejected: Employee notification with reason
- Goal Assignment: Employee notification for new goals
- Goal Completion: Manager notification when goals completed
- Enable 2FA on your Gmail account
- Generate App Password for mail access
- Update .env with email credentials
- Test email functionality with auto-verification
POST /api/auth/login- User loginPOST /api/auth/register- User registration (public)GET /api/auth/me- Get current user
GET /api/leaves- Get leave requestsPOST /api/leaves- Submit leave requestPUT /api/leaves/:id/approve- Approve/reject leaveGET /api/leaves/stats- Leave statistics
GET /api/payroll- Get payroll historyPOST /api/payroll/generate- Generate payrollGET /api/payroll/:id- Get payroll detailsGET /api/payroll/stats- Payroll statistics
GET /api/users- Get usersPOST /api/users- Create user (admin only)PUT /api/users/:id- Update userPUT /api/users/:id/salary- Update salary with KPI
GET /api/performance-goals- Get goals (role-filtered)POST /api/performance-goals- Create goal (manager/admin)PUT /api/performance-goals/:id- Update goal progressDELETE /api/performance-goals/:id- Delete goal
GET /api/notifications- Get notificationsPUT /api/notifications/:id/read- Mark as readGET /api/notifications/unread-count- Get unread count
POST /api/attendance/checkin- Check inPOST /api/attendance/checkout- Check outGET /api/attendance- Get attendance history
- β Submit leave requests
- β View leave balance
- β Track request status
- β View payroll (if generated)
- β Update goal progress
- β View assigned goals
- β Attendance check-in/out
- β Real-time notifications
- β PDF payslip download
- β Approve/reject team leave requests
- β View team statistics
- β Generate payroll for team
- β Assign goals to team members
- β Configure KPI scores
- β Goal completion notifications
- β Manage team members
- β Receive leave notifications
- β Full user management
- β Department management
- β Leave type configuration
- β Generate payroll for all employees
- β System-wide goal management
- β KPI system configuration
- β Performance analytics
- β System-wide statistics
- β Email configuration
- Responsive layout (mobile-friendly)
- Clean, professional interface
- Intuitive navigation
- Consistent styling with Tailwind CSS
- Color-coded indicators for status and priority
- Progress bars with dynamic colors
- Modal dialogs for complex interactions
- Real-time updates with React Query and Socket.IO
- Loading states and error handling
- Toast notifications for feedback
- Form validation and error messages
- Confirmation dialogs for important actions
- Dynamic dropdown positioning to prevent cutoff
- Auto-refresh for real-time data
- Keyboard navigation support
- Screen reader friendly
- High contrast color scheme
- Responsive design for all devices
- Clear visual indicators for status and actions
- JWT tokens for session management
- Role-based access control
- Secure API endpoints
- Auto-logout on token expiry
- Protected routes with role validation
- Input validation on all forms
- XSS protection
- CORS configuration
- File-based storage security
- Environment variable protection
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Frontend β β Backend β β Data Store β
β (React) βββββΊβ (Node.js) βββββΊβ (JSON Files) β
β β β β β β
β β’ User Interfaceβ β β’ API Routes β β β’ Users β
β β’ Real-time UI β β β’ Auth Middlewareβ β β’ Leaves β
β β’ State Mgmt β β β’ Socket.IO β β β’ Payrolls β
β β’ Routing β β β’ Business Logicβ β β’ Goals β
β β’ Components β β β’ Email Service β β β’ Notifications β
β β’ PDF Generationβ β β’ File Persist. β β β’ Attendance β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
- Environment variables configuration
- Email service setup (Gmail App Password)
- Port configuration (Backend: 5001, Frontend: 3000)
- Complete deployment guide: See
RENDER_DEPLOYMENT.md - Environment variables configuration
- Email service configuration
- CORS setup for production URLs
- Data persistence with file storage
# Backend Dockerfile
FROM node:16-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 5001
CMD ["npm", "run", "backend"]RENDER_DEPLOYMENT.md: Complete deployment guide for Render.comEMAIL_SETUP.md: Detailed email configuration instructionsATTENDANCE_FEATURES.md: Attendance system documentationPDF_FEATURES.md: PDF generation capabilitiesSALARY_MANAGEMENT_GUIDE.md: Comprehensive salary management guide
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.
For support and questions:
- Email: support@company.com
- Documentation: [Wiki Link]
- Issues: [GitHub Issues]
Built with β€οΈ using React, Node.js, Socket.IO, and Tailwind CSS