A comprehensive, production-ready HR leave management system built with React, TypeScript, and Tailwind CSS. This system provides a complete solution for managing employee leave requests with role-based access control.
- Employee Portal: Submit requests, view balances, track history
- Manager Portal: Approve/reject team requests, dashboard oversight
- HR Portal: User management, system reports, administrative controls
- ✅ Leave request submission and approval workflow
- ✅ Real-time leave balance tracking
- ✅ Automated notifications and status updates
- ✅ Comprehensive audit trail
- ✅ Mobile-responsive design
- ✅ Role-based access control
- ✅ Dashboard analytics and reporting
- Annual Leave
- Sick Leave
- Personal Leave
- Maternity Leave
- Emergency Leave
- Frontend: React 18, TypeScript
- Styling: Tailwind CSS
- Icons: Lucide React
- Date Management: date-fns
- Build Tool: Vite
- Development: Hot Module Replacement, ESLint
Before running this application, ensure you have:
- Node.js (version 16 or higher)
- npm or yarn package manager
- Modern web browser
git clone <repository-url>
cd hr-leave-management-system
npm install
# or
yarn install
npm run dev
# or
yarn dev
The application will be available at http://localhost:5173
npm run build
# or
yarn build
npm run preview
# or
yarn preview
The system includes pre-configured demo users for testing:
Role | Name | Password | |
---|---|---|---|
Employee | John Doe | john.doe@company.com | password123 |
Manager | Sarah Johnson | sarah.johnson@company.com | password123 |
HR Admin | Lisa Chen | hr.admin@company.com | password123 |
Employee | Mike Wilson | mike.wilson@company.com | password123 |
src/
├── components/ # Reusable UI components
│ ├── auth/ # Authentication components
│ ├── dashboard/ # Dashboard widgets
│ ├── hr/ # HR-specific components
│ ├── layout/ # Layout components
│ ├── leaves/ # Leave management components
│ └── ui/ # Base UI components
├── context/ # React Context providers
├── data/ # Mock data and API simulation
├── hooks/ # Custom React hooks
└── types/ # TypeScript type definitions
- Modular Design: Each component focuses on a single responsibility
- Reusable UI: Consistent design system with reusable components
- Type Safety: Full TypeScript integration for better development experience
- Context Management: Centralized state management for authentication and data
- Personal leave balance overview
- Quick leave request submission
- Request history and status tracking
- Calendar integration
- Team leave request approvals
- Team calendar overview
- Leave balance monitoring
- Approval workflow management
- Employee management
- System-wide leave reports
- Policy configuration
- User role management
- Role-based access control (RBAC)
- Secure authentication simulation
- Data validation and sanitization
- Permission-based UI rendering
- Primary: Blue (#3B82F6) - Actions, links, primary elements
- Success: Green (#10B981) - Approved requests, positive actions
- Warning: Amber (#F59E0B) - Pending requests, attention needed
- Error: Red (#EF4444) - Rejected requests, errors
- Gray Scale: Neutral colors for text and backgrounds
- Clean, professional font hierarchy
- Proper contrast ratios for accessibility
- Responsive text sizing
- 8px spacing system for consistency
- Card-based design for content organization
- Responsive grid layouts
- Mobile-first approach
- Submission: Employee submits leave request
- Routing: Request routed to appropriate manager
- Review: Manager reviews and approves/rejects
- Notification: Automated status updates
- Balance Update: Leave balances automatically adjusted
- Archive: Request archived with audit trail
- Employees → Direct Manager → HR (for special cases)
- Automatic routing based on organizational structure
- Escalation rules for delayed approvals
- Email notification integration
- Calendar synchronization (Google Calendar, Outlook)
- Mobile application
- Advanced reporting and analytics
- Integration with payroll systems
- Multi-language support
- Document attachments for requests
- Backend API integration
- Database persistence
- Real-time notifications
- Automated testing suite
- Performance optimization
- PWA capabilities
Run the linting checks:
npm run lint
- Follow component-based architecture
- Maintain single responsibility principle
- Use TypeScript for type safety
- Implement proper error handling
- Use Tailwind CSS utility classes
- Maintain consistent spacing (8px system)
- Ensure responsive design
- Follow accessibility guidelines
- Use React Context for global state
- Custom hooks for data fetching
- Immutable state updates
- Proper error boundaries
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License.
For support and questions:
- Create an issue in the repository
- Contact the development team
- Refer to the documentation
Note: This is a demonstration application with mock data. For production use, integrate with a proper backend API and database system following the architectural patterns established in this codebase.