# hotspotbilling/phpnuxbill architecture

> Architecture diagram of the GitHub repository hotspotbilling/phpnuxbill, 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/hotspotbilling/phpnuxbill
- Repository: https://github.com/hotspotbilling/phpnuxbill

## Overview

PHPNuxBill is a PHP/MikroTik hotspot and ISP billing application. Its main workflow is customer or administrator access, plan/order and payment handling, then service provisioning through router or FreeRADIUS integrations; vouchers and account balance support alternate access and renewal paths. The README documents these product capabilities, while sampled controller excerpts confirm ORM-backed plan/router management and device calls. Source excerpts are selective, so uncertain internal dispatch and notification wiring are not shown.

Main entry points: [`system/orm.php`](https://github.com/hotspotbilling/phpnuxbill/blob/master/system/orm.php) (ORM data access), [`system/controllers/services.php`](https://github.com/hotspotbilling/phpnuxbill/blob/master/system/controllers/services.php) (Plan management), [`index.php`](https://github.com/hotspotbilling/phpnuxbill/blob/master/index.php) (Web entry), [`system/devices/MikrotikHotspot.php`](https://github.com/hotspotbilling/phpnuxbill/blob/master/system/devices/MikrotikHotspot.php) (Hotspot device)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_entrypoint["Web entry<br/>[index.php]"]
  node_boot["Application boot<br/>[boot.php]"]
end

subgraph group_accounts["Accounts and sales"]
  node_login["Login and registration<br/>[login.php]"]
  node_accountsctl["Account management<br/>[accounts.php]"]
  node_plans["Plan management<br/>[services.php]"]
  node_orders["Order handling<br/>[order.php]"]
  node_payments["Payment gateways<br/>[paymentgateway.php]"]
  node_vouchers["Voucher management<br/>[voucher.php]"]
  node_balance["Balance features<br/>[Balance.php]"]
end

subgraph group_network["Service provisioning"]
  node_routers["Router management<br/>[routers.php]"]
  node_hotspot["Hotspot device"]
  node_pppoe["PPPoE device<br/>[MikrotikPppoe.php]"]
  node_vpn["VPN device<br/>[MikrotikVpn.php]"]
  node_radiusdevice["RADIUS device<br/>[Radius.php]"]
  node_radius["FreeRADIUS interface<br/>[radius.php]"]
end

subgraph group_operations["Billing operations"]
  node_data["ORM data access<br/>[orm.php]"]
  node_cron["Renewal and jobs<br/>[cron.php]"]
  node_reminders["Billing reminders<br/>[cron_reminder.php]"]
end

node_customer(("Customer"))
node_admin(("Administrator"))
node_mikrotik{{"MikroTik router"}}
node_database[("MySQL database")]

node_customer -->|"accesses"| node_entrypoint
node_admin -->|"manages"| node_entrypoint
node_entrypoint -->|"loads"| node_boot
node_boot -->|"dispatches"| node_login
node_login -->|"reads and writes"| node_data
node_accountsctl -->|"reads and writes"| node_data
node_plans -->|"reads and writes"| node_data
node_plans -->|"provisions plans"| node_hotspot
node_plans -->|"provisions plans"| node_pppoe
node_plans -->|"provisions plans"| node_vpn
node_orders -->|"reads and writes"| node_data
node_orders -->|"handles payment"| node_payments
node_vouchers -->|"reads and writes"| node_data
node_balance -->|"uses account data"| node_data
node_routers -->|"reads and writes"| node_data
node_routers -->|"tests connection"| node_hotspot
node_hotspot -.->|"controls"| node_mikrotik
node_pppoe -.->|"controls"| node_mikrotik
node_vpn -.->|"controls"| node_mikrotik
node_radiusdevice -.->|"uses"| node_radius
node_radius -.->|"serves authentication"| node_database
node_data -->|"queries"| node_database
node_cron -.->|"renews from balance"| node_balance
node_reminders -->|"reads billing data"| node_data

click node_entrypoint "https://github.com/hotspotbilling/phpnuxbill/blob/master/index.php"
click node_boot "https://github.com/hotspotbilling/phpnuxbill/blob/master/system/boot.php"
click node_login "https://github.com/hotspotbilling/phpnuxbill/blob/master/system/controllers/login.php"
click node_accountsctl "https://github.com/hotspotbilling/phpnuxbill/blob/master/system/controllers/accounts.php"
click node_plans "https://github.com/hotspotbilling/phpnuxbill/blob/master/system/controllers/services.php"
click node_orders "https://github.com/hotspotbilling/phpnuxbill/blob/master/system/controllers/order.php"
click node_payments "https://github.com/hotspotbilling/phpnuxbill/blob/master/system/controllers/paymentgateway.php"
click node_vouchers "https://github.com/hotspotbilling/phpnuxbill/blob/master/system/controllers/voucher.php"
click node_balance "https://github.com/hotspotbilling/phpnuxbill/blob/master/system/autoload/Balance.php"
click node_routers "https://github.com/hotspotbilling/phpnuxbill/blob/master/system/controllers/routers.php"
click node_hotspot "https://github.com/hotspotbilling/phpnuxbill/blob/master/system/devices/MikrotikHotspot.php"
click node_pppoe "https://github.com/hotspotbilling/phpnuxbill/blob/master/system/devices/MikrotikPppoe.php"
click node_vpn "https://github.com/hotspotbilling/phpnuxbill/blob/master/system/devices/MikrotikVpn.php"
click node_radiusdevice "https://github.com/hotspotbilling/phpnuxbill/blob/master/system/devices/Radius.php"
click node_radius "https://github.com/hotspotbilling/phpnuxbill/blob/master/radius.php"
click node_data "https://github.com/hotspotbilling/phpnuxbill/blob/master/system/orm.php"
click node_cron "https://github.com/hotspotbilling/phpnuxbill/blob/master/system/cron.php"
click node_reminders "https://github.com/hotspotbilling/phpnuxbill/blob/master/system/cron_reminder.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_entrypoint,node_boot toneBlue
class node_login,node_accountsctl,node_plans,node_orders,node_payments,node_vouchers,node_balance,node_database toneAmber
class node_routers,node_hotspot,node_pppoe,node_vpn,node_radiusdevice,node_radius,node_mikrotik toneMint
class node_data,node_cron,node_reminders toneRose
class node_customer,node_admin toneIndigo
```

## Components

### Application entry

- [Web entry](https://github.com/hotspotbilling/phpnuxbill/blob/master/index.php): `index.php`
- [Application boot](https://github.com/hotspotbilling/phpnuxbill/blob/master/system/boot.php): `system/boot.php`

### Accounts and sales

- [Login and registration](https://github.com/hotspotbilling/phpnuxbill/blob/master/system/controllers/login.php): `system/controllers/login.php`
- [Account management](https://github.com/hotspotbilling/phpnuxbill/blob/master/system/controllers/accounts.php): `system/controllers/accounts.php`
- [Plan management](https://github.com/hotspotbilling/phpnuxbill/blob/master/system/controllers/services.php): `system/controllers/services.php`
- [Order handling](https://github.com/hotspotbilling/phpnuxbill/blob/master/system/controllers/order.php): `system/controllers/order.php`
- [Payment gateways](https://github.com/hotspotbilling/phpnuxbill/blob/master/system/controllers/paymentgateway.php): `system/controllers/paymentgateway.php`
- [Voucher management](https://github.com/hotspotbilling/phpnuxbill/blob/master/system/controllers/voucher.php): `system/controllers/voucher.php`
- [Balance features](https://github.com/hotspotbilling/phpnuxbill/blob/master/system/autoload/Balance.php): `system/autoload/Balance.php`

### Service provisioning

- [Router management](https://github.com/hotspotbilling/phpnuxbill/blob/master/system/controllers/routers.php): `system/controllers/routers.php`
- [Hotspot device](https://github.com/hotspotbilling/phpnuxbill/blob/master/system/devices/MikrotikHotspot.php): `system/devices/MikrotikHotspot.php`
- [PPPoE device](https://github.com/hotspotbilling/phpnuxbill/blob/master/system/devices/MikrotikPppoe.php): `system/devices/MikrotikPppoe.php`
- [VPN device](https://github.com/hotspotbilling/phpnuxbill/blob/master/system/devices/MikrotikVpn.php): `system/devices/MikrotikVpn.php`
- [RADIUS device](https://github.com/hotspotbilling/phpnuxbill/blob/master/system/devices/Radius.php): `system/devices/Radius.php`
- [FreeRADIUS interface](https://github.com/hotspotbilling/phpnuxbill/blob/master/radius.php): `radius.php`

### Billing operations

- [ORM data access](https://github.com/hotspotbilling/phpnuxbill/blob/master/system/orm.php): `system/orm.php`
- [Renewal and jobs](https://github.com/hotspotbilling/phpnuxbill/blob/master/system/cron.php): `system/cron.php`
- [Billing reminders](https://github.com/hotspotbilling/phpnuxbill/blob/master/system/cron_reminder.php): `system/cron_reminder.php`

### Other components

- **Customer**
- **Administrator**
- **MikroTik router**
- **MySQL database**

## Connections

- Customer → Web entry: accesses
- Administrator → Web entry: manages
- Web entry → Application boot: loads
- Application boot → Login and registration: dispatches
- Login and registration → ORM data access: reads and writes
- Account management → ORM data access: reads and writes
- Plan management → ORM data access: reads and writes
- Plan management → Hotspot device: provisions plans
- Plan management → PPPoE device: provisions plans
- Plan management → VPN device: provisions plans
- Order handling → ORM data access: reads and writes
- Order handling → Payment gateways: handles payment
- Voucher management → ORM data access: reads and writes
- Balance features → ORM data access: uses account data
- Router management → ORM data access: reads and writes
- Router management → Hotspot device: tests connection
- Hotspot device → MikroTik router: controls
- PPPoE device → MikroTik router: controls
- VPN device → MikroTik router: controls
- RADIUS device → FreeRADIUS interface: uses
- FreeRADIUS interface → MySQL database: serves authentication
- ORM data access → MySQL database: queries
- Renewal and jobs → Balance features: renews from balance
- Billing reminders → ORM data access: reads billing data
