# veno77/raisepon-2.0 architecture

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

- Interactive diagram: https://gitdiagram.com/veno77/raisepon-2.0
- Repository: https://github.com/veno77/raisepon-2.0

## Overview

RAISEPON is a PHP/MySQL management console and API for Raisecom GPON/GEPON OLTs and ONUs. Operators manage OLT/PON inventory, subscribers, service profiles and IP pools; the console uses SNMP for device status and provisioning, while scheduled jobs synchronize ONUs, collect graph data and back up configurations. The API exposes JWT-authenticated customer and service operations. The principal page and several domain classes are evidenced by excerpts or the source index; other documented capabilities are represented at their existing paths, with unverified wiring omitted.

Main entry points: [`classes/customers_class.php`](https://github.com/veno77/raisepon-2.0/blob/master/classes/customers_class.php) (Customer records), [`index.php`](https://github.com/veno77/raisepon-2.0/blob/master/index.php) (ONU dashboard), [`API/libs/php-jwt-master/src/JWT.php`](https://github.com/veno77/raisepon-2.0/blob/master/API/libs/php-jwt-master/src/JWT.php) (JWT encode and decode), [`classes/db_connect_class.php`](https://github.com/veno77/raisepon-2.0/blob/master/classes/db_connect_class.php) (Database connection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Web console"]
  node_dashboard["ONU dashboard<br/>[index.php]"]
  node_webshell["Session and navigation<br/>[common.php]"]
  node_oltadmin["OLT management<br/>[olt.php]"]
  node_ponadmin["PON management<br/>[pon.php]"]
end

subgraph group_domain["Subscriber domain"]
  node_customerdata["Customer records"]
  node_services["Service catalog<br/>[services_class.php]"]
  node_lineprofiles["Line profiles"]
  node_serviceprofiles["Service profiles"]
  node_ippool["IP pools<br/>[ip_pool_class.php]"]
  node_dbaccess["Database connection"]
end

subgraph group_device["OLT integration"]
  node_snmpoids["SNMP OIDs<br/>[snmp_class.php]"]
end

subgraph group_operations["Operations and API"]
  node_sync["ONU synchronization<br/>[update_data.php]"]
  node_autoassign["Automatic registration<br/>[update_auto.php]"]
  node_rrdcollect["Graph collection<br/>[update_rrd.php]"]
  node_graphs["Network graphs<br/>[graphs.php]"]
  node_backupjob["Backup job<br/>[update_backup.php]"]
  node_backups["Backup management<br/>[backup_class.php]"]
  node_api["Customer API<br/>[get_customers.php]"]
  node_apiwrite["Customer API writes"]
  node_servicesapi["Service API<br/>[get_services.php]"]
end

subgraph group_authlib["JWT library"]
  node_jwtconfig["JWT settings<br/>[core.php]"]
  node_jwt["JWT encode and decode<br/>[JWT.php]"]
  node_beforevalid["Before-valid exception"]
  node_expired["Expired exception"]
  node_signature["Signature exception"]
end

node_operator(("Operator"))
node_mysql[("Raisepon database")]
node_oltdevice{{"Raisecom OLTs"}}

node_operator -->|"views"| node_dashboard
node_dashboard -->|"loads session"| node_webshell
node_dashboard -->|"deletes customers"| node_customerdata
node_dashboard -->|"looks up OIDs"| node_snmpoids
node_dashboard -->|"queries status"| node_oltdevice
node_oltadmin -.->|"manages OLTs"| node_oltdevice
node_ponadmin -.->|"manages ports"| node_oltdevice
node_customerdata -->|"uses connection"| node_dbaccess
node_customerdata -->|"uses OIDs"| node_snmpoids
node_services -->|"queries database"| node_dbaccess
node_services -->|"edits customers"| node_customerdata
node_serviceprofiles -->|"queries database"| node_dbaccess
node_dbaccess -->|"connects to"| node_mysql
node_ippool -->|"uses connection"| node_dbaccess
node_ippool -->|"checks customers"| node_customerdata
node_sync -->|"uses subscriber logic"| node_customerdata
node_sync -->|"uses OIDs"| node_snmpoids
node_sync -.->|"synchronizes ONUs"| node_oltdevice
node_autoassign -.->|"uses subscriber logic"| node_customerdata
node_autoassign -.->|"detects illegal ONUs"| node_oltdevice
node_rrdcollect -->|"uses subscriber data"| node_customerdata
node_rrdcollect -->|"uses OIDs"| node_snmpoids
node_rrdcollect -.->|"collects metrics"| node_oltdevice
node_graphs -.->|"reads collected data"| node_rrdcollect
node_backupjob -->|"runs backup logic"| node_backups
node_backupjob -.->|"backs up configuration"| node_oltdevice
node_backupjob -.->|"backs up database"| node_mysql
node_api -->|"loads settings"| node_jwtconfig
node_api -->|"validates token"| node_jwt
node_api -->|"reads customers"| node_customerdata
node_apiwrite -->|"validates token"| node_jwt
node_apiwrite -->|"creates customer"| node_customerdata
node_servicesapi -->|"reads services"| node_services
node_jwt -->|"throws"| node_signature
node_jwt -->|"throws"| node_expired
node_jwt -->|"throws"| node_beforevalid

click node_dashboard "https://github.com/veno77/raisepon-2.0/blob/master/index.php"
click node_webshell "https://github.com/veno77/raisepon-2.0/blob/master/common.php"
click node_oltadmin "https://github.com/veno77/raisepon-2.0/blob/master/olt.php"
click node_ponadmin "https://github.com/veno77/raisepon-2.0/blob/master/pon.php"
click node_customerdata "https://github.com/veno77/raisepon-2.0/blob/master/classes/customers_class.php"
click node_services "https://github.com/veno77/raisepon-2.0/blob/master/classes/services_class.php"
click node_lineprofiles "https://github.com/veno77/raisepon-2.0/blob/master/classes/line_profile_class.php"
click node_serviceprofiles "https://github.com/veno77/raisepon-2.0/blob/master/classes/service_profile_class.php"
click node_ippool "https://github.com/veno77/raisepon-2.0/blob/master/classes/ip_pool_class.php"
click node_dbaccess "https://github.com/veno77/raisepon-2.0/blob/master/classes/db_connect_class.php"
click node_snmpoids "https://github.com/veno77/raisepon-2.0/blob/master/classes/snmp_class.php"
click node_sync "https://github.com/veno77/raisepon-2.0/blob/master/update_data.php"
click node_autoassign "https://github.com/veno77/raisepon-2.0/blob/master/update_auto.php"
click node_rrdcollect "https://github.com/veno77/raisepon-2.0/blob/master/update_rrd.php"
click node_graphs "https://github.com/veno77/raisepon-2.0/blob/master/graphs.php"
click node_backupjob "https://github.com/veno77/raisepon-2.0/blob/master/update_backup.php"
click node_backups "https://github.com/veno77/raisepon-2.0/blob/master/classes/backup_class.php"
click node_api "https://github.com/veno77/raisepon-2.0/blob/master/API/get_customers.php"
click node_apiwrite "https://github.com/veno77/raisepon-2.0/blob/master/API/create_customer.php"
click node_servicesapi "https://github.com/veno77/raisepon-2.0/blob/master/API/get_services.php"
click node_jwtconfig "https://github.com/veno77/raisepon-2.0/blob/master/API/config/core.php"
click node_jwt "https://github.com/veno77/raisepon-2.0/blob/master/API/libs/php-jwt-master/src/JWT.php"
click node_beforevalid "https://github.com/veno77/raisepon-2.0/blob/master/API/libs/php-jwt-master/src/BeforeValidException.php"
click node_expired "https://github.com/veno77/raisepon-2.0/blob/master/API/libs/php-jwt-master/src/ExpiredException.php"
click node_signature "https://github.com/veno77/raisepon-2.0/blob/master/API/libs/php-jwt-master/src/SignatureInvalidException.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_dashboard,node_webshell,node_oltadmin,node_ponadmin toneBlue
class node_customerdata,node_services,node_lineprofiles,node_serviceprofiles,node_ippool,node_dbaccess,node_mysql toneAmber
class node_snmpoids toneMint
class node_sync,node_autoassign,node_rrdcollect,node_graphs,node_backupjob,node_backups,node_api,node_apiwrite,node_servicesapi toneRose
class node_jwtconfig,node_jwt,node_beforevalid,node_expired,node_signature,node_operator,node_oltdevice toneIndigo
```

## Components

### Web console

- [ONU dashboard](https://github.com/veno77/raisepon-2.0/blob/master/index.php): `index.php`
- [Session and navigation](https://github.com/veno77/raisepon-2.0/blob/master/common.php): `common.php`
- [OLT management](https://github.com/veno77/raisepon-2.0/blob/master/olt.php): `olt.php`
- [PON management](https://github.com/veno77/raisepon-2.0/blob/master/pon.php): `pon.php`

### Subscriber domain

- [Customer records](https://github.com/veno77/raisepon-2.0/blob/master/classes/customers_class.php): `classes/customers_class.php`
- [Service catalog](https://github.com/veno77/raisepon-2.0/blob/master/classes/services_class.php): `classes/services_class.php`
- [Line profiles](https://github.com/veno77/raisepon-2.0/blob/master/classes/line_profile_class.php): `classes/line_profile_class.php`
- [Service profiles](https://github.com/veno77/raisepon-2.0/blob/master/classes/service_profile_class.php): `classes/service_profile_class.php`
- [IP pools](https://github.com/veno77/raisepon-2.0/blob/master/classes/ip_pool_class.php): `classes/ip_pool_class.php`
- [Database connection](https://github.com/veno77/raisepon-2.0/blob/master/classes/db_connect_class.php): `classes/db_connect_class.php`

### OLT integration

- [SNMP OIDs](https://github.com/veno77/raisepon-2.0/blob/master/classes/snmp_class.php): `classes/snmp_class.php`

### Operations and API

- [ONU synchronization](https://github.com/veno77/raisepon-2.0/blob/master/update_data.php): `update_data.php`
- [Automatic registration](https://github.com/veno77/raisepon-2.0/blob/master/update_auto.php): `update_auto.php`
- [Graph collection](https://github.com/veno77/raisepon-2.0/blob/master/update_rrd.php): `update_rrd.php`
- [Network graphs](https://github.com/veno77/raisepon-2.0/blob/master/graphs.php): `graphs.php`
- [Backup job](https://github.com/veno77/raisepon-2.0/blob/master/update_backup.php): `update_backup.php`
- [Backup management](https://github.com/veno77/raisepon-2.0/blob/master/classes/backup_class.php): `classes/backup_class.php`
- [Customer API](https://github.com/veno77/raisepon-2.0/blob/master/API/get_customers.php): `API/get_customers.php`
- [Customer API writes](https://github.com/veno77/raisepon-2.0/blob/master/API/create_customer.php): `API/create_customer.php`
- [Service API](https://github.com/veno77/raisepon-2.0/blob/master/API/get_services.php): `API/get_services.php`

### JWT library

- [JWT settings](https://github.com/veno77/raisepon-2.0/blob/master/API/config/core.php): `API/config/core.php`
- [JWT encode and decode](https://github.com/veno77/raisepon-2.0/blob/master/API/libs/php-jwt-master/src/JWT.php): `API/libs/php-jwt-master/src/JWT.php`
- [Before-valid exception](https://github.com/veno77/raisepon-2.0/blob/master/API/libs/php-jwt-master/src/BeforeValidException.php): `API/libs/php-jwt-master/src/BeforeValidException.php`
- [Expired exception](https://github.com/veno77/raisepon-2.0/blob/master/API/libs/php-jwt-master/src/ExpiredException.php): `API/libs/php-jwt-master/src/ExpiredException.php`
- [Signature exception](https://github.com/veno77/raisepon-2.0/blob/master/API/libs/php-jwt-master/src/SignatureInvalidException.php): `API/libs/php-jwt-master/src/SignatureInvalidException.php`

### Other components

- **Operator**
- **Raisepon database**
- **Raisecom OLTs**

## Connections

- Operator → ONU dashboard: views
- ONU dashboard → Session and navigation: loads session (evidence: `index.php`)
- ONU dashboard → Customer records: deletes customers (evidence: `index.php`)
- ONU dashboard → SNMP OIDs: looks up OIDs (evidence: `index.php`)
- ONU dashboard → Raisecom OLTs: queries status (evidence: `index.php`)
- OLT management → Raisecom OLTs: manages OLTs
- PON management → Raisecom OLTs: manages ports
- Customer records → Database connection: uses connection (evidence: `classes/customers_class.php`)
- Customer records → SNMP OIDs: uses OIDs (evidence: `classes/customers_class.php`)
- Service catalog → Database connection: queries database (evidence: `classes/services_class.php`)
- Service catalog → Customer records: edits customers (evidence: `classes/services_class.php`)
- Service profiles → Database connection: queries database (evidence: `classes/service_profile_class.php`)
- Database connection → Raisepon database: connects to (evidence: `classes/db_connect_class.php`)
- IP pools → Database connection: uses connection (evidence: `classes/ip_pool_class.php`)
- IP pools → Customer records: checks customers (evidence: `classes/ip_pool_class.php`)
- ONU synchronization → Customer records: uses subscriber logic
- ONU synchronization → SNMP OIDs: uses OIDs
- ONU synchronization → Raisecom OLTs: synchronizes ONUs
- Automatic registration → Customer records: uses subscriber logic
- Automatic registration → Raisecom OLTs: detects illegal ONUs
- Graph collection → Customer records: uses subscriber data (evidence: `update_rrd.php`)
- Graph collection → SNMP OIDs: uses OIDs (evidence: `update_rrd.php`)
- Graph collection → Raisecom OLTs: collects metrics
- Network graphs → Graph collection: reads collected data
- Backup job → Backup management: runs backup logic (evidence: `classes/backup_class.php`)
- Backup job → Raisecom OLTs: backs up configuration
- Backup job → Raisepon database: backs up database
- Customer API → JWT settings: loads settings (evidence: `API/get_customers.php`)
- Customer API → JWT encode and decode: validates token (evidence: `API/get_customers.php`)
- Customer API → Customer records: reads customers (evidence: `API/get_customers.php`)
- Customer API writes → JWT encode and decode: validates token (evidence: `API/create_customer.php`)
- Customer API writes → Customer records: creates customer (evidence: `API/create_customer.php`)
- Service API → Service catalog: reads services (evidence: `API/get_services.php`)
- JWT encode and decode → Signature exception: throws (evidence: `API/libs/php-jwt-master/src/JWT.php`)
- JWT encode and decode → Expired exception: throws (evidence: `API/libs/php-jwt-master/src/JWT.php`)
- JWT encode and decode → Before-valid exception: throws (evidence: `API/libs/php-jwt-master/src/JWT.php`)
