# techontz/voucher-flow architecture

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

- Interactive diagram: https://gitdiagram.com/techontz/voucher-flow
- Repository: https://github.com/techontz/voucher-flow

## Overview

VouchFlow is a multi-tenant voucher-approval SaaS. Employees create and submit vouchers; configurable approval steps handle review, signing, approval or rejection, followed by separate cashier payment. Users then access dashboards and permission-aware reports, while company administrators manage workflows, branding and tenant operations. Web and Flutter clients share the Laravel API and database. The graph includes documented product branches whose implementation was not sampled; those links are evidenced by the README rather than implying unsampled code was inspected.

Main entry points: [`backend/routes/api.php`](https://github.com/techontz/voucher-flow/blob/main/backend/routes/api.php) (Laravel REST API), [`backend/app/Models/Voucher.php`](https://github.com/techontz/voucher-flow/blob/main/backend/app/Models/Voucher.php) (Voucher records), [`backend/app/Services/WorkflowEngine.php`](https://github.com/techontz/voucher-flow/blob/main/backend/app/Services/WorkflowEngine.php) (Workflow engine), [`backend/app/Http/Controllers/Api/DashboardController.php`](https://github.com/techontz/voucher-flow/blob/main/backend/app/Http/Controllers/Api/DashboardController.php) (Action queues)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Client applications"]
  node_web["Web client"]
  node_mobile["Mobile client"]
end

subgraph group_api["API and access"]
  node_api_entry["Laravel REST API<br/>[api.php]"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_tenant["Tenant isolation<br/>[ResolveTenant.php]"]
end

subgraph group_voucher["Voucher operations"]
  node_vouchers[("Voucher records<br/>[Voucher.php]")]
  node_workflow["Workflow engine<br/>[WorkflowEngine.php]"]
  node_workflow_config["Workflow configuration<br/>[WorkflowStep.php]"]
  node_dashboard["Action queues"]
  node_reports["Reports and exports"]
  node_documents["Voucher documents"]
end

subgraph group_platform["Tenant platform"]
  node_billing["Payment and billing"]
  node_branding["Company branding"]
  node_admin["Platform operations"]
  node_notifications["Notifications<br/>[Notifier.php]"]
  node_audit["Audit history<br/>[AuditLogger.php]"]
  node_database[("MySQL")]
end

node_employee(("Company users"))

node_employee -->|"uses"| node_web
node_employee -->|"uses"| node_mobile
node_web -->|"calls"| node_api_entry
node_mobile -->|"calls"| node_api_entry
node_api_entry -.->|"routes"| node_auth
node_api_entry -->|"resolves tenant"| node_tenant
node_api_entry -->|"serves voucher API"| node_vouchers
node_workflow -->|"updates"| node_vouchers
node_workflow -->|"reads steps"| node_workflow_config
node_dashboard -->|"checks actions"| node_workflow
node_dashboard -->|"queries queues"| node_vouchers
node_reports -->|"reports on"| node_vouchers
node_vouchers -.->|"renders PDF"| node_documents
node_api_entry -->|"serves billing API"| node_billing
node_admin -.->|"manages branding"| node_branding
node_api_entry -->|"serves platform API"| node_admin
node_api_entry -->|"persists records"| node_database
node_workflow -->|"notifies users"| node_notifications
node_workflow -->|"records actions"| node_audit
node_billing -.->|"stores billing"| node_database
node_reports -->|"exports reports"| node_documents
node_vouchers -->|"uses tenant identity"| node_branding

click node_web "https://github.com/techontz/voucher-flow/tree/main/web/app"
click node_mobile "https://github.com/techontz/voucher-flow/tree/main/app"
click node_api_entry "https://github.com/techontz/voucher-flow/blob/main/backend/routes/api.php"
click node_auth "https://github.com/techontz/voucher-flow/blob/main/backend/app/Http/Controllers/Api/AuthController.php"
click node_tenant "https://github.com/techontz/voucher-flow/blob/main/backend/app/Http/Middleware/ResolveTenant.php"
click node_vouchers "https://github.com/techontz/voucher-flow/blob/main/backend/app/Models/Voucher.php"
click node_workflow "https://github.com/techontz/voucher-flow/blob/main/backend/app/Services/WorkflowEngine.php"
click node_workflow_config "https://github.com/techontz/voucher-flow/blob/main/backend/app/Models/WorkflowStep.php"
click node_dashboard "https://github.com/techontz/voucher-flow/blob/main/backend/app/Http/Controllers/Api/DashboardController.php"
click node_reports "https://github.com/techontz/voucher-flow/blob/main/backend/app/Http/Controllers/Api/ReportController.php"
click node_documents "https://github.com/techontz/voucher-flow/blob/main/backend/app/Services/VoucherPdfService.php"
click node_billing "https://github.com/techontz/voucher-flow/blob/main/backend/app/Http/Controllers/Api/BillingController.php"
click node_branding "https://github.com/techontz/voucher-flow/blob/main/backend/app/Services/CompanyBranding.php"
click node_admin "https://github.com/techontz/voucher-flow/blob/main/backend/app/Http/Controllers/Api/Platform/CompanyController.php"
click node_notifications "https://github.com/techontz/voucher-flow/blob/main/backend/app/Services/Notifier.php"
click node_audit "https://github.com/techontz/voucher-flow/blob/main/backend/app/Services/AuditLogger.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_mobile,node_employee toneBlue
class node_api_entry,node_auth,node_tenant toneAmber
class node_vouchers,node_workflow,node_workflow_config,node_dashboard,node_reports,node_documents toneMint
class node_billing,node_branding,node_admin,node_notifications,node_audit,node_database toneRose
```

## Components

### Client applications

- [Web client](https://github.com/techontz/voucher-flow/tree/main/web/app): `web/app`
- [Mobile client](https://github.com/techontz/voucher-flow/tree/main/app): `app`

### API and access

- [Laravel REST API](https://github.com/techontz/voucher-flow/blob/main/backend/routes/api.php): `backend/routes/api.php`
- [Authentication](https://github.com/techontz/voucher-flow/blob/main/backend/app/Http/Controllers/Api/AuthController.php): `backend/app/Http/Controllers/Api/AuthController.php`
- [Tenant isolation](https://github.com/techontz/voucher-flow/blob/main/backend/app/Http/Middleware/ResolveTenant.php): `backend/app/Http/Middleware/ResolveTenant.php`

### Voucher operations

- [Voucher records](https://github.com/techontz/voucher-flow/blob/main/backend/app/Models/Voucher.php): `backend/app/Models/Voucher.php`
- [Workflow engine](https://github.com/techontz/voucher-flow/blob/main/backend/app/Services/WorkflowEngine.php): `backend/app/Services/WorkflowEngine.php`
- [Workflow configuration](https://github.com/techontz/voucher-flow/blob/main/backend/app/Models/WorkflowStep.php): `backend/app/Models/WorkflowStep.php`
- [Action queues](https://github.com/techontz/voucher-flow/blob/main/backend/app/Http/Controllers/Api/DashboardController.php): `backend/app/Http/Controllers/Api/DashboardController.php`
- [Reports and exports](https://github.com/techontz/voucher-flow/blob/main/backend/app/Http/Controllers/Api/ReportController.php): `backend/app/Http/Controllers/Api/ReportController.php`
- [Voucher documents](https://github.com/techontz/voucher-flow/blob/main/backend/app/Services/VoucherPdfService.php): `backend/app/Services/VoucherPdfService.php`

### Tenant platform

- [Payment and billing](https://github.com/techontz/voucher-flow/blob/main/backend/app/Http/Controllers/Api/BillingController.php): `backend/app/Http/Controllers/Api/BillingController.php`
- [Company branding](https://github.com/techontz/voucher-flow/blob/main/backend/app/Services/CompanyBranding.php): `backend/app/Services/CompanyBranding.php`
- [Platform operations](https://github.com/techontz/voucher-flow/blob/main/backend/app/Http/Controllers/Api/Platform/CompanyController.php): `backend/app/Http/Controllers/Api/Platform/CompanyController.php`
- [Notifications](https://github.com/techontz/voucher-flow/blob/main/backend/app/Services/Notifier.php): `backend/app/Services/Notifier.php`
- [Audit history](https://github.com/techontz/voucher-flow/blob/main/backend/app/Services/AuditLogger.php): `backend/app/Services/AuditLogger.php`
- **MySQL**

### Other components

- **Company users**

## Connections

- Company users → Web client: uses
- Company users → Mobile client: uses
- Web client → Laravel REST API: calls
- Mobile client → Laravel REST API: calls
- Laravel REST API → Authentication: routes
- Laravel REST API → Tenant isolation: resolves tenant
- Laravel REST API → Voucher records: serves voucher API
- Workflow engine → Voucher records: updates (evidence: `backend/app/Services/WorkflowEngine.php`)
- Workflow engine → Workflow configuration: reads steps (evidence: `backend/app/Services/WorkflowEngine.php`)
- Action queues → Workflow engine: checks actions (evidence: `backend/app/Http/Controllers/Api/DashboardController.php`)
- Action queues → Voucher records: queries queues (evidence: `backend/app/Http/Controllers/Api/DashboardController.php`)
- Reports and exports → Voucher records: reports on (evidence: `backend/app/Http/Controllers/Api/ReportController.php`)
- Voucher records → Voucher documents: renders PDF
- Laravel REST API → Payment and billing: serves billing API
- Platform operations → Company branding: manages branding (evidence: `backend/app/Http/Controllers/Api/Platform/CompanyController.php`)
- Laravel REST API → Platform operations: serves platform API
- Laravel REST API → MySQL: persists records
- Workflow engine → Notifications: notifies users (evidence: `backend/app/Services/WorkflowEngine.php`)
- Workflow engine → Audit history: records actions (evidence: `backend/app/Services/WorkflowEngine.php`)
- Payment and billing → MySQL: stores billing
- Reports and exports → Voucher documents: exports reports
- Voucher records → Company branding: uses tenant identity
