The core architecture follows a robust design accommodating thousands of edge devices connecting in real time, managed out of a modern web interface.
graph TD
%% Web and API Layer
UI[Next.js Web UI] --> API[AWS API Gateway]
API --> Lambdas[Go Serverless Lambdas]
Lambdas --> DB[(Database)]
Lambdas --> Cognito[AWS Cognito & AVP]
Lambdas --> LLM[LLM / Chatbot Service]
%% Gateway Layer
UI -->|View/Command Devices| Controller
Lambdas <-->|PubSub Command Routing| Controller
subgraph Kubernetes Cluster
Controller[Go Socket Gateway / Controller]
end
%% Edge
subgraph Edge Environment
Agent[Go Device Agent]
Apps[Edge Marketplace Apps]
Agent --> Apps
end
Agent <-->|Persistent Socket / mTLS| Controller
- Web UI (
apps/web): Next.js application that serves as the dashboard. It communicates entirely with the AWS API Gateway over standard HTTPS. - REST API (
apps/api): Go code hosted as AWS Serverless Lambdas, minimizing cost during idle periods while providing instant scaling. - Device Controller (
apps/controller): A continuous process running on Kubernetes. Necessary because AWS Lambda is not built to hold persistent WebSocket connections indefinitely. It holds the socket open, queues commands, and relays immediate telemetry. - Device Agent (
apps/device-agent): A highly optimized Go binary sitting on target host hardware at the edge.