Enterprise-grade leave management fully compliant with the Haitian Labor Code
Features β’ Quick Start β’ Demo Accounts β’ Architecture β’ Legal Compliance
- Three-Step Approval Workflow: Employee β Manager β HR Admin
- Role-Based Access Control (RBAC): 4 roles with granular permissions
- Organizational Hierarchy: Flexible reporting structure with line managers
- Real-time Notifications: Instant alerts for approvals and status changes
- Full French/English Support: Toggle language globally
- Localized Date Formats: Respects regional preferences
- Bilingual Notifications: All messages in both languages
- Light/Dark Theme: System-aware theme switching
- Responsive Design: Mobile-first, works on all devices
- Dashboard Analytics: Visual insights for HR and managers
- JWT Authentication: Secure token-based auth
- Flexible Login: Use Email OR Employee ID (Matricule)
- Forced Password Reset: First-login security compliance
- Audit Logging: Complete trail of all actions
- Account Lockout: Protection against brute-force attacks
- Node.js 18.x or higher
- PostgreSQL 14.x or higher
- npm or yarn
# Clone and setup
git clone https://github.com/your-org/haitian-leave-management.git
cd haitian-leave-management
# Install all dependencies
npm run setup
# Initialize database (schema + seed data)
npm run db:init
# Start development servers
npm run devThe application will be available at:
- Frontend: http://localhost:5173
- Backend API: http://localhost:3000
# 1. Install dependencies
npm install
cd client && npm install
cd ../server && npm install
cd ..
# 2. Configure environment
cp server/.env.example server/.env
# Edit server/.env with your database credentials
# 3. Database setup
psql -U postgres -c "CREATE DATABASE leave_management;"
psql -U postgres -d leave_management -f database/schema.sql
psql -U postgres -d leave_management -f database/migrations/001_production_ready.sql
psql -U postgres -d leave_management -f database/seed.sql
# 4. Start servers
npm run dev
β οΈ SECURITY NOTICE: These credentials are for development/demo purposes only.
In production: Delete seed data and create accounts via HR Admin panel.
All demo accounts use the password: password123
| Role | Name | User ID (Matricule) | Notes | |
|---|---|---|---|---|
| Super Admin | Admin Root | ADM-000 |
admin@techietheo.ht | Full system access |
| HR Admin | Sarah Cadet | HR-001 |
sarah.hr@techietheo.ht | User management, policy configuration |
| Manager | Paul Saint-Fleur | MGR-001 |
paul.manager@techietheo.ht | IT Head, has 2 pending approvals |
| Employee | Jean Baptiste | EMP-004 |
jean.user@techietheo.ht | IT Support, 2 years tenure |
π‘ Tip: You can login using either the Email or Matricule with the password.
haitian-leave-management/
βββ π client/ # React Frontend (Vite)
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Route pages
β β βββ stores/ # Zustand state management
β β βββ i18n/ # Translations (FR/EN)
β β βββ lib/ # Utilities
β βββ ...
β
βββ π server/ # Node.js Backend (Express)
β βββ src/
β β βββ controllers/ # Route handlers
β β βββ services/ # Business logic
β β βββ ...
β βββ ...
β
βββ π database/ # PostgreSQL
β βββ schema.sql # Core database schema
β βββ migrations/ # Schema migrations
β β βββ 001_production_ready.sql
β βββ seed.sql # Demo data (Techie Theo)
β
βββ π shared/ # Shared TypeScript types
βββ types/
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | React 18, TypeScript, Vite | Modern SPA with type safety |
| Styling | Tailwind CSS, Framer Motion | Utility-first CSS with animations |
| State | Zustand | Lightweight state management |
| Forms | React Hook Form, Zod | Form handling with schema validation |
| Backend | Node.js, Express | REST API server |
| Database | PostgreSQL | Relational data storage |
| Auth | JWT, bcrypt | Secure authentication |
This application implements leave policies as defined by the Code du Travail HaΓ―tien (Haitian Labor Code).
| Leave Type | Days | Notes |
|---|---|---|
| Annual Leave | 15 days/year | After 12 months of service |
| Sick Leave | 15 days/year | Certificate required > 3 days |
| Maternity Leave | 12 weeks (84 days) | Start 4 weeks before due date |
| Bereavement | 5 days | Immediate family |
| Marriage | 3 days | Employee's own marriage |
- β Minimum Service: 12 months required for annual leave eligibility
- β Non-Cumulative: Annual leave resets each year (exceptions for Force Majeure)
- β Medical Certificate: Required for sick leave > 3 days
- β Maternity Timing: Must start at least 4 weeks before due date
- β Public Holidays: Haitian holidays automatically excluded from leave calculations
- users: Employee records with hierarchy (
reports_to_id) - departments: Organizational units
- leave_policies: Configurable rules per leave type/sector
- leave_balances: Annual entitlements and usage tracking
- leave_requests: All requests with full workflow state
- approval_history: Audit trail of all approval actions
- notifications: User notification system
- public_holidays: Haitian public holidays
- audit_logs: Security audit trail
matricule -- Unique employee ID (e.g., "EMP-2026-001")
must_change_password -- Force password reset on first login
reports_to_id -- Direct supervisor (org hierarchy)Create server/.env:
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/leave_management
# Authentication
JWT_SECRET=your-super-secure-secret-change-this
JWT_EXPIRES_IN=8h
# Server
PORT=3000
NODE_ENV=development
# Frontend URL (for CORS)
CLIENT_URL=http://localhost:5173| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/login |
Login with email OR matricule |
| POST | /api/auth/logout |
Logout current session |
| POST | /api/auth/change-password |
Change password (required on first login) |
| POST | /api/auth/admin/reset-password |
Admin: Reset user password |
| GET | /api/auth/me |
Get current user info |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/leaves |
List leave requests |
| POST | /api/leaves |
Create new request |
| GET | /api/leaves/:id |
Get request details |
| POST | /api/leaves/:id/submit |
Submit draft for approval |
| POST | /api/leaves/:id/approve |
Approve request |
| POST | /api/leaves/:id/reject |
Reject request |
| POST | /api/leaves/:id/cancel |
Cancel own request |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/users |
List all users |
| POST | /api/users |
Create new user |
| PATCH | /api/users/:id |
Update user |
| POST | /api/users/:id/reset-password |
Reset user password |
- Code du Travail HaΓ―tien - Articles 148-165 (Annual Leave)
- DΓ©cret du 17 mai 2005 - Public Service regulations
- Convention OIT nΒ°132 - International leave standards
- JWT-based authentication
- Role-based access control (RBAC)
- Input validation and sanitization
- SQL injection prevention
- XSS protection
- CORS configuration
- Rate limiting
- Password history (prevent reuse)
- Account lockout after failed attempts
Important: This application implements leave management rules based on the Code du Travail HaΓ―tien (Haitian Labor Code) as of 2024. While every effort has been made to ensure accuracy, this software is provided for informational purposes and should not be considered legal advice.
Organizations should consult with qualified legal professionals to ensure compliance with current labor laws and regulations in Haiti.
The developers are not responsible for any legal consequences arising from the use of this software.
MIT License - See LICENSE file for details.
Contributions are welcome! Please read our contributing guidelines before submitting PRs.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project was developed with the assistance of GitHub Copilot (powered by Claude), an AI pair programming tool. The AI assisted with:
- Code generation and architecture decisions
- Writing boilerplate and repetitive code patterns
- Debugging and troubleshooting
- Documentation and README creation
- Best practices and code optimization suggestions
All AI-generated code was reviewed, tested, and validated by the human developer. The project concept, business logic, and final implementation decisions remain the responsibility of the author.
Built with β€οΈ for Haiti ππΉ
Konstriksyon ak lanmou pou Ayiti