# sown/node_control architecture

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

- Interactive diagram: https://gitdiagram.com/sown/node_control
- Repository: https://github.com/sown/node_control

## Overview

This is a SOWN network and infrastructure administration portal. The principal workflow is an administrator submitting a request to manage a deployment, which the deployment controller validates and changes through builder operations, then presents a result. The wider application also covers network inventory, node requests and provisioning, generated device configurations, certificates, monitoring checks, and RADIUS data. The tree supports these capability areas, but most source was not sampled; their detailed wiring is therefore not inferred. The deployment controller and server model excerpts provide the clearest implementation evidence.

Main entry points: [`application/classes/model/node.php`](https://github.com/sown/node_control/blob/master/application/classes/model/node.php) (Node records), [`application/classes/controller/deployments/main.php`](https://github.com/sown/node_control/blob/master/application/classes/controller/deployments/main.php) (Deployment workflows), [`application/classes/model/deployment.php`](https://github.com/sown/node_control/blob/master/application/classes/model/deployment.php) (Deployment records), [`application/views`](https://github.com/sown/node_control/tree/master/application/views) (Page views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_entry["Request entry<br/>[index.php]"]
  node_controllers["Web controllers"]
  node_views["Page views"]
end

subgraph group_deploy["Deployment management"]
  node_deployments["Deployment workflows<br/>[main.php]"]
  node_usage["Deployment usage<br/>[usage.php]"]
  node_builder["Domain builder<br/>[builder.php]"]
  node_deployment_models["Deployment records<br/>[deployment.php]"]
end

subgraph group_network["Network operations"]
  node_node_requests["Node requests<br/>[noderequests.php]"]
  node_node_setup["Node setup requests"]
  node_node_inventory["Node inventory<br/>[nodes.php]"]
  node_node_model["Node records<br/>[node.php]"]
  node_device_configs["Device configurations<br/>[config.php]"]
  node_ssh["Remote node access<br/>[sshsession.php]"]
end

subgraph group_assets["Infrastructure assets"]
  node_inventory["Infrastructure inventory<br/>[inventory.php]"]
  node_servers["Server records<br/>[server.php]"]
  node_certificates["Certificate management<br/>[certificates.php]"]
  node_pki["PKI operations<br/>[pki.php]"]
end

subgraph group_access["Access and monitoring"]
  node_checks["Operational checks<br/>[check.php]"]
  node_radius_auth["RADIUS authentication<br/>[radius.php]"]
  node_radius_data["RADIUS accounting<br/>[radaccts.php]"]
  node_app_database[("Application database")]
  node_radius_database[("RADIUS database")]
end

node_admin(("Administrator"))

node_admin -->|"submits request"| node_entry
node_entry -->|"dispatches request"| node_controllers
node_controllers -->|"renders response"| node_views
node_deployments -->|"creates or changes"| node_builder
node_deployments -->|"loads deployment"| node_deployment_models
node_deployments -->|"renders result"| node_views
node_usage -->|"renders usage"| node_views
node_builder -->|"builds records"| node_deployment_models
node_deployment_models -->|"persists records"| node_app_database
node_node_requests -->|"manages node requests"| node_node_model
node_node_setup -->|"manages setup requests"| node_node_model
node_node_inventory -->|"manages nodes"| node_node_model
node_node_model -->|"persists records"| node_app_database
node_device_configs -.->|"configuration support"| node_ssh
node_inventory -->|"manages inventory"| node_servers
node_servers -->|"persists records"| node_app_database
node_certificates -->|"certificate operations"| node_pki
node_checks -->|"checks table counts"| node_radius_database
node_radius_auth -->|"authenticates against"| node_radius_database
node_radius_data -->|"manages accounting"| node_radius_database

click node_entry "https://github.com/sown/node_control/blob/master/index.php"
click node_controllers "https://github.com/sown/node_control/tree/master/application/classes/controller"
click node_views "https://github.com/sown/node_control/tree/master/application/views"
click node_deployments "https://github.com/sown/node_control/blob/master/application/classes/controller/deployments/main.php"
click node_usage "https://github.com/sown/node_control/blob/master/application/classes/controller/deployments/usage.php"
click node_builder "https://github.com/sown/node_control/blob/master/application/classes/model/builder.php"
click node_deployment_models "https://github.com/sown/node_control/blob/master/application/classes/model/deployment.php"
click node_node_requests "https://github.com/sown/node_control/blob/master/application/classes/controller/noderequests.php"
click node_node_setup "https://github.com/sown/node_control/blob/master/application/classes/controller/nodesetuprequests.php"
click node_node_inventory "https://github.com/sown/node_control/blob/master/application/classes/controller/nodes.php"
click node_node_model "https://github.com/sown/node_control/blob/master/application/classes/model/node.php"
click node_device_configs "https://github.com/sown/node_control/blob/master/application/classes/package/config.php"
click node_ssh "https://github.com/sown/node_control/blob/master/application/classes/sshsession.php"
click node_inventory "https://github.com/sown/node_control/blob/master/application/classes/controller/inventory.php"
click node_servers "https://github.com/sown/node_control/blob/master/application/classes/model/server.php"
click node_certificates "https://github.com/sown/node_control/blob/master/application/classes/controller/certificates.php"
click node_pki "https://github.com/sown/node_control/blob/master/application/classes/pki.php"
click node_checks "https://github.com/sown/node_control/blob/master/application/classes/check.php"
click node_radius_auth "https://github.com/sown/node_control/blob/master/application/classes/auth/radius.php"
click node_radius_data "https://github.com/sown/node_control/blob/master/application/classes/controller/radaccts.php"
click node_app_database "https://github.com/sown/node_control/blob/master/application/config/default_database.php"
click node_radius_database "https://github.com/sown/node_control/blob/master/application/config/default_database.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_entry,node_controllers,node_views toneBlue
class node_deployments,node_usage,node_builder,node_deployment_models toneAmber
class node_node_requests,node_node_setup,node_node_inventory,node_node_model,node_device_configs,node_ssh toneMint
class node_inventory,node_servers,node_certificates,node_pki toneRose
class node_checks,node_radius_auth,node_radius_data,node_app_database,node_radius_database,node_admin toneIndigo
```

## Components

### Web application

- [Request entry](https://github.com/sown/node_control/blob/master/index.php): `index.php`
- [Web controllers](https://github.com/sown/node_control/tree/master/application/classes/controller): `application/classes/controller`
- [Page views](https://github.com/sown/node_control/tree/master/application/views): `application/views`

### Deployment management

- [Deployment workflows](https://github.com/sown/node_control/blob/master/application/classes/controller/deployments/main.php): `application/classes/controller/deployments/main.php`
- [Deployment usage](https://github.com/sown/node_control/blob/master/application/classes/controller/deployments/usage.php): `application/classes/controller/deployments/usage.php`
- [Domain builder](https://github.com/sown/node_control/blob/master/application/classes/model/builder.php): `application/classes/model/builder.php`
- [Deployment records](https://github.com/sown/node_control/blob/master/application/classes/model/deployment.php): `application/classes/model/deployment.php`

### Network operations

- [Node requests](https://github.com/sown/node_control/blob/master/application/classes/controller/noderequests.php): `application/classes/controller/noderequests.php`
- [Node setup requests](https://github.com/sown/node_control/blob/master/application/classes/controller/nodesetuprequests.php): `application/classes/controller/nodesetuprequests.php`
- [Node inventory](https://github.com/sown/node_control/blob/master/application/classes/controller/nodes.php): `application/classes/controller/nodes.php`
- [Node records](https://github.com/sown/node_control/blob/master/application/classes/model/node.php): `application/classes/model/node.php`
- [Device configurations](https://github.com/sown/node_control/blob/master/application/classes/package/config.php): `application/classes/package/config.php`
- [Remote node access](https://github.com/sown/node_control/blob/master/application/classes/sshsession.php): `application/classes/sshsession.php`

### Infrastructure assets

- [Infrastructure inventory](https://github.com/sown/node_control/blob/master/application/classes/controller/inventory.php): `application/classes/controller/inventory.php`
- [Server records](https://github.com/sown/node_control/blob/master/application/classes/model/server.php): `application/classes/model/server.php`
- [Certificate management](https://github.com/sown/node_control/blob/master/application/classes/controller/certificates.php): `application/classes/controller/certificates.php`
- [PKI operations](https://github.com/sown/node_control/blob/master/application/classes/pki.php): `application/classes/pki.php`

### Access and monitoring

- [Operational checks](https://github.com/sown/node_control/blob/master/application/classes/check.php): `application/classes/check.php`
- [RADIUS authentication](https://github.com/sown/node_control/blob/master/application/classes/auth/radius.php): `application/classes/auth/radius.php`
- [RADIUS accounting](https://github.com/sown/node_control/blob/master/application/classes/controller/radaccts.php): `application/classes/controller/radaccts.php`
- [Application database](https://github.com/sown/node_control/blob/master/application/config/default_database.php): `application/config/default_database.php`
- [RADIUS database](https://github.com/sown/node_control/blob/master/application/config/default_database.php): `application/config/default_database.php`

### Other components

- **Administrator**

## Connections

- Administrator → Request entry: submits request
- Request entry → Web controllers: dispatches request
- Web controllers → Page views: renders response
- Deployment workflows → Domain builder: creates or changes
- Deployment workflows → Deployment records: loads deployment
- Deployment workflows → Page views: renders result
- Deployment usage → Page views: renders usage
- Domain builder → Deployment records: builds records
- Deployment records → Application database: persists records
- Node requests → Node records: manages node requests
- Node setup requests → Node records: manages setup requests
- Node inventory → Node records: manages nodes
- Node records → Application database: persists records
- Device configurations → Remote node access: configuration support
- Infrastructure inventory → Server records: manages inventory
- Server records → Application database: persists records
- Certificate management → PKI operations: certificate operations
- Operational checks → RADIUS database: checks table counts
- RADIUS authentication → RADIUS database: authenticates against
- RADIUS accounting → RADIUS database: manages accounting
