# radiusdesk/rd_cake5 architecture

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

- Interactive diagram: https://gitdiagram.com/radiusdesk/rd_cake5
- Repository: https://github.com/radiusdesk/rd_cake5

## Overview

RadiusDesk is a CakePHP network and subscriber-management application. Its main workflow is an authenticated operator request handled by application controllers, which manage cloud, access-point, mesh, subscriber, and usage data and return JSON views. The sampled code shows access-point captive-portal setup coordinating RADIUS-related configuration, mesh/node management, and usage reporting. The README gives no product detail; broader capabilities are represented conservatively from the repository tree and SOURCE INDEX, so links for unsampled subsystems are omitted.

Main entry points: [`rd_cake/src/Application.php`](https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/src/Application.php) (HTTP application), [`rd_cake/src/Controller/ApProfilesController.php`](https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/src/Controller/ApProfilesController.php) (Access point profiles), [`rd_cake/src/Controller/DataUsagesController.php`](https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/src/Controller/DataUsagesController.php) (Usage analytics), [`rd_cake/src/Model/Table`](https://github.com/radiusdesk/rd_cake5/tree/main/rd_cake/src/Model/Table) (Subscriber records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Request runtime"]
  node_application["HTTP application<br/>[Application.php]"]
  node_appcontroller["Shared controller<br/>[AppController.php]"]
  node_auth["Token authentication"]
  node_hostcheck["Host validation"]
end

subgraph group_network["Network management"]
  node_approfiles["Access point profiles"]
  node_apconfig["AP profile presets<br/>[ApProfiles.php]"]
  node_cnr["Portal provisioning"]
  node_mesh["Mesh and node management"]
  node_meshconfig["Mesh configuration<br/>[MESHdesk.php]"]
  node_networkdata[("Network records")]
end

subgraph group_subscriber["Subscriber services"]
  node_radiusconfig["RadiusDesk settings<br/>[RadiusDesk.php]"]
  node_voucherconfig["Voucher settings<br/>[Vouchers.php]"]
  node_subscriberdata[("Subscriber records")]
end

subgraph group_reporting["Usage and reporting"]
  node_usage["Usage analytics"]
  node_meshreports["Mesh reporting"]
  node_reportdata[("Statistics records")]
end

node_operator(("Operator"))
node_radius{{"FreeRADIUS"}}

node_operator -->|"sends request"| node_application
node_application -->|"installs middleware"| node_hostcheck
node_application -->|"configures authentication"| node_auth
node_application -.->|"dispatches requests"| node_appcontroller
node_appcontroller -->|"loads settings"| node_radiusconfig
node_approfiles -->|"provisions portal"| node_cnr
node_approfiles -->|"manages profile data"| node_networkdata
node_approfiles -->|"cleans portal records"| node_subscriberdata
node_approfiles -->|"uses profile presets"| node_apconfig
node_cnr -.->|"updates RADIUS rules"| node_radius
node_mesh -->|"manages mesh records"| node_networkdata
node_mesh -.->|"uses mesh settings"| node_meshconfig
node_meshreports -->|"queries node metrics"| node_reportdata
node_usage -->|"queries usage stats"| node_reportdata
node_usage -->|"resolves subscriber context"| node_subscriberdata
node_usage -->|"reads voucher options"| node_voucherconfig
node_subscriberdata -->|"loads configuration"| node_voucherconfig
node_application -.->|"returns response"| node_operator

click node_application "https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/src/Application.php"
click node_appcontroller "https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/src/Controller/AppController.php"
click node_auth "https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/src/Authentication/Authenticator/CustomTokenAuthenticator.php"
click node_hostcheck "https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/src/Middleware/HostHeaderMiddleware.php"
click node_approfiles "https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/src/Controller/ApProfilesController.php"
click node_apconfig "https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/config/ApProfiles.php"
click node_cnr "https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/src/Service/ConnectAndRedirectService.php"
click node_mesh "https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/src/Controller/MeshesController.php"
click node_meshconfig "https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/config/MESHdesk.php"
click node_networkdata "https://github.com/radiusdesk/rd_cake5/tree/main/rd_cake/src/Model/Table"
click node_radiusconfig "https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/config/RadiusDesk.php"
click node_voucherconfig "https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/config/Vouchers.php"
click node_subscriberdata "https://github.com/radiusdesk/rd_cake5/tree/main/rd_cake/src/Model/Table"
click node_usage "https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/src/Controller/DataUsagesController.php"
click node_meshreports "https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/src/Controller/MeshReportsController.php"
click node_reportdata "https://github.com/radiusdesk/rd_cake5/tree/main/rd_cake/src/Model/Table"

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_application,node_appcontroller,node_auth,node_hostcheck toneBlue
class node_approfiles,node_apconfig,node_cnr,node_mesh,node_meshconfig,node_networkdata toneAmber
class node_radiusconfig,node_voucherconfig,node_subscriberdata toneMint
class node_usage,node_meshreports,node_reportdata toneRose
class node_operator,node_radius toneIndigo
```

## Components

### Request runtime

- [HTTP application](https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/src/Application.php): `rd_cake/src/Application.php`
- [Shared controller](https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/src/Controller/AppController.php): `rd_cake/src/Controller/AppController.php`
- [Token authentication](https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/src/Authentication/Authenticator/CustomTokenAuthenticator.php): `rd_cake/src/Authentication/Authenticator/CustomTokenAuthenticator.php`
- [Host validation](https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/src/Middleware/HostHeaderMiddleware.php): `rd_cake/src/Middleware/HostHeaderMiddleware.php`

### Network management

- [Access point profiles](https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/src/Controller/ApProfilesController.php): `rd_cake/src/Controller/ApProfilesController.php`
- [AP profile presets](https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/config/ApProfiles.php): `rd_cake/config/ApProfiles.php`
- [Portal provisioning](https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/src/Service/ConnectAndRedirectService.php): `rd_cake/src/Service/ConnectAndRedirectService.php`
- [Mesh and node management](https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/src/Controller/MeshesController.php): `rd_cake/src/Controller/MeshesController.php`
- [Mesh configuration](https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/config/MESHdesk.php): `rd_cake/config/MESHdesk.php`
- [Network records](https://github.com/radiusdesk/rd_cake5/tree/main/rd_cake/src/Model/Table): `rd_cake/src/Model/Table`

### Subscriber services

- [RadiusDesk settings](https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/config/RadiusDesk.php): `rd_cake/config/RadiusDesk.php`
- [Voucher settings](https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/config/Vouchers.php): `rd_cake/config/Vouchers.php`
- [Subscriber records](https://github.com/radiusdesk/rd_cake5/tree/main/rd_cake/src/Model/Table): `rd_cake/src/Model/Table`

### Usage and reporting

- [Usage analytics](https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/src/Controller/DataUsagesController.php): `rd_cake/src/Controller/DataUsagesController.php`
- [Mesh reporting](https://github.com/radiusdesk/rd_cake5/blob/main/rd_cake/src/Controller/MeshReportsController.php): `rd_cake/src/Controller/MeshReportsController.php`
- [Statistics records](https://github.com/radiusdesk/rd_cake5/tree/main/rd_cake/src/Model/Table): `rd_cake/src/Model/Table`

### Other components

- **Operator**
- **FreeRADIUS**

## Connections

- Operator → HTTP application: sends request
- HTTP application → Host validation: installs middleware (evidence: `rd_cake/src/Application.php`)
- HTTP application → Token authentication: configures authentication (evidence: `rd_cake/src/Application.php`)
- HTTP application → Shared controller: dispatches requests
- Shared controller → RadiusDesk settings: loads settings (evidence: `rd_cake/src/Controller/AppController.php`)
- Access point profiles → Portal provisioning: provisions portal (evidence: `rd_cake/src/Controller/ApProfilesController.php`)
- Access point profiles → Network records: manages profile data (evidence: `rd_cake/src/Controller/ApProfilesController.php`)
- Access point profiles → Subscriber records: cleans portal records (evidence: `rd_cake/src/Controller/ApProfilesController.php`)
- Access point profiles → AP profile presets: uses profile presets (evidence: `rd_cake/src/Controller/ApProfilesController.php`)
- Portal provisioning → FreeRADIUS: updates RADIUS rules
- Mesh and node management → Network records: manages mesh records (evidence: `rd_cake/src/Controller/MeshesController.php`)
- Mesh and node management → Mesh configuration: uses mesh settings (evidence: `rd_cake/src/Controller/MeshesController.php`)
- Mesh reporting → Statistics records: queries node metrics (evidence: `rd_cake/src/Controller/MeshReportsController.php`)
- Usage analytics → Statistics records: queries usage stats (evidence: `rd_cake/src/Controller/DataUsagesController.php`)
- Usage analytics → Subscriber records: resolves subscriber context (evidence: `rd_cake/src/Controller/DataUsagesController.php`)
- Usage analytics → Voucher settings: reads voucher options (evidence: `rd_cake/src/Controller/DataUsagesController.php`)
- Subscriber records → Voucher settings: loads configuration (evidence: `rd_cake/src/Model/Table/CloudsTable.php`)
- HTTP application → Operator: returns response
