docs: add websocket push roadmap
This commit is contained in:
@@ -294,3 +294,20 @@ Transition strategy:
|
||||
- Bench test LilyGO relay boot behavior before connecting it to the WUPP block.
|
||||
|
||||
The API should not require redesign when moving from 2 outputs to 6 outputs.
|
||||
|
||||
## Planned WebSocket Push Layer
|
||||
|
||||
The project may add a WebSocket push layer in addition to the current `/api/v1` REST API. This is intended as an additive transport, not a replacement for the REST API.
|
||||
|
||||
Recommended model:
|
||||
|
||||
```text
|
||||
Dashboard ESP <-- WebSocket /ws live status -- Cargo ESP
|
||||
Dashboard ESP -- REST /api/v1 relay commands -> Cargo ESP
|
||||
Dashboard ESP -- REST /api/v1/status fallback -> Cargo ESP
|
||||
```
|
||||
|
||||
The REST API remains the canonical, human-debuggable contract for snapshots, testing, and compatibility. WebSockets should be used for live status pushes so dashboard UI elements can update immediately after sensor changes, relay state changes, and future vehicle telemetry updates.
|
||||
|
||||
Initial implementation should preserve existing polling as a fallback path. If the WebSocket connection is unavailable or stale, the dashboard should continue to use `/api/v1/status`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user