# horacioquijano/horion-time architecture

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

- Interactive diagram: https://gitdiagram.com/horacioquijano/horion-time
- Repository: https://github.com/horacioquijano/horion-time

## Overview

HORION TIME is a multi-company workforce attendance and time-management system. Employees authenticate, record attendance—with the web flow checking location and facial descriptors—and review their records; administrators manage schedules and requests, while supervisors approve employee matters. Reporting, dashboards, audit, notifications, kiosks, and a JWT-protected API support that core workflow. The sampled source confirms the web dispatch, attendance and schedule paths, API login and attendance behavior, database connection, and notification engines; other documented modules are represented from the README and tree, without asserting unverified wiring.

Main entry points: [`app/config/Database.php`](https://github.com/horacioquijano/horion-time/blob/main/app/config/Database.php) (MySQL database), [`public/index.php`](https://github.com/horacioquijano/horion-time/blob/main/public/index.php) (Web application), [`public/api.php`](https://github.com/horacioquijano/horion-time/blob/main/public/api.php) (REST API), [`app/Controllers/AsistenciaController.php`](https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/AsistenciaController.php) (Attendance)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_web["Web application<br/>[index.php]"]
  node_api["REST API<br/>[api.php]"]
end

subgraph group_workforce["Attendance and scheduling"]
  node_attendance["Attendance"]
  node_attendance_api["API attendance"]
  node_attendance_model["Attendance data"]
  node_schedules["Schedules and shifts"]
  node_schedule_model["Schedule data<br/>[HorarioModel.php]"]
end

subgraph group_selfservice["Employee workflows"]
  node_novelties["Employee requests"]
  node_overtime["Overtime"]
  node_employee_portal["Employee portal"]
  node_kiosk["Attendance kiosk"]
  node_supervisor_portal["Supervisor portal"]
end

subgraph group_oversight["Management and insights"]
  node_dashboard["Dashboard"]
  node_reports["Reports"]
  node_api_reports["API reports"]
  node_audit["Audit"]
  node_companies["Companies and sites"]
  node_configuration["Rules and settings"]
end

subgraph group_platform["Shared platform"]
  node_notifications["Notification engine"]
  node_alert_rules["Alert rules"]
  node_auth_api["API authentication"]
  node_api_auth["API auth middleware<br/>[ApiAuth.php]"]
  node_database[("MySQL database<br/>[Database.php]")]
end

node_employee(("Employee"))
node_administrator(("Administrator"))
node_supervisor(("Supervisor"))

node_employee -->|"uses"| node_web
node_administrator -->|"manages"| node_web
node_supervisor -->|"reviews"| node_web
node_web -->|"dispatches"| node_attendance
node_web -->|"dispatches"| node_schedules
node_attendance -->|"calls"| node_attendance_model
node_attendance -->|"queries"| node_database
node_attendance_model -->|"reads and writes"| node_database
node_schedules -->|"calls"| node_schedule_model
node_schedules -->|"queries"| node_database
node_employee -->|"uses"| node_api
node_api -->|"dispatches"| node_auth_api
node_api -->|"dispatches"| node_attendance_api
node_api -->|"dispatches"| node_api_reports
node_auth_api -->|"reads and writes"| node_database
node_auth_api -->|"authenticates"| node_api_auth
node_attendance_api -->|"calls"| node_attendance_model
node_attendance_api -->|"queries"| node_database
node_api_reports -->|"queries"| node_database
node_alert_rules -->|"sends and queues"| node_notifications
node_notifications -->|"stores queue"| node_database

click node_web "https://github.com/horacioquijano/horion-time/blob/main/public/index.php"
click node_api "https://github.com/horacioquijano/horion-time/blob/main/public/api.php"
click node_attendance "https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/AsistenciaController.php"
click node_attendance_api "https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/Api/AsistenciaApiController.php"
click node_attendance_model "https://github.com/horacioquijano/horion-time/blob/main/app/Models/AsistenciaModel.php"
click node_schedules "https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/HorarioController.php"
click node_schedule_model "https://github.com/horacioquijano/horion-time/blob/main/app/Models/HorarioModel.php"
click node_novelties "https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/NovedadController.php"
click node_overtime "https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/HoraExtraController.php"
click node_employee_portal "https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/PortalController.php"
click node_kiosk "https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/KioscoController.php"
click node_supervisor_portal "https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/SupervisorController.php"
click node_dashboard "https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/DashboardController.php"
click node_reports "https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/ReporteController.php"
click node_api_reports "https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/Api/ReportesApiController.php"
click node_audit "https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/AuditoriaController.php"
click node_companies "https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/EmpresaController.php"
click node_configuration "https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/ConfiguracionController.php"
click node_notifications "https://github.com/horacioquijano/horion-time/blob/main/app/Services/NotificationEngine.php"
click node_alert_rules "https://github.com/horacioquijano/horion-time/blob/main/app/Services/AlertRulesEngine.php"
click node_auth_api "https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/Api/AuthApiController.php"
click node_api_auth "https://github.com/horacioquijano/horion-time/blob/main/app/Middleware/ApiAuth.php"
click node_database "https://github.com/horacioquijano/horion-time/blob/main/app/config/Database.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_web,node_api toneBlue
class node_attendance,node_attendance_api,node_attendance_model,node_schedules,node_schedule_model toneAmber
class node_novelties,node_overtime,node_employee_portal,node_kiosk,node_supervisor_portal toneMint
class node_dashboard,node_reports,node_api_reports,node_audit,node_companies,node_configuration toneRose
class node_notifications,node_alert_rules,node_auth_api,node_api_auth,node_database,node_employee,node_administrator,node_supervisor toneIndigo
```

## Components

### Application entry

- [Web application](https://github.com/horacioquijano/horion-time/blob/main/public/index.php): `public/index.php`
- [REST API](https://github.com/horacioquijano/horion-time/blob/main/public/api.php): `public/api.php`

### Attendance and scheduling

- [Attendance](https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/AsistenciaController.php): `app/Controllers/AsistenciaController.php`
- [API attendance](https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/Api/AsistenciaApiController.php): `app/Controllers/Api/AsistenciaApiController.php`
- [Attendance data](https://github.com/horacioquijano/horion-time/blob/main/app/Models/AsistenciaModel.php): `app/Models/AsistenciaModel.php`
- [Schedules and shifts](https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/HorarioController.php): `app/Controllers/HorarioController.php`
- [Schedule data](https://github.com/horacioquijano/horion-time/blob/main/app/Models/HorarioModel.php): `app/Models/HorarioModel.php`

### Employee workflows

- [Employee requests](https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/NovedadController.php): `app/Controllers/NovedadController.php`
- [Overtime](https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/HoraExtraController.php): `app/Controllers/HoraExtraController.php`
- [Employee portal](https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/PortalController.php): `app/Controllers/PortalController.php`
- [Attendance kiosk](https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/KioscoController.php): `app/Controllers/KioscoController.php`
- [Supervisor portal](https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/SupervisorController.php): `app/Controllers/SupervisorController.php`

### Management and insights

- [Dashboard](https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/DashboardController.php): `app/Controllers/DashboardController.php`
- [Reports](https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/ReporteController.php): `app/Controllers/ReporteController.php`
- [API reports](https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/Api/ReportesApiController.php): `app/Controllers/Api/ReportesApiController.php`
- [Audit](https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/AuditoriaController.php): `app/Controllers/AuditoriaController.php`
- [Companies and sites](https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/EmpresaController.php): `app/Controllers/EmpresaController.php`
- [Rules and settings](https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/ConfiguracionController.php): `app/Controllers/ConfiguracionController.php`

### Shared platform

- [Notification engine](https://github.com/horacioquijano/horion-time/blob/main/app/Services/NotificationEngine.php): `app/Services/NotificationEngine.php`
- [Alert rules](https://github.com/horacioquijano/horion-time/blob/main/app/Services/AlertRulesEngine.php): `app/Services/AlertRulesEngine.php`
- [API authentication](https://github.com/horacioquijano/horion-time/blob/main/app/Controllers/Api/AuthApiController.php): `app/Controllers/Api/AuthApiController.php`
- [API auth middleware](https://github.com/horacioquijano/horion-time/blob/main/app/Middleware/ApiAuth.php): `app/Middleware/ApiAuth.php`
- [MySQL database](https://github.com/horacioquijano/horion-time/blob/main/app/config/Database.php): `app/config/Database.php`

### Other components

- **Employee**
- **Administrator**
- **Supervisor**

## Connections

- Employee → Web application: uses
- Administrator → Web application: manages
- Supervisor → Web application: reviews
- Web application → Attendance: dispatches
- Web application → Schedules and shifts: dispatches
- Attendance → Attendance data: calls
- Attendance → MySQL database: queries
- Attendance data → MySQL database: reads and writes
- Schedules and shifts → Schedule data: calls
- Schedules and shifts → MySQL database: queries
- Employee → REST API: uses
- REST API → API authentication: dispatches
- REST API → API attendance: dispatches
- REST API → API reports: dispatches
- API authentication → MySQL database: reads and writes
- API authentication → API auth middleware: authenticates
- API attendance → Attendance data: calls
- API attendance → MySQL database: queries
- API reports → MySQL database: queries
- Alert rules → Notification engine: sends and queues
- Notification engine → MySQL database: stores queue
