# mas0uu/dtr-system architecture

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

- Interactive diagram: https://gitdiagram.com/mas0uu/dtr-system
- Repository: https://github.com/mas0uu/dtr-system

## Overview

DTR Web App is a session-authenticated employee time-recording and payroll application. Employees record daily attendance, review monthly totals, and submit leave/absence requests; administrators manage employees and holidays, review attendance anomalies and audit activity, and generate, review, and finalize payroll. The Laravel controllers connect the Inertia pages to domain models, with dedicated payroll and leave-balance services. The README establishes the main capabilities; unsampled controllers are represented by their exact paths, with only documented or clearly owned relationships shown.

Main entry points: [`routes/web.php`](https://github.com/mas0uu/dtr-system/blob/main/routes/web.php) (Web routes), [`app/Http/Controllers/AdminPayrollController.php`](https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/AdminPayrollController.php) (Payroll workflow), [`app/Models/DtrRow.php`](https://github.com/mas0uu/dtr-system/blob/main/app/Models/DtrRow.php) (DTR records), [`app/Http/Controllers/DtrMonthController.php`](https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/DtrMonthController.php) (Monthly DTR)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and UI"]
  node_routes["Web routes<br/>[web.php]"]
  node_auth["Session authentication"]
  node_frontend["Inertia application<br/>[app.tsx]"]
end

subgraph group_attendance["Attendance and leave"]
  node_dtrpages["DTR pages<br/>[Index.tsx]"]
  node_dtrmonth["Monthly DTR"]
  node_dtrrow["DTR row operations"]
  node_attendanceapi["DTR API"]
  node_leave["Leave requests"]
  node_leavebalance["Leave balances"]
  node_holiday["Holiday views"]
end

subgraph group_administration["Administration"]
  node_adminattendance["Attendance review"]
  node_anomalies["Anomaly review"]
  node_employees["Employee management"]
  node_adminleave["Leave administration"]
  node_holidays["Holiday management"]
  node_audit["Audit activity<br/>[AuditLogger.php]"]
end

subgraph group_payroll["Payroll"]
  node_payrollcontroller["Payroll workflow"]
  node_payrollcalc["Payroll calculation"]
  node_payrolllock["Payroll locking"]
  node_payrollpage["Payroll pages<br/>[Index.tsx]"]
end

subgraph group_domain["Domain and persistence"]
  node_userstore[("Users<br/>[User.php]")]
  node_dtrstore[("DTR records<br/>[DtrRow.php]")]
  node_leavestore[("Leave records<br/>[LeaveRequest.php]")]
  node_holidaystore[("Holiday records<br/>[Holiday.php]")]
  node_payrollstore[("Payroll records<br/>[PayrollRecord.php]")]
  node_auditstore[("Audit records<br/>[AuditLog.php]")]
end

node_employee(("Employee"))
node_admin(("Administrator"))

node_employee -->|"requests"| node_routes
node_admin -->|"requests"| node_routes
node_routes -->|"dispatches"| node_auth
node_auth -->|"authenticates"| node_userstore
node_routes -->|"dispatches"| node_dtrmonth
node_routes -->|"dispatches"| node_dtrrow
node_routes -->|"dispatches"| node_attendanceapi
node_routes -->|"dispatches"| node_leave
node_routes -->|"dispatches"| node_holiday
node_routes -->|"dispatches"| node_adminattendance
node_routes -->|"dispatches"| node_anomalies
node_routes -->|"dispatches"| node_employees
node_routes -->|"dispatches"| node_adminleave
node_routes -->|"dispatches"| node_holidays
node_routes -->|"dispatches"| node_payrollcontroller
node_dtrmonth -->|"reads"| node_dtrstore
node_dtrmonth -->|"reads"| node_holidaystore
node_dtrmonth -->|"reads"| node_payrollstore
node_dtrrow -->|"updates"| node_dtrstore
node_attendanceapi -->|"creates and updates"| node_dtrstore
node_employees -->|"manages"| node_userstore
node_holiday -->|"reads"| node_holidaystore
node_holidays -->|"manages"| node_holidaystore
node_leave -->|"manages"| node_leavestore
node_leave -->|"uses"| node_leavebalance
node_adminleave -->|"manages"| node_leavestore
node_adminattendance -->|"reads"| node_dtrstore
node_anomalies -->|"reviews"| node_dtrstore
node_payrollcontroller -->|"calculates"| node_payrollcalc
node_payrollcontroller -->|"creates and updates"| node_payrollstore
node_payrollcontroller -->|"logs changes"| node_audit
node_payrollcontroller -->|"uses"| node_payrolllock
node_payrollcalc -->|"reads attendance"| node_dtrstore
node_payrollcontroller -->|"reads employees"| node_userstore
node_payrollcontroller -->|"renders"| node_payrollpage
node_audit -->|"writes"| node_auditstore
node_routes -->|"serves Inertia"| node_frontend
node_frontend -->|"resolves pages"| node_dtrpages

click node_routes "https://github.com/mas0uu/dtr-system/blob/main/routes/web.php"
click node_auth "https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php"
click node_frontend "https://github.com/mas0uu/dtr-system/blob/main/resources/js/app.tsx"
click node_dtrpages "https://github.com/mas0uu/dtr-system/blob/main/resources/js/Pages/Dtr/Index.tsx"
click node_dtrmonth "https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/DtrMonthController.php"
click node_dtrrow "https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/DtrRowController.php"
click node_attendanceapi "https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/Api/DtrRowController.php"
click node_leave "https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/EmployeeLeaveController.php"
click node_leavebalance "https://github.com/mas0uu/dtr-system/blob/main/app/Services/LeaveBalanceService.php"
click node_holiday "https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/EmployeeHolidayController.php"
click node_adminattendance "https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/AdminAttendanceController.php"
click node_anomalies "https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/AdminAnomalyController.php"
click node_employees "https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/AdminEmployeeController.php"
click node_adminleave "https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/AdminLeaveController.php"
click node_holidays "https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/AdminHolidayController.php"
click node_audit "https://github.com/mas0uu/dtr-system/blob/main/app/Services/AuditLogger.php"
click node_payrollcontroller "https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/AdminPayrollController.php"
click node_payrollcalc "https://github.com/mas0uu/dtr-system/blob/main/app/Services/PayrollCalculator.php"
click node_payrolllock "https://github.com/mas0uu/dtr-system/blob/main/app/Services/PayrollLockService.php"
click node_payrollpage "https://github.com/mas0uu/dtr-system/blob/main/resources/js/Pages/Admin/Payroll/Index.tsx"
click node_userstore "https://github.com/mas0uu/dtr-system/blob/main/app/Models/User.php"
click node_dtrstore "https://github.com/mas0uu/dtr-system/blob/main/app/Models/DtrRow.php"
click node_leavestore "https://github.com/mas0uu/dtr-system/blob/main/app/Models/LeaveRequest.php"
click node_holidaystore "https://github.com/mas0uu/dtr-system/blob/main/app/Models/Holiday.php"
click node_payrollstore "https://github.com/mas0uu/dtr-system/blob/main/app/Models/PayrollRecord.php"
click node_auditstore "https://github.com/mas0uu/dtr-system/blob/main/app/Models/AuditLog.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_routes,node_auth,node_frontend toneBlue
class node_dtrpages,node_dtrmonth,node_dtrrow,node_attendanceapi,node_leave,node_leavebalance,node_holiday toneAmber
class node_adminattendance,node_anomalies,node_employees,node_adminleave,node_holidays,node_audit toneMint
class node_payrollcontroller,node_payrollcalc,node_payrolllock,node_payrollpage toneRose
class node_userstore,node_dtrstore,node_leavestore,node_holidaystore,node_payrollstore,node_auditstore,node_employee,node_admin toneIndigo
```

## Components

### Access and UI

- [Web routes](https://github.com/mas0uu/dtr-system/blob/main/routes/web.php): `routes/web.php`
- [Session authentication](https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/Auth/AuthenticatedSessionController.php): `app/Http/Controllers/Auth/AuthenticatedSessionController.php`
- [Inertia application](https://github.com/mas0uu/dtr-system/blob/main/resources/js/app.tsx): `resources/js/app.tsx`

### Attendance and leave

- [DTR pages](https://github.com/mas0uu/dtr-system/blob/main/resources/js/Pages/Dtr/Index.tsx): `resources/js/Pages/Dtr/Index.tsx`
- [Monthly DTR](https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/DtrMonthController.php): `app/Http/Controllers/DtrMonthController.php`
- [DTR row operations](https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/DtrRowController.php): `app/Http/Controllers/DtrRowController.php`
- [DTR API](https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/Api/DtrRowController.php): `app/Http/Controllers/Api/DtrRowController.php`
- [Leave requests](https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/EmployeeLeaveController.php): `app/Http/Controllers/EmployeeLeaveController.php`
- [Leave balances](https://github.com/mas0uu/dtr-system/blob/main/app/Services/LeaveBalanceService.php): `app/Services/LeaveBalanceService.php`
- [Holiday views](https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/EmployeeHolidayController.php): `app/Http/Controllers/EmployeeHolidayController.php`

### Administration

- [Attendance review](https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/AdminAttendanceController.php): `app/Http/Controllers/AdminAttendanceController.php`
- [Anomaly review](https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/AdminAnomalyController.php): `app/Http/Controllers/AdminAnomalyController.php`
- [Employee management](https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/AdminEmployeeController.php): `app/Http/Controllers/AdminEmployeeController.php`
- [Leave administration](https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/AdminLeaveController.php): `app/Http/Controllers/AdminLeaveController.php`
- [Holiday management](https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/AdminHolidayController.php): `app/Http/Controllers/AdminHolidayController.php`
- [Audit activity](https://github.com/mas0uu/dtr-system/blob/main/app/Services/AuditLogger.php): `app/Services/AuditLogger.php`

### Payroll

- [Payroll workflow](https://github.com/mas0uu/dtr-system/blob/main/app/Http/Controllers/AdminPayrollController.php): `app/Http/Controllers/AdminPayrollController.php`
- [Payroll calculation](https://github.com/mas0uu/dtr-system/blob/main/app/Services/PayrollCalculator.php): `app/Services/PayrollCalculator.php`
- [Payroll locking](https://github.com/mas0uu/dtr-system/blob/main/app/Services/PayrollLockService.php): `app/Services/PayrollLockService.php`
- [Payroll pages](https://github.com/mas0uu/dtr-system/blob/main/resources/js/Pages/Admin/Payroll/Index.tsx): `resources/js/Pages/Admin/Payroll/Index.tsx`

### Domain and persistence

- [Users](https://github.com/mas0uu/dtr-system/blob/main/app/Models/User.php): `app/Models/User.php`
- [DTR records](https://github.com/mas0uu/dtr-system/blob/main/app/Models/DtrRow.php): `app/Models/DtrRow.php`
- [Leave records](https://github.com/mas0uu/dtr-system/blob/main/app/Models/LeaveRequest.php): `app/Models/LeaveRequest.php`
- [Holiday records](https://github.com/mas0uu/dtr-system/blob/main/app/Models/Holiday.php): `app/Models/Holiday.php`
- [Payroll records](https://github.com/mas0uu/dtr-system/blob/main/app/Models/PayrollRecord.php): `app/Models/PayrollRecord.php`
- [Audit records](https://github.com/mas0uu/dtr-system/blob/main/app/Models/AuditLog.php): `app/Models/AuditLog.php`

### Other components

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

## Connections

- Employee → Web routes: requests
- Administrator → Web routes: requests
- Web routes → Session authentication: dispatches
- Session authentication → Users: authenticates
- Web routes → Monthly DTR: dispatches
- Web routes → DTR row operations: dispatches
- Web routes → DTR API: dispatches
- Web routes → Leave requests: dispatches
- Web routes → Holiday views: dispatches
- Web routes → Attendance review: dispatches
- Web routes → Anomaly review: dispatches
- Web routes → Employee management: dispatches
- Web routes → Leave administration: dispatches
- Web routes → Holiday management: dispatches
- Web routes → Payroll workflow: dispatches
- Monthly DTR → DTR records: reads
- Monthly DTR → Holiday records: reads
- Monthly DTR → Payroll records: reads
- DTR row operations → DTR records: updates
- DTR API → DTR records: creates and updates
- Employee management → Users: manages
- Holiday views → Holiday records: reads
- Holiday management → Holiday records: manages
- Leave requests → Leave records: manages
- Leave requests → Leave balances: uses
- Leave administration → Leave records: manages
- Attendance review → DTR records: reads
- Anomaly review → DTR records: reviews
- Payroll workflow → Payroll calculation: calculates
- Payroll workflow → Payroll records: creates and updates
- Payroll workflow → Audit activity: logs changes
- Payroll workflow → Payroll locking: uses
- Payroll calculation → DTR records: reads attendance
- Payroll workflow → Users: reads employees
- Payroll workflow → Payroll pages: renders
- Audit activity → Audit records: writes
- Web routes → Inertia application: serves Inertia
- Inertia application → DTR pages: resolves pages
