Skip to content

Site Architecture

The Control Center is a Multi-Page Application (MPA) built with Vite, Handlebars partials, and ES modules. Source in src/, built to dist/.

All colors, dimensions and shadows are defined in :root via CSS custom properties (--navy, --accent, --radius, etc.). Dark mode inverts the --gray-* and --bg/--white variables via the body.dark class.

Each page is a separate HTML file in src/pages/. The sidebar highlights the active page via data-page matching the URL path. Navigation is standard anchor links.

Permissions are managed via the Access Management page, backed by Cloudflare D1. Elements use the data-perm attribute (e.g. data-perm="page:operations"). On login, GET /api/access/role returns the user’s role, merged permissions, assigned sites, and profile info. JS adds .perm-granted to authorized elements.

RolePagesSSH / TUGA / Quick Access
adminAll pages (including Access, Setup, Logs, Trigger Settings)All SSH, TUGA, Quick Access
operatorOperations, Monitoring, API Health, Infra, Network, Troubleshoot, Codes, AI, DocSSH (main, proxy, rpidev), TUGA (all), QA (all)
viewerDashboard, Infra, Network, Troubleshoot, Codes, DocNone
indiaDashboard, Infra, Network, Troubleshoot, Codes, DocNone

Each user can have per-user overrides on top of their role. For example, a Viewer with override "page:mon": true will also see the Monitoring page.

CategoryKeys
Pages (15)page:dashboard, page:infra, page:network, page:troubleshoot, page:codes, page:escalation, page:operations, page:mon, page:api-health, page:logs, page:doc, page:ai, page:access, page:setup, page:trigger-settings
SSH (7)ssh:main, ssh:proxy, ssh:rpi1, ssh:rpi2, ssh:rpi3, ssh:rpi4, ssh:rpidev
Quick Access (3)qa:zabbix, qa:zippin, qa:unifi
TUGA Doors (4)tuga:door1, tuga:door2, tuga:door3, tuga:door4
MethodActionAccess
GET/api/access/role — caller’s profile + permissionsAll authenticated
GET?action=users — list all usersAdmin only
GET?action=roles — list all rolesAdmin only
GET?action=teams — list teams + members + sitesAdmin only
GET?action=team-requests — pending requestsAdmin only
POSTupsert-user — add/update userAdmin only
POSTdelete-user — remove userAdmin only
POSTupsert-role — edit role permissionsAdmin only
POSTapprove-team-request — approve join requestAdmin only
POSTdeny-team-request — deny join requestAdmin only