# dihas-ets/wakati-api architecture

> Architecture diagram of the GitHub repository dihas-ets/wakati-api, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dihas-ets/wakati-api
- Repository: https://github.com/dihas-ets/wakati-api

## Overview

This is a Laravel API for workforce administration and attendance: authenticated users and kiosk clients submit attendance or management actions, which API routes dispatch to controllers that validate requests and operate on Eloquent records. The visible domain spans employees, schedules and work patterns, leave, absences, and kiosk/offline attendance. The graph also includes reporting and security-related branches from the source index and tree. Those branches are not all sampled, so their internal calls are left unspecified.

Main entry points: [`routes/api.php`](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/routes/api.php) (API routes), [`app/Http/Controllers/Api/AttendanceController.php`](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/AttendanceController.php) (Attendance operations), [`app/Models/User.php`](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Models/User.php) (User records), [`app/Http/Controllers/Api/LeaveController.php`](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/LeaveController.php) (Leave requests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API entry"]
  node_api_routes["API routes<br/>[api.php]"]
end

subgraph group_people["Workforce administration"]
  node_users["User accounts<br/>[UserController.php]"]
  node_employees["Employee records"]
  node_departments["Departments"]
  node_user_model[("User records<br/>[User.php]")]
  node_department_model[("Department records<br/>[Department.php]")]
end

subgraph group_time["Time and leave"]
  node_schedules["Schedules"]
  node_schedule_model[("Schedule records<br/>[Schedule.php]")]
  node_work_patterns["Work patterns"]
  node_work_pattern_model[("Work pattern records<br/>[WorkPattern.php]")]
  node_leaves["Leave requests"]
  node_leave_model[("Leave records<br/>[Leave.php]")]
  node_absences["Absence handling"]
  node_absence_model[("Absence records<br/>[Absence.php]")]
  node_explanations["Explanation requests"]
end

subgraph group_kiosk["Kiosk attendance"]
  node_attendance["Attendance operations"]
  node_attendance_model[("Attendance records<br/>[Attendance.php]")]
  node_kiosk_security["Kiosk security"]
  node_heartbeats["Kiosk heartbeat"]
  node_badges["Badge management"]
end

subgraph group_platform["Access and reporting"]
  node_settings["Company settings"]
  node_setting_model[("Setting records<br/>[CompanySetting.php]")]
  node_exports["Data exports"]
  node_stats["Workforce statistics"]
  node_activity["Activity log"]
  node_auth["Authentication<br/>[AuthController.php]"]
end

node_client(("API clients"))
node_kiosk_actor(("Kiosk clients"))

node_client -->|"sends requests"| node_api_routes
node_kiosk_actor -->|"sends scans"| node_api_routes
node_api_routes -->|"dispatches"| node_users
node_api_routes -->|"dispatches"| node_employees
node_api_routes -->|"dispatches"| node_departments
node_api_routes -->|"dispatches"| node_attendance
node_api_routes -->|"dispatches"| node_schedules
node_api_routes -->|"dispatches"| node_work_patterns
node_api_routes -->|"dispatches"| node_leaves
node_api_routes -->|"dispatches"| node_absences
node_api_routes -->|"dispatches"| node_explanations
node_api_routes -->|"dispatches"| node_kiosk_security
node_api_routes -->|"dispatches"| node_heartbeats
node_api_routes -->|"dispatches"| node_badges
node_api_routes -->|"dispatches"| node_settings
node_api_routes -->|"dispatches"| node_exports
node_api_routes -->|"dispatches"| node_stats
node_api_routes -->|"dispatches"| node_activity
node_api_routes -->|"dispatches"| node_auth
node_users -->|"reads and writes"| node_user_model
node_employees -->|"uses"| node_user_model
node_departments -.->|"uses"| node_department_model
node_attendance -->|"records attendance"| node_attendance_model
node_attendance -->|"looks up badges"| node_user_model
node_attendance -->|"reads schedules"| node_schedule_model
node_attendance -->|"reads patterns"| node_work_pattern_model
node_attendance -->|"reads settings"| node_setting_model
node_schedules -.->|"manages records"| node_schedule_model
node_work_patterns -->|"manages records"| node_work_pattern_model
node_leaves -->|"manages requests"| node_leave_model
node_absences -->|"manages records"| node_absence_model
node_kiosk_security -->|"checks users"| node_user_model
node_settings -.->|"manages settings"| node_setting_model
node_leaves -->|"records actions"| node_activity

click node_users "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/UserController.php"
click node_employees "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/EmployeeController.php"
click node_departments "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/DepartmentController.php"
click node_user_model "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Models/User.php"
click node_department_model "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Models/Department.php"
click node_attendance "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/AttendanceController.php"
click node_attendance_model "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Models/Attendance.php"
click node_schedules "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/ScheduleController.php"
click node_schedule_model "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Models/Schedule.php"
click node_work_patterns "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/WorkPatternController.php"
click node_work_pattern_model "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Models/WorkPattern.php"
click node_leaves "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/LeaveController.php"
click node_leave_model "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Models/Leave.php"
click node_absences "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/AbsenceController.php"
click node_absence_model "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Models/Absence.php"
click node_explanations "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/ExplanationRequestController.php"
click node_kiosk_security "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/KioskSecurityController.php"
click node_heartbeats "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/KioskHeartbeatController.php"
click node_badges "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/BadgeController.php"
click node_settings "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/CompanySettingController.php"
click node_setting_model "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Models/CompanySetting.php"
click node_exports "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/ExportController.php"
click node_stats "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/StatsController.php"
click node_activity "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/ActivityLogController.php"
click node_auth "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/AuthController.php"
click node_api_routes "https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/routes/api.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_api_routes,node_client,node_kiosk_actor toneBlue
class node_users,node_employees,node_departments,node_user_model,node_department_model toneAmber
class node_schedules,node_schedule_model,node_work_patterns,node_work_pattern_model,node_leaves,node_leave_model,node_absences,node_absence_model,node_explanations toneMint
class node_attendance,node_attendance_model,node_kiosk_security,node_heartbeats,node_badges toneRose
class node_settings,node_setting_model,node_exports,node_stats,node_activity,node_auth toneIndigo
```

## Components

### API entry

- [API routes](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/routes/api.php): `routes/api.php`

### Workforce administration

- [User accounts](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/UserController.php): `app/Http/Controllers/Api/UserController.php`
- [Employee records](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/EmployeeController.php): `app/Http/Controllers/Api/EmployeeController.php`
- [Departments](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/DepartmentController.php): `app/Http/Controllers/Api/DepartmentController.php`
- [User records](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Models/User.php): `app/Models/User.php`
- [Department records](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Models/Department.php): `app/Models/Department.php`

### Time and leave

- [Schedules](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/ScheduleController.php): `app/Http/Controllers/Api/ScheduleController.php`
- [Schedule records](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Models/Schedule.php): `app/Models/Schedule.php`
- [Work patterns](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/WorkPatternController.php): `app/Http/Controllers/Api/WorkPatternController.php`
- [Work pattern records](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Models/WorkPattern.php): `app/Models/WorkPattern.php`
- [Leave requests](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/LeaveController.php): `app/Http/Controllers/Api/LeaveController.php`
- [Leave records](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Models/Leave.php): `app/Models/Leave.php`
- [Absence handling](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/AbsenceController.php): `app/Http/Controllers/Api/AbsenceController.php`
- [Absence records](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Models/Absence.php): `app/Models/Absence.php`
- [Explanation requests](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/ExplanationRequestController.php): `app/Http/Controllers/Api/ExplanationRequestController.php`

### Kiosk attendance

- [Attendance operations](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/AttendanceController.php): `app/Http/Controllers/Api/AttendanceController.php`
- [Attendance records](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Models/Attendance.php): `app/Models/Attendance.php`
- [Kiosk security](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/KioskSecurityController.php): `app/Http/Controllers/Api/KioskSecurityController.php`
- [Kiosk heartbeat](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/KioskHeartbeatController.php): `app/Http/Controllers/Api/KioskHeartbeatController.php`
- [Badge management](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/BadgeController.php): `app/Http/Controllers/Api/BadgeController.php`

### Access and reporting

- [Company settings](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/CompanySettingController.php): `app/Http/Controllers/Api/CompanySettingController.php`
- [Setting records](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Models/CompanySetting.php): `app/Models/CompanySetting.php`
- [Data exports](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/ExportController.php): `app/Http/Controllers/Api/ExportController.php`
- [Workforce statistics](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/StatsController.php): `app/Http/Controllers/Api/StatsController.php`
- [Activity log](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/ActivityLogController.php): `app/Http/Controllers/Api/ActivityLogController.php`
- [Authentication](https://github.com/dihas-ets/wakati-api/blob/wakati-mono-entreprise/app/Http/Controllers/Api/AuthController.php): `app/Http/Controllers/Api/AuthController.php`

### Other components

- **API clients**
- **Kiosk clients**

## Connections

- API clients → API routes: sends requests (evidence: `routes/api.php`)
- Kiosk clients → API routes: sends scans (evidence: `routes/api.php`)
- API routes → User accounts: dispatches (evidence: `routes/api.php`)
- API routes → Employee records: dispatches (evidence: `routes/api.php`)
- API routes → Departments: dispatches (evidence: `routes/api.php`)
- API routes → Attendance operations: dispatches (evidence: `routes/api.php`)
- API routes → Schedules: dispatches (evidence: `routes/api.php`)
- API routes → Work patterns: dispatches (evidence: `routes/api.php`)
- API routes → Leave requests: dispatches (evidence: `routes/api.php`)
- API routes → Absence handling: dispatches (evidence: `routes/api.php`)
- API routes → Explanation requests: dispatches (evidence: `routes/api.php`)
- API routes → Kiosk security: dispatches (evidence: `routes/api.php`)
- API routes → Kiosk heartbeat: dispatches (evidence: `routes/api.php`)
- API routes → Badge management: dispatches (evidence: `routes/api.php`)
- API routes → Company settings: dispatches (evidence: `routes/api.php`)
- API routes → Data exports: dispatches (evidence: `routes/api.php`)
- API routes → Workforce statistics: dispatches (evidence: `routes/api.php`)
- API routes → Activity log: dispatches (evidence: `routes/api.php`)
- API routes → Authentication: dispatches (evidence: `routes/api.php`)
- User accounts → User records: reads and writes (evidence: `app/Http/Controllers/Api/UserController.php`)
- Employee records → User records: uses (evidence: `app/Http/Controllers/Api/EmployeeController.php`)
- Departments → Department records: uses
- Attendance operations → Attendance records: records attendance (evidence: `app/Http/Controllers/Api/AttendanceController.php`)
- Attendance operations → User records: looks up badges (evidence: `app/Http/Controllers/Api/AttendanceController.php`)
- Attendance operations → Schedule records: reads schedules (evidence: `app/Http/Controllers/Api/AttendanceController.php`)
- Attendance operations → Work pattern records: reads patterns (evidence: `app/Http/Controllers/Api/AttendanceController.php`)
- Attendance operations → Setting records: reads settings (evidence: `app/Http/Controllers/Api/AttendanceController.php`)
- Schedules → Schedule records: manages records
- Work patterns → Work pattern records: manages records (evidence: `app/Http/Controllers/Api/WorkPatternController.php`)
- Leave requests → Leave records: manages requests (evidence: `app/Http/Controllers/Api/LeaveController.php`)
- Absence handling → Absence records: manages records (evidence: `app/Http/Controllers/Api/AbsenceController.php`)
- Kiosk security → User records: checks users (evidence: `app/Http/Controllers/Api/KioskSecurityController.php`)
- Company settings → Setting records: manages settings
- Leave requests → Activity log: records actions (evidence: `app/Http/Controllers/Api/LeaveController.php`)
