# v-vey/biogeohr architecture

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

- Interactive diagram: https://gitdiagram.com/v-vey/biogeohr
- Repository: https://github.com/v-vey/biogeohr

## Overview

BioGeoHR is a biometric, geo-fenced attendance and payroll system. HR’s main workflow runs through the web admin: manage employees and attendance, review leave and loans, preview and run semi-monthly payroll, then view payslips and reports. Employees use the mobile app to clock in/out with location and biometric checks, and access attendance, leave, and pay information. The graph follows documented routes and sampled controller/service calls; mobile internals and several web-to-API calls were not sampled, so those links are documented at product level.

Main entry points: [`Backend/routes/api.php`](https://github.com/v-vey/biogeohr/blob/main/Backend/routes/api.php) (API routes), [`Backend/app/Models`](https://github.com/v-vey/biogeohr/tree/main/Backend/app/Models) (Domain records), [`Backend/app/Http/Controllers/API/PayslipController.php`](https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/API/PayslipController.php) (Payroll and payslips), [`Backend/app/Http/Controllers/API/AttendanceController.php`](https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/API/AttendanceController.php) (Attendance)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User clients"]
  node_web["Web admin"]
  node_mobile["Employee app"]
end

subgraph group_api["API and identity"]
  node_routes["API routes<br/>[api.php]"]
  node_auth["Login and tokens"]
end

subgraph group_workforce["Workforce operations"]
  node_employees["Employee management"]
  node_attendance["Attendance"]
  node_geofence["Geo-fence checks"]
  node_geo_service["Distance calculation"]
  node_absence["Absence syncing<br/>[AbsenceService.php]"]
  node_leave["Leave requests"]
  node_leave_balance["Leave balances"]
  node_locations["Fence locations"]
  node_holidays["Holidays"]
end

subgraph group_pay["Payroll"]
  node_loans["Loans<br/>[LoanController.php]"]
  node_salary["Pay calculations<br/>[SalaryService.php]"]
  node_payslips["Payroll and payslips"]
end

subgraph group_records["Domain records"]
  node_audit["Audit log"]
  node_models[("Domain records")]
end

node_hr(("HR staff"))
node_employee(("Employee"))

node_hr -->|"manages staff"| node_web
node_employee -->|"clocks and reviews"| node_mobile
node_web -.->|"uses HR API"| node_routes
node_mobile -.->|"uses employee API"| node_routes
node_routes -->|"routes login"| node_auth
node_routes -->|"routes requests"| node_employees
node_routes -->|"routes requests"| node_attendance
node_routes -->|"routes requests"| node_leave
node_routes -->|"routes requests"| node_leave_balance
node_routes -->|"routes requests"| node_locations
node_routes -->|"routes requests"| node_holidays
node_routes -->|"routes requests"| node_loans
node_routes -->|"routes requests"| node_payslips
node_routes -->|"routes requests"| node_audit
node_geofence -->|"calculates distance"| node_geo_service
node_attendance -->|"syncs absences"| node_absence
node_payslips -->|"syncs absences"| node_absence
node_payslips -->|"calculates pay"| node_salary
node_loans -->|"uses pay service"| node_salary
node_employees -->|"reads and writes"| node_models
node_attendance -->|"reads and writes"| node_models
node_geofence -->|"reads and writes"| node_models
node_leave -->|"reads and writes"| node_models
node_leave_balance -->|"reads and writes"| node_models
node_locations -->|"reads and writes"| node_models
node_holidays -->|"reads and writes"| node_models
node_loans -->|"reads and writes"| node_models
node_payslips -->|"reads and writes"| node_models
node_audit -->|"reads audit records"| node_models
node_salary -->|"reads payroll inputs"| node_models

click node_web "https://github.com/v-vey/biogeohr/tree/main/Frontend/web/src"
click node_mobile "https://github.com/v-vey/biogeohr/tree/main/Frontend/Mobile"
click node_routes "https://github.com/v-vey/biogeohr/blob/main/Backend/routes/api.php"
click node_auth "https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/Auth/LoginAuthController.php"
click node_employees "https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/API/UsersController.php"
click node_attendance "https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/API/AttendanceController.php"
click node_geofence "https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/Feature/GeoFenceController.php"
click node_geo_service "https://github.com/v-vey/biogeohr/blob/main/Backend/app/Service/GeoFenceService.php"
click node_absence "https://github.com/v-vey/biogeohr/blob/main/Backend/app/Service/AbsenceService.php"
click node_leave "https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/API/LeaveApplicationController.php"
click node_leave_balance "https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/API/LeaveBalanceController.php"
click node_locations "https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/API/LocationController.php"
click node_holidays "https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/API/HolidayController.php"
click node_loans "https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/API/LoanController.php"
click node_salary "https://github.com/v-vey/biogeohr/blob/main/Backend/app/Service/SalaryService.php"
click node_payslips "https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/API/PayslipController.php"
click node_audit "https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/API/AuditLogController.php"
click node_models "https://github.com/v-vey/biogeohr/tree/main/Backend/app/Models"

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_mobile toneBlue
class node_routes,node_auth toneAmber
class node_employees,node_attendance,node_geofence,node_geo_service,node_absence,node_leave,node_leave_balance,node_locations,node_holidays toneMint
class node_loans,node_salary,node_payslips toneRose
class node_audit,node_models,node_hr,node_employee toneIndigo
```

## Components

### User clients

- [Web admin](https://github.com/v-vey/biogeohr/tree/main/Frontend/web/src): `Frontend/web/src`
- [Employee app](https://github.com/v-vey/biogeohr/tree/main/Frontend/Mobile): `Frontend/Mobile`

### API and identity

- [API routes](https://github.com/v-vey/biogeohr/blob/main/Backend/routes/api.php): `Backend/routes/api.php`
- [Login and tokens](https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/Auth/LoginAuthController.php): `Backend/app/Http/Controllers/Auth/LoginAuthController.php`

### Workforce operations

- [Employee management](https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/API/UsersController.php): `Backend/app/Http/Controllers/API/UsersController.php`
- [Attendance](https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/API/AttendanceController.php): `Backend/app/Http/Controllers/API/AttendanceController.php`
- [Geo-fence checks](https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/Feature/GeoFenceController.php): `Backend/app/Http/Controllers/Feature/GeoFenceController.php`
- [Distance calculation](https://github.com/v-vey/biogeohr/blob/main/Backend/app/Service/GeoFenceService.php): `Backend/app/Service/GeoFenceService.php`
- [Absence syncing](https://github.com/v-vey/biogeohr/blob/main/Backend/app/Service/AbsenceService.php): `Backend/app/Service/AbsenceService.php`
- [Leave requests](https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/API/LeaveApplicationController.php): `Backend/app/Http/Controllers/API/LeaveApplicationController.php`
- [Leave balances](https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/API/LeaveBalanceController.php): `Backend/app/Http/Controllers/API/LeaveBalanceController.php`
- [Fence locations](https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/API/LocationController.php): `Backend/app/Http/Controllers/API/LocationController.php`
- [Holidays](https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/API/HolidayController.php): `Backend/app/Http/Controllers/API/HolidayController.php`

### Payroll

- [Loans](https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/API/LoanController.php): `Backend/app/Http/Controllers/API/LoanController.php`
- [Pay calculations](https://github.com/v-vey/biogeohr/blob/main/Backend/app/Service/SalaryService.php): `Backend/app/Service/SalaryService.php`
- [Payroll and payslips](https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/API/PayslipController.php): `Backend/app/Http/Controllers/API/PayslipController.php`

### Domain records

- [Audit log](https://github.com/v-vey/biogeohr/blob/main/Backend/app/Http/Controllers/API/AuditLogController.php): `Backend/app/Http/Controllers/API/AuditLogController.php`
- [Domain records](https://github.com/v-vey/biogeohr/tree/main/Backend/app/Models): `Backend/app/Models`

### Other components

- **HR staff**
- **Employee**

## Connections

- HR staff → Web admin: manages staff
- Employee → Employee app: clocks and reviews
- Web admin → API routes: uses HR API
- Employee app → API routes: uses employee API
- API routes → Login and tokens: routes login (evidence: `Backend/routes/api.php`)
- API routes → Employee management: routes requests (evidence: `Backend/routes/api.php`)
- API routes → Attendance: routes requests (evidence: `Backend/routes/api.php`)
- API routes → Leave requests: routes requests (evidence: `Backend/routes/api.php`)
- API routes → Leave balances: routes requests (evidence: `Backend/routes/api.php`)
- API routes → Fence locations: routes requests (evidence: `Backend/routes/api.php`)
- API routes → Holidays: routes requests (evidence: `Backend/routes/api.php`)
- API routes → Loans: routes requests (evidence: `Backend/routes/api.php`)
- API routes → Payroll and payslips: routes requests (evidence: `Backend/routes/api.php`)
- API routes → Audit log: routes requests (evidence: `Backend/routes/api.php`)
- Geo-fence checks → Distance calculation: calculates distance (evidence: `Backend/app/Http/Controllers/Feature/GeoFenceController.php`)
- Attendance → Absence syncing: syncs absences (evidence: `Backend/app/Http/Controllers/API/AttendanceController.php`)
- Payroll and payslips → Absence syncing: syncs absences (evidence: `Backend/app/Http/Controllers/API/PayslipController.php`)
- Payroll and payslips → Pay calculations: calculates pay (evidence: `Backend/app/Http/Controllers/API/PayslipController.php`)
- Loans → Pay calculations: uses pay service (evidence: `Backend/app/Http/Controllers/API/LoanController.php`)
- Employee management → Domain records: reads and writes (evidence: `Backend/app/Http/Controllers/API/UsersController.php`)
- Attendance → Domain records: reads and writes (evidence: `Backend/app/Http/Controllers/API/AttendanceController.php`)
- Geo-fence checks → Domain records: reads and writes (evidence: `Backend/app/Http/Controllers/Feature/GeoFenceController.php`)
- Leave requests → Domain records: reads and writes (evidence: `Backend/app/Http/Controllers/API/LeaveApplicationController.php`)
- Leave balances → Domain records: reads and writes (evidence: `Backend/app/Http/Controllers/API/LeaveBalanceController.php`)
- Fence locations → Domain records: reads and writes (evidence: `Backend/app/Http/Controllers/API/LocationController.php`)
- Holidays → Domain records: reads and writes (evidence: `Backend/app/Http/Controllers/API/HolidayController.php`)
- Loans → Domain records: reads and writes (evidence: `Backend/app/Http/Controllers/API/LoanController.php`)
- Payroll and payslips → Domain records: reads and writes (evidence: `Backend/app/Http/Controllers/API/PayslipController.php`)
- Audit log → Domain records: reads audit records (evidence: `Backend/app/Http/Controllers/API/AuditLogController.php`)
- Pay calculations → Domain records: reads payroll inputs (evidence: `Backend/app/Service/SalaryService.php`)
