# drnrbj/hotel-employee-management-system architecture

> Architecture diagram of the GitHub repository drnrbj/hotel-employee-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/drnrbj/hotel-employee-management-system
- Repository: https://github.com/drnrbj/hotel-employee-management-system

## Overview

Blue Lotus Hotel EMS is a role-based HR system. Staff sign in to a React application, use its HR or accounting workflows, and receive operational results such as employee records, attendance and leave decisions, recruitment progress, or processed payslips. Laravel exposes the backend API, whose controllers coordinate domain models and payroll services. The README documents the principal capabilities; sampled source confirms frontend route/auth behavior and selected backend controller-to-model/service calls. Other domain links are documented capabilities, not verified source-level call paths.

Main entry points: [`backend/app/Http/Controllers/PayslipController.php`](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Http/Controllers/PayslipController.php) (Payslip API), [`src/pages/Accounting.tsx`](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/src/pages/Accounting.tsx) (Payroll workspace), [`src/App.tsx`](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/src/App.tsx) (Role-based application), [`src/pages/Employees.tsx`](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/src/pages/Employees.tsx) (Employee directory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and application"]
  node_webapp["Role-based application<br/>[App.tsx]"]
  node_auth["Authentication<br/>[useAuth.ts]"]
end

subgraph group_workforce["Workforce operations"]
  node_employees["Employee directory<br/>[Employees.tsx]"]
  node_attendance["Attendance and timekeeping<br/>[Attendance.tsx]"]
  node_leave["Leave workflow<br/>[Leave.tsx]"]
end

subgraph group_talent["Talent and performance"]
  node_recruitment["Recruitment and onboarding<br/>[Recruitment.tsx]"]
  node_applicantui["Applicant pipeline"]
  node_training["Training management<br/>[Training.tsx]"]
  node_performance["Performance evaluation<br/>[Performance.tsx]"]
end

subgraph group_payroll["Payroll and accounting"]
  node_accounting["Payroll workspace<br/>[Accounting.tsx]"]
end

subgraph group_backend["Backend domain and services"]
  node_employeeapi["Employee API"]
  node_employeedata[("Employee records<br/>[Employee.php]")]
  node_attendancesvc["Attendance service"]
  node_attendancedata[("Attendance records<br/>[Attendance.php]")]
  node_leaveapi["Leave API"]
  node_leavedata[("Leave requests and balances<br/>[LeaveRequest.php]")]
  node_recruitapi["Recruitment API"]
  node_applicantdata[("Applicant records<br/>[Applicant.php]")]
  node_evaluationapi["Evaluation forms API"]
  node_payslipapi["Payslip API"]
  node_payslipservice["Payslip calculation<br/>[PayslipService.php]"]
  node_payslipdata[("Payslips and periods<br/>[Payslip.php]")]
  node_auditdata[("Payroll audit log")]
  node_bonusapi["Payroll bonuses"]
  node_pdf["Payslip PDF<br/>[PayslipPDF.php]"]
end

node_staff(("HR and accounting staff"))

node_staff -->|"uses"| node_webapp
node_webapp -->|"checks access"| node_auth
node_staff -->|"manages staff"| node_employees
node_employees -.->|"requests records"| node_employeeapi
node_employeeapi -.->|"reads and writes"| node_employeedata
node_staff -->|"tracks time"| node_attendance
node_attendance -.->|"requests operations"| node_attendancesvc
node_attendancesvc -->|"reads and writes"| node_attendancedata
node_staff -->|"manages leave"| node_leave
node_leave -.->|"requests decisions"| node_leaveapi
node_leaveapi -->|"reads and writes"| node_leavedata
node_staff -->|"manages hiring"| node_recruitment
node_recruitment -.->|"shows pipeline"| node_applicantui
node_applicantui -.->|"submits applicant changes"| node_recruitapi
node_recruitapi -->|"queries applicants"| node_applicantdata
node_staff -->|"assigns training"| node_training
node_staff -->|"evaluates staff"| node_performance
node_performance -.->|"manages evaluations"| node_evaluationapi
node_staff -->|"processes payroll"| node_accounting
node_accounting -.->|"requests payslips"| node_payslipapi
node_payslipapi -->|"computes payslips"| node_payslipservice
node_payslipapi -->|"reads and updates"| node_payslipdata
node_payslipapi -->|"records approvals"| node_auditdata
node_accounting -.->|"manages bonuses"| node_bonusapi
node_payslipapi -.->|"generates PDF"| node_pdf

click node_webapp "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/src/App.tsx"
click node_auth "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/src/hooks/useAuth.ts"
click node_employees "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/src/pages/Employees.tsx"
click node_employeeapi "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Http/Controllers/EmployeeController.php"
click node_employeedata "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Models/Employee.php"
click node_attendance "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/src/pages/Attendance.tsx"
click node_attendancesvc "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Services/AttendanceService.php"
click node_attendancedata "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Models/Attendance.php"
click node_leave "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/src/pages/Leave.tsx"
click node_leaveapi "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Http/Controllers/LeaveController.php"
click node_leavedata "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Models/LeaveRequest.php"
click node_recruitment "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/src/pages/Recruitment.tsx"
click node_applicantui "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/src/components/recruitment/ApplicantPipeline.tsx"
click node_recruitapi "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Http/Controllers/RecruitmentController.php"
click node_applicantdata "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Models/Applicant.php"
click node_training "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/src/pages/Training.tsx"
click node_performance "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/src/pages/Performance.tsx"
click node_evaluationapi "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Http/Controllers/EvaluationFormController.php"
click node_accounting "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/src/pages/Accounting.tsx"
click node_payslipapi "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Http/Controllers/PayslipController.php"
click node_payslipservice "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Services/PayslipService.php"
click node_payslipdata "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Models/Payslip.php"
click node_auditdata "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Models/PayrollAuditLog.php"
click node_bonusapi "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Http/Controllers/PayrollBonusController.php"
click node_pdf "https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Services/PayslipPDF.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webapp,node_auth toneBlue
class node_employees,node_attendance,node_leave toneAmber
class node_recruitment,node_applicantui,node_training,node_performance toneMint
class node_accounting toneRose
class node_employeeapi,node_employeedata,node_attendancesvc,node_attendancedata,node_leaveapi,node_leavedata,node_recruitapi,node_applicantdata,node_evaluationapi,node_payslipapi,node_payslipservice,node_payslipdata,node_auditdata,node_bonusapi,node_pdf,node_staff toneIndigo
```

## Components

### Access and application

- [Role-based application](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/src/App.tsx): `src/App.tsx`
- [Authentication](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/src/hooks/useAuth.ts): `src/hooks/useAuth.ts`

### Workforce operations

- [Employee directory](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/src/pages/Employees.tsx): `src/pages/Employees.tsx`
- [Attendance and timekeeping](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/src/pages/Attendance.tsx): `src/pages/Attendance.tsx`
- [Leave workflow](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/src/pages/Leave.tsx): `src/pages/Leave.tsx`

### Talent and performance

- [Recruitment and onboarding](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/src/pages/Recruitment.tsx): `src/pages/Recruitment.tsx`
- [Applicant pipeline](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/src/components/recruitment/ApplicantPipeline.tsx): `src/components/recruitment/ApplicantPipeline.tsx`
- [Training management](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/src/pages/Training.tsx): `src/pages/Training.tsx`
- [Performance evaluation](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/src/pages/Performance.tsx): `src/pages/Performance.tsx`

### Payroll and accounting

- [Payroll workspace](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/src/pages/Accounting.tsx): `src/pages/Accounting.tsx`

### Backend domain and services

- [Employee API](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Http/Controllers/EmployeeController.php): `backend/app/Http/Controllers/EmployeeController.php`
- [Employee records](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Models/Employee.php): `backend/app/Models/Employee.php`
- [Attendance service](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Services/AttendanceService.php): `backend/app/Services/AttendanceService.php`
- [Attendance records](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Models/Attendance.php): `backend/app/Models/Attendance.php`
- [Leave API](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Http/Controllers/LeaveController.php): `backend/app/Http/Controllers/LeaveController.php`
- [Leave requests and balances](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Models/LeaveRequest.php): `backend/app/Models/LeaveRequest.php`
- [Recruitment API](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Http/Controllers/RecruitmentController.php): `backend/app/Http/Controllers/RecruitmentController.php`
- [Applicant records](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Models/Applicant.php): `backend/app/Models/Applicant.php`
- [Evaluation forms API](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Http/Controllers/EvaluationFormController.php): `backend/app/Http/Controllers/EvaluationFormController.php`
- [Payslip API](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Http/Controllers/PayslipController.php): `backend/app/Http/Controllers/PayslipController.php`
- [Payslip calculation](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Services/PayslipService.php): `backend/app/Services/PayslipService.php`
- [Payslips and periods](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Models/Payslip.php): `backend/app/Models/Payslip.php`
- [Payroll audit log](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Models/PayrollAuditLog.php): `backend/app/Models/PayrollAuditLog.php`
- [Payroll bonuses](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Http/Controllers/PayrollBonusController.php): `backend/app/Http/Controllers/PayrollBonusController.php`
- [Payslip PDF](https://github.com/drnrbj/hotel-employee-management-system/blob/fix/backend/app/Services/PayslipPDF.php): `backend/app/Services/PayslipPDF.php`

### Other components

- **HR and accounting staff**

## Connections

- HR and accounting staff → Role-based application: uses (evidence: `README.md`)
- Role-based application → Authentication: checks access (evidence: `src/App.tsx`)
- HR and accounting staff → Employee directory: manages staff (evidence: `README.md`)
- Employee directory → Employee API: requests records (evidence: `README.md`)
- Employee API → Employee records: reads and writes (evidence: `README.md`)
- HR and accounting staff → Attendance and timekeeping: tracks time (evidence: `README.md`)
- Attendance and timekeeping → Attendance service: requests operations (evidence: `README.md`)
- Attendance service → Attendance records: reads and writes (evidence: `backend/app/Services/AttendanceService.php`)
- HR and accounting staff → Leave workflow: manages leave (evidence: `README.md`)
- Leave workflow → Leave API: requests decisions (evidence: `README.md`)
- Leave API → Leave requests and balances: reads and writes (evidence: `backend/app/Http/Controllers/LeaveController.php`)
- HR and accounting staff → Recruitment and onboarding: manages hiring (evidence: `README.md`)
- Recruitment and onboarding → Applicant pipeline: shows pipeline (evidence: `README.md`)
- Applicant pipeline → Recruitment API: submits applicant changes
- Recruitment API → Applicant records: queries applicants (evidence: `backend/app/Http/Controllers/RecruitmentController.php`)
- HR and accounting staff → Training management: assigns training (evidence: `README.md`)
- HR and accounting staff → Performance evaluation: evaluates staff (evidence: `README.md`)
- Performance evaluation → Evaluation forms API: manages evaluations (evidence: `README.md`)
- HR and accounting staff → Payroll workspace: processes payroll (evidence: `README.md`)
- Payroll workspace → Payslip API: requests payslips (evidence: `README.md`)
- Payslip API → Payslip calculation: computes payslips (evidence: `backend/app/Http/Controllers/PayslipController.php`)
- Payslip API → Payslips and periods: reads and updates (evidence: `backend/app/Http/Controllers/PayslipController.php`)
- Payslip API → Payroll audit log: records approvals (evidence: `backend/app/Http/Controllers/PayslipController.php`)
- Payroll workspace → Payroll bonuses: manages bonuses (evidence: `README.md`)
- Payslip API → Payslip PDF: generates PDF (evidence: `README.md`)
