# akkadius/glass-isc-dhcp architecture

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

- Interactive diagram: https://gitdiagram.com/akkadius/glass-isc-dhcp
- Repository: https://github.com/akkadius/glass-isc-dhcp

## Overview

Glass is a web interface and REST API for monitoring and administering an ISC DHCP server. Operators view live lease and pool statistics, search lease details, inspect streamed DHCP logs, edit and snapshot configuration, and control the server; administrative actions can be protected by Basic authentication. Runtime monitoring parses lease and log data, enriches MAC addresses with OUI vendors, and supports threshold alerts. The README documents alert destinations and capabilities not fully visible in the sampled code; those relationships are shown only where documented.

Main entry points: [`app.js`](https://github.com/akkadius/glass-isc-dhcp/blob/master/app.js) (Glass server), [`core/authorize.js`](https://github.com/akkadius/glass-isc-dhcp/blob/master/core/authorize.js) (Admin authorization), [`core/dhcp-leases.js`](https://github.com/akkadius/glass-isc-dhcp/blob/master/core/dhcp-leases.js) (Lease file reader), [`core/dhcp-log-watcher.js`](https://github.com/akkadius/glass-isc-dhcp/blob/master/core/dhcp-log-watcher.js) (DHCP log watcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web and API"]
  node_express["Glass server<br/>[app.js]"]
  node_dashboard["Dashboard<br/>[index.js]"]
  node_api["REST API"]
end

subgraph group_monitor["DHCP Monitoring"]
  node_statistics["Pool statistics<br/>[get_stats.js]"]
  node_lease_api["Active lease API"]
  node_lease_search["Lease search"]
  node_lease_reader["Lease file reader<br/>[dhcp-leases.js]"]
  node_lease_parser["Lease parser<br/>[lease-parser.js]"]
  node_oui["OUI lookup<br/>[oui-reader.js]"]
  node_log_watcher["DHCP log watcher"]
  node_websocket["WebSocket streaming<br/>[app.js]"]
end

subgraph group_admin["Administration"]
  node_config_edit["Configuration editor"]
  node_snapshots["Config snapshots"]
  node_service_control["Service controls"]
  node_authorization["Admin authorization<br/>[authorize.js]"]
end

subgraph group_alerts["Alerts and Settings"]
  node_alert_settings["Alert settings<br/>[glass_alerts.js]"]
  node_alert_config["Alert configuration"]
  node_alert_engine["Threshold alerting<br/>[app.js]"]
  node_delivery["Alert delivery<br/>[app.js]"]
end

node_operator(("Network operator"))
node_dhcp_files["DHCP files and logs"]
node_dhcp_server["ISC DHCP server"]
node_alert_services["Email, Slack, SMS"]

node_operator -->|"uses"| node_express
node_express -->|"routes requests"| node_dashboard
node_express -->|"routes requests"| node_statistics
node_express -.->|"serves endpoints"| node_api
node_api -->|"exposes"| node_lease_api
node_operator -->|"searches leases"| node_lease_search
node_lease_api -->|"cleans leases"| node_lease_parser
node_lease_search -->|"reads lease data"| node_lease_reader
node_lease_reader -->|"parses leases"| node_lease_parser
node_lease_reader -.->|"reads leases"| node_dhcp_files
node_lease_parser -->|"looks up vendors"| node_oui
node_operator -->|"views live logs"| node_log_watcher
node_log_watcher -->|"broadcasts logs"| node_websocket
node_websocket -->|"streams logs"| node_operator
node_log_watcher -->|"tails log"| node_dhcp_files
node_operator -->|"edits configuration"| node_config_edit
node_config_edit -->|"checks access"| node_authorization
node_operator -->|"views snapshots"| node_snapshots
node_operator -->|"controls service"| node_service_control
node_service_control -->|"checks access"| node_authorization
node_service_control -->|"runs service actions"| node_dhcp_server
node_operator -->|"configures alerts"| node_alert_settings
node_alert_settings -->|"checks access"| node_authorization
node_alert_config -->|"checks access"| node_authorization
node_alert_engine -->|"sends notifications"| node_delivery
node_delivery -->|"delivers alerts"| node_alert_services
node_statistics -->|"measures pools"| node_dhcp_server

click node_express "https://github.com/akkadius/glass-isc-dhcp/blob/master/app.js"
click node_dashboard "https://github.com/akkadius/glass-isc-dhcp/blob/master/routes/index.js"
click node_statistics "https://github.com/akkadius/glass-isc-dhcp/blob/master/routes/get_stats.js"
click node_api "https://github.com/akkadius/glass-isc-dhcp/tree/master/api"
click node_lease_api "https://github.com/akkadius/glass-isc-dhcp/blob/master/api/get_active_leases.js"
click node_lease_search "https://github.com/akkadius/glass-isc-dhcp/blob/master/routes/dhcp_lease_search.js"
click node_lease_reader "https://github.com/akkadius/glass-isc-dhcp/blob/master/core/dhcp-leases.js"
click node_lease_parser "https://github.com/akkadius/glass-isc-dhcp/blob/master/core/lease-parser.js"
click node_oui "https://github.com/akkadius/glass-isc-dhcp/blob/master/core/oui-reader.js"
click node_log_watcher "https://github.com/akkadius/glass-isc-dhcp/blob/master/core/dhcp-log-watcher.js"
click node_websocket "https://github.com/akkadius/glass-isc-dhcp/blob/master/app.js"
click node_config_edit "https://github.com/akkadius/glass-isc-dhcp/blob/master/routes/dhcp_config_save.js"
click node_snapshots "https://github.com/akkadius/glass-isc-dhcp/blob/master/routes/dhcp_config_snapshots.js"
click node_service_control "https://github.com/akkadius/glass-isc-dhcp/blob/master/routes/dhcp_start_stop_restart.js"
click node_authorization "https://github.com/akkadius/glass-isc-dhcp/blob/master/core/authorize.js"
click node_alert_settings "https://github.com/akkadius/glass-isc-dhcp/blob/master/routes/glass_alerts.js"
click node_alert_config "https://github.com/akkadius/glass-isc-dhcp/blob/master/routes/glass_alert_settings_save.js"
click node_alert_engine "https://github.com/akkadius/glass-isc-dhcp/blob/master/app.js"
click node_delivery "https://github.com/akkadius/glass-isc-dhcp/blob/master/app.js"

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_express,node_dashboard,node_api toneBlue
class node_statistics,node_lease_api,node_lease_search,node_lease_reader,node_lease_parser,node_oui,node_log_watcher,node_websocket toneAmber
class node_config_edit,node_snapshots,node_service_control,node_authorization,node_dhcp_server toneMint
class node_alert_settings,node_alert_config,node_alert_engine,node_delivery toneRose
class node_operator,node_dhcp_files,node_alert_services toneIndigo
```

## Components

### Web and API

- [Glass server](https://github.com/akkadius/glass-isc-dhcp/blob/master/app.js): `app.js`
- [Dashboard](https://github.com/akkadius/glass-isc-dhcp/blob/master/routes/index.js): `routes/index.js`
- [REST API](https://github.com/akkadius/glass-isc-dhcp/tree/master/api): `api`

### DHCP Monitoring

- [Pool statistics](https://github.com/akkadius/glass-isc-dhcp/blob/master/routes/get_stats.js): `routes/get_stats.js`
- [Active lease API](https://github.com/akkadius/glass-isc-dhcp/blob/master/api/get_active_leases.js): `api/get_active_leases.js`
- [Lease search](https://github.com/akkadius/glass-isc-dhcp/blob/master/routes/dhcp_lease_search.js): `routes/dhcp_lease_search.js`
- [Lease file reader](https://github.com/akkadius/glass-isc-dhcp/blob/master/core/dhcp-leases.js): `core/dhcp-leases.js`
- [Lease parser](https://github.com/akkadius/glass-isc-dhcp/blob/master/core/lease-parser.js): `core/lease-parser.js`
- [OUI lookup](https://github.com/akkadius/glass-isc-dhcp/blob/master/core/oui-reader.js): `core/oui-reader.js`
- [DHCP log watcher](https://github.com/akkadius/glass-isc-dhcp/blob/master/core/dhcp-log-watcher.js): `core/dhcp-log-watcher.js`
- [WebSocket streaming](https://github.com/akkadius/glass-isc-dhcp/blob/master/app.js): `app.js`

### Administration

- [Configuration editor](https://github.com/akkadius/glass-isc-dhcp/blob/master/routes/dhcp_config_save.js): `routes/dhcp_config_save.js`
- [Config snapshots](https://github.com/akkadius/glass-isc-dhcp/blob/master/routes/dhcp_config_snapshots.js): `routes/dhcp_config_snapshots.js`
- [Service controls](https://github.com/akkadius/glass-isc-dhcp/blob/master/routes/dhcp_start_stop_restart.js): `routes/dhcp_start_stop_restart.js`
- [Admin authorization](https://github.com/akkadius/glass-isc-dhcp/blob/master/core/authorize.js): `core/authorize.js`

### Alerts and Settings

- [Alert settings](https://github.com/akkadius/glass-isc-dhcp/blob/master/routes/glass_alerts.js): `routes/glass_alerts.js`
- [Alert configuration](https://github.com/akkadius/glass-isc-dhcp/blob/master/routes/glass_alert_settings_save.js): `routes/glass_alert_settings_save.js`
- [Threshold alerting](https://github.com/akkadius/glass-isc-dhcp/blob/master/app.js): `app.js`
- [Alert delivery](https://github.com/akkadius/glass-isc-dhcp/blob/master/app.js): `app.js`

### Other components

- **Network operator**
- **DHCP files and logs**
- **ISC DHCP server**
- **Email, Slack, SMS**

## Connections

- Network operator → Glass server: uses (evidence: `README.md`)
- Glass server → Dashboard: routes requests (evidence: `app.js`)
- Glass server → Pool statistics: routes requests (evidence: `app.js`)
- Glass server → REST API: serves endpoints (evidence: `app.js`)
- REST API → Active lease API: exposes (evidence: `api/get_active_leases.js`)
- Network operator → Lease search: searches leases (evidence: `README.md`)
- Active lease API → Lease parser: cleans leases (evidence: `api/get_active_leases.js`)
- Lease search → Lease file reader: reads lease data (evidence: `routes/dhcp_lease_search.js`)
- Lease file reader → Lease parser: parses leases (evidence: `core/dhcp-leases.js`)
- Lease file reader → DHCP files and logs: reads leases
- Lease parser → OUI lookup: looks up vendors (evidence: `core/lease-parser.js`)
- Network operator → DHCP log watcher: views live logs (evidence: `README.md`)
- DHCP log watcher → WebSocket streaming: broadcasts logs (evidence: `core/dhcp-log-watcher.js`)
- WebSocket streaming → Network operator: streams logs (evidence: `README.md`)
- DHCP log watcher → DHCP files and logs: tails log (evidence: `core/dhcp-log-watcher.js`)
- Network operator → Configuration editor: edits configuration (evidence: `README.md`)
- Configuration editor → Admin authorization: checks access (evidence: `routes/dhcp_config_save.js`)
- Network operator → Config snapshots: views snapshots (evidence: `README.md`)
- Network operator → Service controls: controls service (evidence: `README.md`)
- Service controls → Admin authorization: checks access (evidence: `routes/dhcp_start_stop_restart.js`)
- Service controls → ISC DHCP server: runs service actions (evidence: `routes/dhcp_start_stop_restart.js`)
- Network operator → Alert settings: configures alerts (evidence: `README.md`)
- Alert settings → Admin authorization: checks access (evidence: `routes/glass_alerts.js`)
- Alert configuration → Admin authorization: checks access (evidence: `routes/glass_alert_settings_save.js`)
- Threshold alerting → Alert delivery: sends notifications (evidence: `app.js`)
- Alert delivery → Email, Slack, SMS: delivers alerts (evidence: `README.md`)
- Pool statistics → ISC DHCP server: measures pools (evidence: `routes/get_stats.js`)
