# mozpet/expenseflow architecture

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

- Interactive diagram: https://gitdiagram.com/mozpet/expenseflow
- Repository: https://github.com/mozpet/expenseflow

## Overview

ExpenseFlow combines an employee mobile app, a management web dashboard, and a Laravel REST API. The principal workflow is employee receipt capture and claim submission, asynchronous OCR extraction, and finance/management approval; parallel operational workflows cover invoice approvals, GPS/shift attendance, leave and overtime, and HR administration. The README documents these capabilities, while the sampled source confirms receipt OCR dispatch, attendance and shift controller responsibilities, and dashboard/API structure. Mobile application internals were not present in the sampled tree, so its node uses the repository directory.

Main entry points: [`expenseflow-backend/routes/api.php`](https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/routes/api.php) (REST API Routes), [`expenseflow-backend/app/Models/Receipt.php`](https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Models/Receipt.php) (Application Database), [`expenseflow-backend/app/Http/Controllers/API/ReceiptController.php`](https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Http/Controllers/API/ReceiptController.php) (Receipt Claims), [`expenseflow-backend/app/Http/Controllers/API/ShiftController.php`](https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Http/Controllers/API/ShiftController.php) (Shift Scheduling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User Clients"]
  node_mobile["Employee App"]
  node_dashboard["Management Dashboard<br/>[App.tsx]"]
  node_publicjobs["Public Recruitment<br/>[jobs.js]"]
end

subgraph group_api["API Access"]
  node_api_routes["REST API Routes<br/>[api.php]"]
  node_auth["Authentication<br/>[AuthController.php]"]
end

subgraph group_finance["Expense Workflows"]
  node_receipts["Receipt Claims"]
  node_ocr_job["OCR Queue Job<br/>[ProcessOcrJob.php]"]
  node_ocr_service["OCR Service<br/>[OcrService.php]"]
  node_ocr_drivers["OCR Drivers"]
  node_invoices["Invoice Approvals"]
end

subgraph group_people["Workforce Operations"]
  node_attendance["Attendance"]
  node_shifts["Shift Scheduling"]
  node_leave["Leave And Overtime<br/>[LeaveRequest.php]"]
  node_recruitment["Recruitment Management"]
end

subgraph group_platform["Shared Services"]
  node_identity["Users And Roles<br/>[UserController.php]"]
  node_audit["Audit Logging<br/>[AuditLogger.php]"]
  node_fcm["Push Notifications<br/>[FcmService.php]"]
  node_database[("Application Database<br/>[Receipt.php]")]
  node_queue["Job Queue<br/>[ProcessOcrJob.php]"]
end

node_employee(("Employee"))
node_management(("Management"))
node_vision{{"Google Vision"}}
node_holiday_api{{"Holiday Data API"}}

node_employee -->|"uses"| node_mobile
node_management -->|"uses"| node_dashboard
node_mobile -->|"API requests"| node_api_routes
node_dashboard -->|"API requests"| node_api_routes
node_publicjobs -->|"recruitment requests"| node_api_routes
node_api_routes -->|"dispatches"| node_auth
node_api_routes -->|"dispatches"| node_receipts
node_api_routes -->|"dispatches"| node_invoices
node_api_routes -->|"dispatches"| node_attendance
node_api_routes -->|"dispatches"| node_shifts
node_api_routes -->|"dispatches"| node_recruitment
node_api_routes -->|"dispatches"| node_identity
node_receipts -->|"dispatches OCR"| node_queue
node_queue -->|"runs"| node_ocr_job
node_ocr_job -->|"requests extraction"| node_ocr_service
node_ocr_service -->|"uses driver"| node_ocr_drivers
node_ocr_drivers -.->|"sends image"| node_vision
node_receipts -->|"reads and writes"| node_database
node_invoices -->|"reads and writes"| node_database
node_attendance -->|"reads and writes"| node_database
node_shifts -->|"reads and writes"| node_database
node_identity -->|"reads and writes"| node_database
node_recruitment -->|"reads and writes"| node_database
node_receipts -->|"records activity"| node_audit
node_shifts -->|"records activity"| node_audit
node_attendance -->|"checks leave data"| node_leave
node_shifts -.->|"holiday synchronization"| node_holiday_api

click node_mobile "https://github.com/mozpet/expenseflow/tree/main/expenseflow-mobile"
click node_dashboard "https://github.com/mozpet/expenseflow/blob/main/expenseflow-web/src/App.tsx"
click node_publicjobs "https://github.com/mozpet/expenseflow/blob/main/expenseflow-public/js/jobs.js"
click node_api_routes "https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/routes/api.php"
click node_auth "https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Http/Controllers/API/AuthController.php"
click node_receipts "https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Http/Controllers/API/ReceiptController.php"
click node_ocr_job "https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Jobs/ProcessOcrJob.php"
click node_ocr_service "https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Services/OcrService.php"
click node_ocr_drivers "https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Services/Ocr/GoogleVisionDriver.php"
click node_invoices "https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Http/Controllers/API/InvoiceController.php"
click node_attendance "https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Http/Controllers/API/AttendanceController.php"
click node_shifts "https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Http/Controllers/API/ShiftController.php"
click node_leave "https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Models/LeaveRequest.php"
click node_recruitment "https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Http/Controllers/API/RecruitmentController.php"
click node_identity "https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Http/Controllers/API/UserController.php"
click node_audit "https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Services/AuditLogger.php"
click node_fcm "https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Services/FcmService.php"
click node_database "https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Models/Receipt.php"
click node_queue "https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Jobs/ProcessOcrJob.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_mobile,node_dashboard,node_publicjobs toneBlue
class node_api_routes,node_auth toneAmber
class node_receipts,node_ocr_job,node_ocr_service,node_ocr_drivers,node_invoices,node_holiday_api toneMint
class node_attendance,node_shifts,node_leave,node_recruitment toneRose
class node_identity,node_audit,node_fcm,node_database,node_queue,node_employee,node_management,node_vision toneIndigo
```

## Components

### User Clients

- [Employee App](https://github.com/mozpet/expenseflow/tree/main/expenseflow-mobile): `expenseflow-mobile`
- [Management Dashboard](https://github.com/mozpet/expenseflow/blob/main/expenseflow-web/src/App.tsx): `expenseflow-web/src/App.tsx`
- [Public Recruitment](https://github.com/mozpet/expenseflow/blob/main/expenseflow-public/js/jobs.js): `expenseflow-public/js/jobs.js`

### API Access

- [REST API Routes](https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/routes/api.php): `expenseflow-backend/routes/api.php`
- [Authentication](https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Http/Controllers/API/AuthController.php): `expenseflow-backend/app/Http/Controllers/API/AuthController.php`

### Expense Workflows

- [Receipt Claims](https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Http/Controllers/API/ReceiptController.php): `expenseflow-backend/app/Http/Controllers/API/ReceiptController.php`
- [OCR Queue Job](https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Jobs/ProcessOcrJob.php): `expenseflow-backend/app/Jobs/ProcessOcrJob.php`
- [OCR Service](https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Services/OcrService.php): `expenseflow-backend/app/Services/OcrService.php`
- [OCR Drivers](https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Services/Ocr/GoogleVisionDriver.php): `expenseflow-backend/app/Services/Ocr/GoogleVisionDriver.php`
- [Invoice Approvals](https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Http/Controllers/API/InvoiceController.php): `expenseflow-backend/app/Http/Controllers/API/InvoiceController.php`

### Workforce Operations

- [Attendance](https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Http/Controllers/API/AttendanceController.php): `expenseflow-backend/app/Http/Controllers/API/AttendanceController.php`
- [Shift Scheduling](https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Http/Controllers/API/ShiftController.php): `expenseflow-backend/app/Http/Controllers/API/ShiftController.php`
- [Leave And Overtime](https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Models/LeaveRequest.php): `expenseflow-backend/app/Models/LeaveRequest.php`
- [Recruitment Management](https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Http/Controllers/API/RecruitmentController.php): `expenseflow-backend/app/Http/Controllers/API/RecruitmentController.php`

### Shared Services

- [Users And Roles](https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Http/Controllers/API/UserController.php): `expenseflow-backend/app/Http/Controllers/API/UserController.php`
- [Audit Logging](https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Services/AuditLogger.php): `expenseflow-backend/app/Services/AuditLogger.php`
- [Push Notifications](https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Services/FcmService.php): `expenseflow-backend/app/Services/FcmService.php`
- [Application Database](https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Models/Receipt.php): `expenseflow-backend/app/Models/Receipt.php`
- [Job Queue](https://github.com/mozpet/expenseflow/blob/main/expenseflow-backend/app/Jobs/ProcessOcrJob.php): `expenseflow-backend/app/Jobs/ProcessOcrJob.php`

### Other components

- **Employee**
- **Management**
- **Google Vision**
- **Holiday Data API**

## Connections

- Employee → Employee App: uses
- Management → Management Dashboard: uses
- Employee App → REST API Routes: API requests
- Management Dashboard → REST API Routes: API requests
- Public Recruitment → REST API Routes: recruitment requests
- REST API Routes → Authentication: dispatches
- REST API Routes → Receipt Claims: dispatches
- REST API Routes → Invoice Approvals: dispatches
- REST API Routes → Attendance: dispatches
- REST API Routes → Shift Scheduling: dispatches
- REST API Routes → Recruitment Management: dispatches
- REST API Routes → Users And Roles: dispatches
- Receipt Claims → Job Queue: dispatches OCR
- Job Queue → OCR Queue Job: runs
- OCR Queue Job → OCR Service: requests extraction
- OCR Service → OCR Drivers: uses driver
- OCR Drivers → Google Vision: sends image
- Receipt Claims → Application Database: reads and writes
- Invoice Approvals → Application Database: reads and writes
- Attendance → Application Database: reads and writes
- Shift Scheduling → Application Database: reads and writes
- Users And Roles → Application Database: reads and writes
- Recruitment Management → Application Database: reads and writes
- Receipt Claims → Audit Logging: records activity
- Shift Scheduling → Audit Logging: records activity
- Attendance → Leave And Overtime: checks leave data
- Shift Scheduling → Holiday Data API: holiday synchronization
