# tiarh/isp-billing-platform architecture

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

- Interactive diagram: https://gitdiagram.com/tiarh/isp-billing-platform
- Repository: https://github.com/tiarh/isp-billing-platform

## Overview

This is a Laravel ISP billing and operations platform. Admins and customers use web workflows to manage subscribers, installations, billing, and network operations; automated jobs and external gateways, routers, OLTs, and TR-069 devices support those workflows. The graph preserves the README’s major capabilities and the indexed core domain models. Some subsystem internals were not sampled, so documented relationships cite the README; edges between unsampled components are omitted rather than inferred.

Main entry points: [`app/Services/PsbOrchestratorService.php`](https://github.com/tiarh/isp-billing-platform/blob/main/app/Services/PsbOrchestratorService.php) (Installation workflow), [`app/Http/Controllers/CustomerController.php`](https://github.com/tiarh/isp-billing-platform/blob/main/app/Http/Controllers/CustomerController.php) (Customer management), [`app/Models/Customer.php`](https://github.com/tiarh/isp-billing-platform/blob/main/app/Models/Customer.php) (Subscriber records), [`app/Models/Invoice.php`](https://github.com/tiarh/isp-billing-platform/blob/main/app/Models/Invoice.php) (Invoices)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_billing["Customers and billing"]
  node_customer_web["Customer management"]
  node_customer_model[("Subscriber records<br/>[Customer.php]")]
  node_package_model[("Service packages<br/>[Package.php]")]
  node_invoice_web["Invoice workflows"]
  node_invoice_model[("Invoices<br/>[Invoice.php]")]
  node_billing_run["Invoice generation"]
  node_payment_web["Payment workflows"]
  node_gateway_manager["Gateway integration"]
  node_wa_service["WhatsApp notifications"]
end

subgraph group_install["New installations"]
  node_psb_web["Installation intake"]
  node_psb_orchestrator["Installation workflow"]
  node_psb_ocr["Photo OCR<br/>[PsbOcrEngine.php]"]
  node_psb_draft[("Installation drafts<br/>[PsbDraft.php]")]
end

subgraph group_network["Network operations"]
  node_router_ops["Router management"]
  node_router_model[("Router inventory<br/>[Router.php]")]
  node_olt_ops["OLT and ONU management"]
  node_olt_model[("OLT inventory<br/>[Olt.php]")]
  node_tr069["TR-069 device management"]
end

subgraph group_support["Monitoring and support"]
  node_monitoring["Monitoring and outages"]
  node_ticket_ops["Field ticket workflows"]
  node_ticket_model[("Support tickets<br/>[SupportTicket.php]")]
end

subgraph group_admin["Administration and access"]
  node_user_model[("Users and roles<br/>[User.php]")]
  node_auth["Authentication and 2FA<br/>[TotpController.php]"]
  node_settings[("Platform settings<br/>[Setting.php]")]
end

node_admin_actor(("Admin or operator"))
node_customer_actor(("Customer"))
node_payment_gateway{{"Payment gateway"}}
node_mysql[("MySQL")]

node_customer_actor -->|"manages account"| node_customer_web
node_admin_actor -->|"manages subscribers"| node_customer_web
node_customer_web -->|"updates records"| node_customer_model
node_customer_web -->|"assigns packages"| node_package_model
node_admin_actor -->|"runs billing"| node_billing_run
node_billing_run -->|"generates invoices"| node_invoice_model
node_customer_actor -->|"views invoices"| node_invoice_web
node_invoice_web -->|"serves invoices"| node_invoice_model
node_customer_actor -->|"pays invoice"| node_payment_web
node_payment_web -->|"handles payment"| node_gateway_manager
node_gateway_manager -->|"connects gateway"| node_payment_gateway
node_admin_actor -->|"sends notices"| node_wa_service
node_admin_actor -->|"handles installation"| node_psb_web
node_psb_web -->|"advances workflow"| node_psb_orchestrator
node_psb_orchestrator -->|"classifies photos"| node_psb_ocr
node_psb_orchestrator -->|"updates draft"| node_psb_draft
node_psb_orchestrator -->|"activates subscriber"| node_customer_model
node_psb_orchestrator -->|"configures PPPoE"| node_router_model
node_psb_orchestrator -->|"provisions access"| node_olt_model
node_admin_actor -->|"manages routers"| node_router_ops
node_router_ops -->|"manages inventory"| node_router_model
node_admin_actor -->|"manages OLTs"| node_olt_ops
node_olt_ops -->|"manages inventory"| node_olt_model
node_admin_actor -->|"manages devices"| node_tr069
node_admin_actor -->|"reviews network health"| node_monitoring
node_monitoring -->|"supports field response"| node_ticket_ops
node_admin_actor -->|"manages tickets"| node_ticket_ops
node_ticket_ops -->|"updates tickets"| node_ticket_model
node_admin_actor -->|"signs in"| node_auth
node_auth -->|"verifies user"| node_user_model
node_admin_actor -->|"configures platform"| node_settings
node_customer_model -->|"persists data"| node_mysql
node_invoice_model -->|"persists data"| node_mysql
node_psb_draft -->|"persists data"| node_mysql
node_router_model -->|"persists data"| node_mysql
node_olt_model -->|"persists data"| node_mysql
node_ticket_model -->|"persists data"| node_mysql
node_user_model -->|"persists data"| node_mysql
node_settings -->|"persists data"| node_mysql

click node_customer_web "https://github.com/tiarh/isp-billing-platform/blob/main/app/Http/Controllers/CustomerController.php"
click node_customer_model "https://github.com/tiarh/isp-billing-platform/blob/main/app/Models/Customer.php"
click node_package_model "https://github.com/tiarh/isp-billing-platform/blob/main/app/Models/Package.php"
click node_invoice_web "https://github.com/tiarh/isp-billing-platform/blob/main/app/Http/Controllers/InvoiceController.php"
click node_invoice_model "https://github.com/tiarh/isp-billing-platform/blob/main/app/Models/Invoice.php"
click node_billing_run "https://github.com/tiarh/isp-billing-platform/blob/main/app/Services/InvoiceGenerationService.php"
click node_payment_web "https://github.com/tiarh/isp-billing-platform/blob/main/app/Http/Controllers/PaymentController.php"
click node_gateway_manager "https://github.com/tiarh/isp-billing-platform/blob/main/app/Services/PaymentGateway/PaymentGatewayManager.php"
click node_wa_service "https://github.com/tiarh/isp-billing-platform/blob/main/app/Services/EvolutionApiService.php"
click node_psb_web "https://github.com/tiarh/isp-billing-platform/blob/main/app/Http/Controllers/PsbDraftController.php"
click node_psb_orchestrator "https://github.com/tiarh/isp-billing-platform/blob/main/app/Services/PsbOrchestratorService.php"
click node_psb_ocr "https://github.com/tiarh/isp-billing-platform/blob/main/app/Services/Psb/PsbOcrEngine.php"
click node_psb_draft "https://github.com/tiarh/isp-billing-platform/blob/main/app/Models/PsbDraft.php"
click node_router_ops "https://github.com/tiarh/isp-billing-platform/blob/main/app/Http/Controllers/RouterController.php"
click node_router_model "https://github.com/tiarh/isp-billing-platform/blob/main/app/Models/Router.php"
click node_olt_ops "https://github.com/tiarh/isp-billing-platform/blob/main/app/Http/Controllers/OltC300Controller.php"
click node_olt_model "https://github.com/tiarh/isp-billing-platform/blob/main/app/Models/Olt.php"
click node_tr069 "https://github.com/tiarh/isp-billing-platform/blob/main/app/Services/GenieAcsService.php"
click node_monitoring "https://github.com/tiarh/isp-billing-platform/blob/main/app/Http/Controllers/MonitoringController.php"
click node_ticket_ops "https://github.com/tiarh/isp-billing-platform/blob/main/app/Http/Controllers/TicketController.php"
click node_ticket_model "https://github.com/tiarh/isp-billing-platform/blob/main/app/Models/SupportTicket.php"
click node_user_model "https://github.com/tiarh/isp-billing-platform/blob/main/app/Models/User.php"
click node_auth "https://github.com/tiarh/isp-billing-platform/blob/main/app/Http/Controllers/Auth/TotpController.php"
click node_settings "https://github.com/tiarh/isp-billing-platform/blob/main/app/Models/Setting.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_customer_web,node_customer_model,node_package_model,node_invoice_web,node_invoice_model,node_billing_run,node_payment_web,node_gateway_manager,node_wa_service toneBlue
class node_psb_web,node_psb_orchestrator,node_psb_ocr,node_psb_draft,node_mysql toneAmber
class node_router_ops,node_router_model,node_olt_ops,node_olt_model,node_tr069 toneMint
class node_monitoring,node_ticket_ops,node_ticket_model toneRose
class node_user_model,node_auth,node_settings,node_admin_actor,node_customer_actor,node_payment_gateway toneIndigo
```

## Components

### Customers and billing

- [Customer management](https://github.com/tiarh/isp-billing-platform/blob/main/app/Http/Controllers/CustomerController.php): `app/Http/Controllers/CustomerController.php`
- [Subscriber records](https://github.com/tiarh/isp-billing-platform/blob/main/app/Models/Customer.php): `app/Models/Customer.php`
- [Service packages](https://github.com/tiarh/isp-billing-platform/blob/main/app/Models/Package.php): `app/Models/Package.php`
- [Invoice workflows](https://github.com/tiarh/isp-billing-platform/blob/main/app/Http/Controllers/InvoiceController.php): `app/Http/Controllers/InvoiceController.php`
- [Invoices](https://github.com/tiarh/isp-billing-platform/blob/main/app/Models/Invoice.php): `app/Models/Invoice.php`
- [Invoice generation](https://github.com/tiarh/isp-billing-platform/blob/main/app/Services/InvoiceGenerationService.php): `app/Services/InvoiceGenerationService.php`
- [Payment workflows](https://github.com/tiarh/isp-billing-platform/blob/main/app/Http/Controllers/PaymentController.php): `app/Http/Controllers/PaymentController.php`
- [Gateway integration](https://github.com/tiarh/isp-billing-platform/blob/main/app/Services/PaymentGateway/PaymentGatewayManager.php): `app/Services/PaymentGateway/PaymentGatewayManager.php`
- [WhatsApp notifications](https://github.com/tiarh/isp-billing-platform/blob/main/app/Services/EvolutionApiService.php): `app/Services/EvolutionApiService.php`

### New installations

- [Installation intake](https://github.com/tiarh/isp-billing-platform/blob/main/app/Http/Controllers/PsbDraftController.php): `app/Http/Controllers/PsbDraftController.php`
- [Installation workflow](https://github.com/tiarh/isp-billing-platform/blob/main/app/Services/PsbOrchestratorService.php): `app/Services/PsbOrchestratorService.php`
- [Photo OCR](https://github.com/tiarh/isp-billing-platform/blob/main/app/Services/Psb/PsbOcrEngine.php): `app/Services/Psb/PsbOcrEngine.php`
- [Installation drafts](https://github.com/tiarh/isp-billing-platform/blob/main/app/Models/PsbDraft.php): `app/Models/PsbDraft.php`

### Network operations

- [Router management](https://github.com/tiarh/isp-billing-platform/blob/main/app/Http/Controllers/RouterController.php): `app/Http/Controllers/RouterController.php`
- [Router inventory](https://github.com/tiarh/isp-billing-platform/blob/main/app/Models/Router.php): `app/Models/Router.php`
- [OLT and ONU management](https://github.com/tiarh/isp-billing-platform/blob/main/app/Http/Controllers/OltC300Controller.php): `app/Http/Controllers/OltC300Controller.php`
- [OLT inventory](https://github.com/tiarh/isp-billing-platform/blob/main/app/Models/Olt.php): `app/Models/Olt.php`
- [TR-069 device management](https://github.com/tiarh/isp-billing-platform/blob/main/app/Services/GenieAcsService.php): `app/Services/GenieAcsService.php`

### Monitoring and support

- [Monitoring and outages](https://github.com/tiarh/isp-billing-platform/blob/main/app/Http/Controllers/MonitoringController.php): `app/Http/Controllers/MonitoringController.php`
- [Field ticket workflows](https://github.com/tiarh/isp-billing-platform/blob/main/app/Http/Controllers/TicketController.php): `app/Http/Controllers/TicketController.php`
- [Support tickets](https://github.com/tiarh/isp-billing-platform/blob/main/app/Models/SupportTicket.php): `app/Models/SupportTicket.php`

### Administration and access

- [Users and roles](https://github.com/tiarh/isp-billing-platform/blob/main/app/Models/User.php): `app/Models/User.php`
- [Authentication and 2FA](https://github.com/tiarh/isp-billing-platform/blob/main/app/Http/Controllers/Auth/TotpController.php): `app/Http/Controllers/Auth/TotpController.php`
- [Platform settings](https://github.com/tiarh/isp-billing-platform/blob/main/app/Models/Setting.php): `app/Models/Setting.php`

### Other components

- **Admin or operator**
- **Customer**
- **Payment gateway**
- **MySQL**

## Connections

- Customer → Customer management: manages account (evidence: `README.md`)
- Admin or operator → Customer management: manages subscribers (evidence: `README.md`)
- Customer management → Subscriber records: updates records (evidence: `README.md`)
- Customer management → Service packages: assigns packages (evidence: `README.md`)
- Admin or operator → Invoice generation: runs billing (evidence: `README.md`)
- Invoice generation → Invoices: generates invoices (evidence: `README.md`)
- Customer → Invoice workflows: views invoices (evidence: `README.md`)
- Invoice workflows → Invoices: serves invoices (evidence: `README.md`)
- Customer → Payment workflows: pays invoice (evidence: `README.md`)
- Payment workflows → Gateway integration: handles payment (evidence: `README.md`)
- Gateway integration → Payment gateway: connects gateway (evidence: `README.md`)
- Admin or operator → WhatsApp notifications: sends notices (evidence: `README.md`)
- Admin or operator → Installation intake: handles installation (evidence: `README.md`)
- Installation intake → Installation workflow: advances workflow (evidence: `app/Services/PsbOrchestratorService.php`)
- Installation workflow → Photo OCR: classifies photos (evidence: `app/Services/PsbOrchestratorService.php`)
- Installation workflow → Installation drafts: updates draft (evidence: `app/Services/PsbOrchestratorService.php`)
- Installation workflow → Subscriber records: activates subscriber (evidence: `README.md`)
- Installation workflow → Router inventory: configures PPPoE (evidence: `README.md`)
- Installation workflow → OLT inventory: provisions access (evidence: `README.md`)
- Admin or operator → Router management: manages routers (evidence: `README.md`)
- Router management → Router inventory: manages inventory (evidence: `README.md`)
- Admin or operator → OLT and ONU management: manages OLTs (evidence: `README.md`)
- OLT and ONU management → OLT inventory: manages inventory (evidence: `README.md`)
- Admin or operator → TR-069 device management: manages devices (evidence: `README.md`)
- Admin or operator → Monitoring and outages: reviews network health (evidence: `README.md`)
- Monitoring and outages → Field ticket workflows: supports field response (evidence: `README.md`)
- Admin or operator → Field ticket workflows: manages tickets (evidence: `README.md`)
- Field ticket workflows → Support tickets: updates tickets (evidence: `README.md`)
- Admin or operator → Authentication and 2FA: signs in (evidence: `README.md`)
- Authentication and 2FA → Users and roles: verifies user (evidence: `app/Http/Controllers/Auth/TotpController.php`)
- Admin or operator → Platform settings: configures platform (evidence: `README.md`)
- Subscriber records → MySQL: persists data (evidence: `README.md`)
- Invoices → MySQL: persists data (evidence: `README.md`)
- Installation drafts → MySQL: persists data (evidence: `README.md`)
- Router inventory → MySQL: persists data (evidence: `README.md`)
- OLT inventory → MySQL: persists data (evidence: `README.md`)
- Support tickets → MySQL: persists data (evidence: `README.md`)
- Users and roles → MySQL: persists data (evidence: `README.md`)
- Platform settings → MySQL: persists data (evidence: `README.md`)
