System Architecture Map
Visualizing the data flow and automation logic of the KR Eng Lab Status project.
graph TD
%% Styling Nodes
classDef frontend fill:#3b82f6,stroke:#1e40af,stroke-width:2px,color:#fff,rx:8,ry:8
classDef backend fill:#10b981,stroke:#047857,stroke-width:2px,color:#fff,rx:8,ry:8
classDef database fill:#f59e0b,stroke:#b45309,stroke-width:2px,color:#fff,rx:8,ry:8
classDef external fill:#8b5cf6,stroke:#5b21b6,stroke-width:2px,color:#fff,rx:8,ry:8
classDef logic fill:#475569,stroke:#334155,stroke-width:2px,color:#fff,stroke-dasharray: 5 5,rx:8,ry:8
subgraph "Frontend (UI Components)"
ED["Data Editor
(pages/editor.html)"]:::frontend
DB["Matrix Dashboard
(pages/equipment_dashboard.html)"]:::frontend
OV["Test Lab Overview
(pages/overview.html)"]:::frontend
PS["Project Status Gantt
(pages/project_status.html)"]:::frontend
SB["SB Lab Monitoring
(pages/sb_lab_status.html)"]:::frontend
end
subgraph "Backend API Server (server.py)"
API{"Python HTTP Server
(Port 5055)"}:::backend
LOGIC["Auto-Shift & Status Calculation
(Background Logic)"]:::logic
end
subgraph "Data Storage (JSON Files)"
JSON_EQ[("equipment.json
(Current State)")]:::database
JSON_HI[("history.json
(Archived Projects)")]:::database
end
subgraph "External Integration"
HA["Home Assistant
(WebSocket API)"]:::external
end
%% Connections
ED -- "1. POST /api/data
(User edits & saves)" --> API
API -- "2. Trigger Calculation" --> LOGIC
LOGIC -- "3. Overwrite & Shift Data" --> JSON_EQ
LOGIC -- "4. Archive Past Projects" --> JSON_HI
DB -. "GET /api/data (10m interval)" .-> API
OV -. "GET /api/data (1m interval)" .-> API
PS -. "GET /api/data (1m interval)" .-> API
ED -. "GET /api/data (On Load/Reload)" .-> API
API -- "Read Data" --> JSON_EQ
SB -- "WebSockets (Real-time IoT)" --> HA
SB -. "Reads Static Configs" .-> JSON_EQ
%% Click interactions (optional)
%% click ED "editor.html"