# dev1-fonzz/nexoraf-local-1010 architecture

> Architecture diagram of the GitHub repository dev1-fonzz/nexoraf-local-1010, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dev1-fonzz/nexoraf-local-1010
- Repository: https://github.com/dev1-fonzz/nexoraf-local-1010

## Overview

NEXoraF is a self-hosted ESP32 control console for hosted static sites, project databases, users, storage, backups, and optional GitHub/Vercel integrations. The principal workflow is an authenticated console request routed by firmware to domain managers, which validate and operate on SD-backed state before returning results. Import/export adds a review-and-confirm staging step; project deployment and token API access are distinct paths. The README documents the main capabilities, while several implementation links below are limited to that documentation because their source was not sampled.

Main entry points: [`firmware/src/main.cpp`](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/main.cpp) (HTTP API router), [`firmware/src/ImportExportManager.cpp`](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/ImportExportManager.cpp) (Import/export staging), [`firmware/src/IntegrationManager.cpp`](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/IntegrationManager.cpp) (GitHub and Vercel), [`firmware/src/ApiV1.cpp`](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/ApiV1.cpp) (Token REST API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Console and API"]
  node_webui["Web console<br/>[app.js]"]
  node_router["Console router<br/>[router.js]"]
  node_firmware["HTTP API router<br/>[main.cpp]"]
  node_api_v1["Token REST API<br/>[ApiV1.cpp]"]
  node_relay["Vercel relay<br/>[v1.js]"]
  node_relay_lib["Relay client<br/>[relay.js]"]
end

subgraph group_identity["Identity and Access"]
  node_auth["Sessions and RBAC<br/>[AuthManager.cpp]"]
  node_users[("User accounts<br/>[UserManager.cpp]")]
end

subgraph group_projects["Projects and Data"]
  node_projects[("Project registry<br/>[ProjectManager.cpp]")]
  node_hosting["Website hosting<br/>[HostingManager.cpp]"]
  node_database[("Project databases")]
  node_tokens[("Project tokens<br/>[TokenManager.cpp]")]
  node_imports["Import/export staging"]
  node_csv["CSV parsing<br/>[CsvParser.cpp]"]
  node_zipread["ZIP reading<br/>[ZipReader.cpp]"]
  node_zipwrite["ZIP writing<br/>[ZipWriter.cpp]"]
end

subgraph group_operations["Operations and Storage"]
  node_backups["Backups and restore<br/>[BackupManager.cpp]"]
  node_filesystem[("SD filesystem")]
  node_quotas["Project quotas<br/>[QuotaLogic.h]"]
  node_operations["Operations center<br/>[OperationLogic.h]"]
end

subgraph group_connectivity["Device and Integrations"]
  node_network["Network settings<br/>[NetworkManager.cpp]"]
  node_stations["Hotspot clients<br/>[StationManager.cpp]"]
  node_ota["Firmware updates<br/>[OtaManager.cpp]"]
  node_integrations["GitHub and Vercel"]
end

node_operator(("Console user"))
node_github{{"GitHub"}}
node_vercel{{"Vercel"}}

node_operator -->|"uses"| node_webui
node_webui -.->|"routes views"| node_router
node_router -.->|"requests API"| node_firmware
node_firmware -->|"routes authentication"| node_auth
node_auth -->|"verifies credentials"| node_users
node_firmware -->|"routes account requests"| node_users
node_firmware -->|"routes project requests"| node_projects
node_firmware -->|"serves hosted sites"| node_hosting
node_firmware -->|"routes database requests"| node_database
node_firmware -->|"routes token requests"| node_tokens
node_api_v1 -.->|"CRUDs records"| node_database
node_api_v1 -.->|"validates tokens"| node_tokens
node_relay -->|"delegates requests"| node_relay_lib
node_relay -->|"forwards API calls"| node_api_v1
node_firmware -->|"routes staged imports"| node_imports
node_imports -.->|"parses CSV"| node_csv
node_imports -.->|"reads archives"| node_zipread
node_imports -.->|"writes archives"| node_zipwrite
node_firmware -->|"routes backup actions"| node_backups
node_firmware -->|"routes file operations"| node_filesystem
node_projects -->|"uses SD storage"| node_filesystem
node_database -->|"checks project"| node_projects
node_backups -->|"uses file tree"| node_filesystem
node_firmware -->|"enforces limits"| node_quotas
node_firmware -->|"records operations"| node_operations
node_firmware -->|"routes network settings"| node_network
node_firmware -.->|"manages hotspot clients"| node_stations
node_firmware -->|"routes firmware updates"| node_ota
node_firmware -->|"routes deployment integrations"| node_integrations
node_integrations -->|"calls API"| node_github
node_integrations -->|"calls API"| node_vercel

click node_webui "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/web/app.js"
click node_router "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/web/js/router.js"
click node_firmware "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/main.cpp"
click node_api_v1 "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/ApiV1.cpp"
click node_relay "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/relay/api/v1.js"
click node_relay_lib "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/relay/lib/relay.js"
click node_auth "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/AuthManager.cpp"
click node_users "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/UserManager.cpp"
click node_projects "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/ProjectManager.cpp"
click node_hosting "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/HostingManager.cpp"
click node_database "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/DatabaseManager.cpp"
click node_tokens "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/TokenManager.cpp"
click node_imports "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/ImportExportManager.cpp"
click node_csv "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/CsvParser.cpp"
click node_zipread "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/ZipReader.cpp"
click node_zipwrite "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/ZipWriter.cpp"
click node_backups "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/BackupManager.cpp"
click node_filesystem "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/FilesystemManager.cpp"
click node_quotas "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/include/QuotaLogic.h"
click node_operations "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/include/OperationLogic.h"
click node_network "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/NetworkManager.cpp"
click node_stations "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/StationManager.cpp"
click node_ota "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/OtaManager.cpp"
click node_integrations "https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/IntegrationManager.cpp"

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_webui,node_router,node_firmware,node_api_v1,node_relay,node_relay_lib,node_operator toneBlue
class node_auth,node_users toneAmber
class node_projects,node_hosting,node_database,node_tokens,node_imports,node_csv,node_zipread,node_zipwrite toneMint
class node_backups,node_filesystem,node_quotas,node_operations toneRose
class node_network,node_stations,node_ota,node_integrations,node_github,node_vercel toneIndigo
```

## Components

### Console and API

- [Web console](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/web/app.js): `web/app.js`
- [Console router](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/web/js/router.js): `web/js/router.js`
- [HTTP API router](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/main.cpp): `firmware/src/main.cpp`
- [Token REST API](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/ApiV1.cpp): `firmware/src/ApiV1.cpp`
- [Vercel relay](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/relay/api/v1.js): `relay/api/v1.js`
- [Relay client](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/relay/lib/relay.js): `relay/lib/relay.js`

### Identity and Access

- [Sessions and RBAC](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/AuthManager.cpp): `firmware/src/AuthManager.cpp`
- [User accounts](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/UserManager.cpp): `firmware/src/UserManager.cpp`

### Projects and Data

- [Project registry](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/ProjectManager.cpp): `firmware/src/ProjectManager.cpp`
- [Website hosting](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/HostingManager.cpp): `firmware/src/HostingManager.cpp`
- [Project databases](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/DatabaseManager.cpp): `firmware/src/DatabaseManager.cpp`
- [Project tokens](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/TokenManager.cpp): `firmware/src/TokenManager.cpp`
- [Import/export staging](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/ImportExportManager.cpp): `firmware/src/ImportExportManager.cpp`
- [CSV parsing](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/CsvParser.cpp): `firmware/src/CsvParser.cpp`
- [ZIP reading](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/ZipReader.cpp): `firmware/src/ZipReader.cpp`
- [ZIP writing](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/ZipWriter.cpp): `firmware/src/ZipWriter.cpp`

### Operations and Storage

- [Backups and restore](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/BackupManager.cpp): `firmware/src/BackupManager.cpp`
- [SD filesystem](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/FilesystemManager.cpp): `firmware/src/FilesystemManager.cpp`
- [Project quotas](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/include/QuotaLogic.h): `firmware/include/QuotaLogic.h`
- [Operations center](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/include/OperationLogic.h): `firmware/include/OperationLogic.h`

### Device and Integrations

- [Network settings](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/NetworkManager.cpp): `firmware/src/NetworkManager.cpp`
- [Hotspot clients](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/StationManager.cpp): `firmware/src/StationManager.cpp`
- [Firmware updates](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/OtaManager.cpp): `firmware/src/OtaManager.cpp`
- [GitHub and Vercel](https://github.com/dev1-fonzz/nexoraf-local-1010/blob/main/firmware/src/IntegrationManager.cpp): `firmware/src/IntegrationManager.cpp`

### Other components

- **Console user**
- **GitHub**
- **Vercel**

## Connections

- Console user → Web console: uses
- Web console → Console router: routes views
- Console router → HTTP API router: requests API
- HTTP API router → Sessions and RBAC: routes authentication
- Sessions and RBAC → User accounts: verifies credentials
- HTTP API router → User accounts: routes account requests
- HTTP API router → Project registry: routes project requests
- HTTP API router → Website hosting: serves hosted sites
- HTTP API router → Project databases: routes database requests
- HTTP API router → Project tokens: routes token requests
- Token REST API → Project databases: CRUDs records
- Token REST API → Project tokens: validates tokens
- Vercel relay → Relay client: delegates requests (evidence: `relay/api/v1.js`)
- Vercel relay → Token REST API: forwards API calls
- HTTP API router → Import/export staging: routes staged imports
- Import/export staging → CSV parsing: parses CSV
- Import/export staging → ZIP reading: reads archives
- Import/export staging → ZIP writing: writes archives
- HTTP API router → Backups and restore: routes backup actions
- HTTP API router → SD filesystem: routes file operations (evidence: `firmware/src/main.cpp`)
- Project registry → SD filesystem: uses SD storage
- Project databases → Project registry: checks project
- Backups and restore → SD filesystem: uses file tree
- HTTP API router → Project quotas: enforces limits (evidence: `firmware/src/main.cpp`)
- HTTP API router → Operations center: records operations (evidence: `firmware/src/main.cpp`)
- HTTP API router → Network settings: routes network settings
- HTTP API router → Hotspot clients: manages hotspot clients
- HTTP API router → Firmware updates: routes firmware updates
- HTTP API router → GitHub and Vercel: routes deployment integrations
- GitHub and Vercel → GitHub: calls API (evidence: `firmware/src/IntegrationManager.cpp`)
- GitHub and Vercel → Vercel: calls API (evidence: `firmware/src/IntegrationManager.cpp`)
