# kennbalaga/human-resource-2 architecture

> Architecture diagram of the GitHub repository kennbalaga/human-resource-2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kennbalaga/human-resource-2
- Repository: https://github.com/kennbalaga/human-resource-2

## Overview

HRMS Workforce Management is a Laravel application for workforce administration. Its main scheduling workflow is a manager working with roster assignments and schedule data; the README also identifies attendance, leave, timesheets, analytics, optional Gemini AI, and a versioned REST API as product capabilities. The graph emphasizes documented capabilities and source-indexed relationships. Many routes, controller implementations, and service interactions were not sampled, so uncertain connections are omitted rather than inferred.

Main entry points: [`app/Http/Controllers/Schedule/ScheduleCalendarController.php`](https://github.com/kennbalaga/human-resource-2/blob/main/app/Http/Controllers/Schedule/ScheduleCalendarController.php) (Schedule Calendar), [`app/Services/Attendance/MyAttendanceService.php`](https://github.com/kennbalaga/human-resource-2/blob/main/app/Services/Attendance/MyAttendanceService.php) (Attendance Service), [`app/Services/Burnout/BurnoutRiskService.php`](https://github.com/kennbalaga/human-resource-2/blob/main/app/Services/Burnout/BurnoutRiskService.php) (Burnout Risk), [`app/Models/Employee.php`](https://github.com/kennbalaga/human-resource-2/blob/main/app/Models/Employee.php) (Employee Records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workforce["Workforce Records"]
  node_employee["Employee Records<br/>[Employee.php]"]
  node_department["Departments<br/>[Department.php]"]
  node_position["Positions<br/>[Position.php]"]
  node_access["Workforce Access"]
end

subgraph group_scheduling["Scheduling"]
  node_schedule_controller["Schedule Calendar"]
  node_schedule_service["Schedule Service"]
  node_schedule_assignment["Roster Assignments"]
  node_shift["Shifts<br/>[Shift.php]"]
  node_recurring["Recurring Schedules"]
  node_dayoff["Schedule Days Off<br/>[ScheduleDayOff.php]"]
  node_reference_cache["Reference Data Cache"]
end

subgraph group_staffops["Staff Operations"]
  node_attendance["Attendance"]
  node_attendance_service["Attendance Service"]
  node_leave["Leave Requests<br/>[LeaveRequest.php]"]
  node_leave_type["Leave Types<br/>[LeaveType.php]"]
end

subgraph group_insights["Insights And API"]
  node_analytics["Workforce Analytics"]
  node_burnout["Burnout Risk"]
  node_api_auth["REST API Auth<br/>[AuthController.php]"]
  node_gemini["Gemini AI"]
end

subgraph group_identity["Identity And Security"]
  node_login["Session Login"]
  node_session_service["Device Sessions"]
  node_user["User Accounts<br/>[User.php]"]
end

node_manager(("Workforce User"))
node_database[("Application Database")]

node_manager -.->|"manages roster"| node_schedule_controller
node_schedule_controller -->|"reads and writes"| node_schedule_assignment
node_schedule_controller -->|"loads departments"| node_department
node_schedule_controller -->|"loads employees"| node_employee
node_schedule_controller -->|"checks leave"| node_leave
node_schedule_controller -->|"loads leave types"| node_leave_type
node_schedule_controller -->|"loads positions"| node_position
node_schedule_controller -->|"loads recurring shifts"| node_recurring
node_schedule_controller -->|"loads shifts"| node_shift
node_schedule_controller -->|"uses cached data"| node_reference_cache
node_attendance -->|"uses attendance service"| node_attendance_service
node_attendance_service -->|"reads employee data"| node_employee
node_attendance_service -->|"checks leave"| node_leave
node_attendance_service -->|"reads roster"| node_schedule_assignment
node_attendance_service -->|"checks days off"| node_dayoff
node_attendance_service -->|"reads shifts"| node_shift
node_burnout -->|"reads workforce data"| node_employee
node_burnout -->|"reads departments"| node_department
node_burnout -->|"reads positions"| node_position
node_analytics -.->|"provides risk insights"| node_burnout
node_login -->|"claims device session"| node_session_service
node_session_service -->|"updates session claim"| node_user
node_api_auth -->|"authenticates account"| node_user
node_manager -.->|"records attendance"| node_attendance
node_manager -.->|"views analytics"| node_analytics
node_manager -.->|"uses REST API"| node_api_auth
node_schedule_controller -.->|"AI assistance"| node_gemini
node_employee -.->|"persists records"| node_database
node_schedule_assignment -.->|"persists roster"| node_database

click node_employee "https://github.com/kennbalaga/human-resource-2/blob/main/app/Models/Employee.php"
click node_department "https://github.com/kennbalaga/human-resource-2/blob/main/app/Models/Department.php"
click node_position "https://github.com/kennbalaga/human-resource-2/blob/main/app/Models/Position.php"
click node_access "https://github.com/kennbalaga/human-resource-2/blob/main/app/Http/Controllers/Concerns/ScopesWorkforceAccess.php"
click node_schedule_controller "https://github.com/kennbalaga/human-resource-2/blob/main/app/Http/Controllers/Schedule/ScheduleCalendarController.php"
click node_schedule_service "https://github.com/kennbalaga/human-resource-2/blob/main/app/Services/ScheduleService.php"
click node_schedule_assignment "https://github.com/kennbalaga/human-resource-2/blob/main/app/Models/ScheduleAssignment.php"
click node_shift "https://github.com/kennbalaga/human-resource-2/blob/main/app/Models/Shift.php"
click node_recurring "https://github.com/kennbalaga/human-resource-2/blob/main/app/Models/RecurringSchedule.php"
click node_dayoff "https://github.com/kennbalaga/human-resource-2/blob/main/app/Models/ScheduleDayOff.php"
click node_reference_cache "https://github.com/kennbalaga/human-resource-2/blob/main/app/Services/ReferenceDataCache.php"
click node_attendance "https://github.com/kennbalaga/human-resource-2/blob/main/app/Http/Controllers/Attendance/AttendanceController.php"
click node_attendance_service "https://github.com/kennbalaga/human-resource-2/blob/main/app/Services/Attendance/MyAttendanceService.php"
click node_leave "https://github.com/kennbalaga/human-resource-2/blob/main/app/Models/LeaveRequest.php"
click node_leave_type "https://github.com/kennbalaga/human-resource-2/blob/main/app/Models/LeaveType.php"
click node_analytics "https://github.com/kennbalaga/human-resource-2/blob/main/app/Http/Controllers/AnalyticsController.php"
click node_burnout "https://github.com/kennbalaga/human-resource-2/blob/main/app/Services/Burnout/BurnoutRiskService.php"
click node_api_auth "https://github.com/kennbalaga/human-resource-2/blob/main/app/Http/Controllers/Api/V1/AuthController.php"
click node_login "https://github.com/kennbalaga/human-resource-2/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php"
click node_session_service "https://github.com/kennbalaga/human-resource-2/blob/main/app/Services/ActiveDeviceSessionService.php"
click node_user "https://github.com/kennbalaga/human-resource-2/blob/main/app/Models/User.php"
click node_gemini "https://github.com/kennbalaga/human-resource-2/blob/main/app/Services/Integrations/GeminiScheduleExplanationService.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_employee,node_department,node_position,node_access,node_manager toneBlue
class node_schedule_controller,node_schedule_service,node_schedule_assignment,node_shift,node_recurring,node_dayoff,node_reference_cache,node_database toneAmber
class node_attendance,node_attendance_service,node_leave,node_leave_type toneMint
class node_analytics,node_burnout,node_api_auth,node_gemini toneRose
class node_login,node_session_service,node_user toneIndigo
```

## Components

### Workforce Records

- [Employee Records](https://github.com/kennbalaga/human-resource-2/blob/main/app/Models/Employee.php): `app/Models/Employee.php`
- [Departments](https://github.com/kennbalaga/human-resource-2/blob/main/app/Models/Department.php): `app/Models/Department.php`
- [Positions](https://github.com/kennbalaga/human-resource-2/blob/main/app/Models/Position.php): `app/Models/Position.php`
- [Workforce Access](https://github.com/kennbalaga/human-resource-2/blob/main/app/Http/Controllers/Concerns/ScopesWorkforceAccess.php): `app/Http/Controllers/Concerns/ScopesWorkforceAccess.php`

### Scheduling

- [Schedule Calendar](https://github.com/kennbalaga/human-resource-2/blob/main/app/Http/Controllers/Schedule/ScheduleCalendarController.php): `app/Http/Controllers/Schedule/ScheduleCalendarController.php`
- [Schedule Service](https://github.com/kennbalaga/human-resource-2/blob/main/app/Services/ScheduleService.php): `app/Services/ScheduleService.php`
- [Roster Assignments](https://github.com/kennbalaga/human-resource-2/blob/main/app/Models/ScheduleAssignment.php): `app/Models/ScheduleAssignment.php`
- [Shifts](https://github.com/kennbalaga/human-resource-2/blob/main/app/Models/Shift.php): `app/Models/Shift.php`
- [Recurring Schedules](https://github.com/kennbalaga/human-resource-2/blob/main/app/Models/RecurringSchedule.php): `app/Models/RecurringSchedule.php`
- [Schedule Days Off](https://github.com/kennbalaga/human-resource-2/blob/main/app/Models/ScheduleDayOff.php): `app/Models/ScheduleDayOff.php`
- [Reference Data Cache](https://github.com/kennbalaga/human-resource-2/blob/main/app/Services/ReferenceDataCache.php): `app/Services/ReferenceDataCache.php`

### Staff Operations

- [Attendance](https://github.com/kennbalaga/human-resource-2/blob/main/app/Http/Controllers/Attendance/AttendanceController.php): `app/Http/Controllers/Attendance/AttendanceController.php`
- [Attendance Service](https://github.com/kennbalaga/human-resource-2/blob/main/app/Services/Attendance/MyAttendanceService.php): `app/Services/Attendance/MyAttendanceService.php`
- [Leave Requests](https://github.com/kennbalaga/human-resource-2/blob/main/app/Models/LeaveRequest.php): `app/Models/LeaveRequest.php`
- [Leave Types](https://github.com/kennbalaga/human-resource-2/blob/main/app/Models/LeaveType.php): `app/Models/LeaveType.php`

### Insights And API

- [Workforce Analytics](https://github.com/kennbalaga/human-resource-2/blob/main/app/Http/Controllers/AnalyticsController.php): `app/Http/Controllers/AnalyticsController.php`
- [Burnout Risk](https://github.com/kennbalaga/human-resource-2/blob/main/app/Services/Burnout/BurnoutRiskService.php): `app/Services/Burnout/BurnoutRiskService.php`
- [REST API Auth](https://github.com/kennbalaga/human-resource-2/blob/main/app/Http/Controllers/Api/V1/AuthController.php): `app/Http/Controllers/Api/V1/AuthController.php`
- [Gemini AI](https://github.com/kennbalaga/human-resource-2/blob/main/app/Services/Integrations/GeminiScheduleExplanationService.php): `app/Services/Integrations/GeminiScheduleExplanationService.php`

### Identity And Security

- [Session Login](https://github.com/kennbalaga/human-resource-2/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php): `app/Http/Controllers/Auth/AuthenticatedSessionController.php`
- [Device Sessions](https://github.com/kennbalaga/human-resource-2/blob/main/app/Services/ActiveDeviceSessionService.php): `app/Services/ActiveDeviceSessionService.php`
- [User Accounts](https://github.com/kennbalaga/human-resource-2/blob/main/app/Models/User.php): `app/Models/User.php`

### Other components

- **Workforce User**
- **Application Database**

## Connections

- Workforce User → Schedule Calendar: manages roster
- Schedule Calendar → Roster Assignments: reads and writes (evidence: `app/Http/Controllers/Schedule/ScheduleCalendarController.php`)
- Schedule Calendar → Departments: loads departments (evidence: `app/Http/Controllers/Schedule/ScheduleCalendarController.php`)
- Schedule Calendar → Employee Records: loads employees (evidence: `app/Http/Controllers/Schedule/ScheduleCalendarController.php`)
- Schedule Calendar → Leave Requests: checks leave (evidence: `app/Http/Controllers/Schedule/ScheduleCalendarController.php`)
- Schedule Calendar → Leave Types: loads leave types (evidence: `app/Http/Controllers/Schedule/ScheduleCalendarController.php`)
- Schedule Calendar → Positions: loads positions (evidence: `app/Http/Controllers/Schedule/ScheduleCalendarController.php`)
- Schedule Calendar → Recurring Schedules: loads recurring shifts (evidence: `app/Http/Controllers/Schedule/ScheduleCalendarController.php`)
- Schedule Calendar → Shifts: loads shifts (evidence: `app/Http/Controllers/Schedule/ScheduleCalendarController.php`)
- Schedule Calendar → Reference Data Cache: uses cached data (evidence: `app/Http/Controllers/Schedule/ScheduleCalendarController.php`)
- Attendance → Attendance Service: uses attendance service (evidence: `app/Http/Controllers/Attendance/AttendanceController.php`)
- Attendance Service → Employee Records: reads employee data (evidence: `app/Services/Attendance/MyAttendanceService.php`)
- Attendance Service → Leave Requests: checks leave (evidence: `app/Services/Attendance/MyAttendanceService.php`)
- Attendance Service → Roster Assignments: reads roster (evidence: `app/Services/Attendance/MyAttendanceService.php`)
- Attendance Service → Schedule Days Off: checks days off (evidence: `app/Services/Attendance/MyAttendanceService.php`)
- Attendance Service → Shifts: reads shifts (evidence: `app/Services/Attendance/MyAttendanceService.php`)
- Burnout Risk → Employee Records: reads workforce data (evidence: `app/Services/Burnout/BurnoutRiskService.php`)
- Burnout Risk → Departments: reads departments (evidence: `app/Services/Burnout/BurnoutRiskService.php`)
- Burnout Risk → Positions: reads positions (evidence: `app/Services/Burnout/BurnoutRiskService.php`)
- Workforce Analytics → Burnout Risk: provides risk insights
- Session Login → Device Sessions: claims device session (evidence: `app/Http/Controllers/Auth/AuthenticatedSessionController.php`)
- Device Sessions → User Accounts: updates session claim (evidence: `app/Services/ActiveDeviceSessionService.php`)
- REST API Auth → User Accounts: authenticates account (evidence: `app/Http/Controllers/Api/V1/AuthController.php`)
- Workforce User → Attendance: records attendance
- Workforce User → Workforce Analytics: views analytics
- Workforce User → REST API Auth: uses REST API
- Schedule Calendar → Gemini AI: AI assistance
- Employee Records → Application Database: persists records
- Roster Assignments → Application Database: persists roster
