Back to Ruview

.Issue 177 Body

docs/adr/.issue-177-body.md

0.7.07.5 KB
Original Source

Introduction

RuView is a WiFi-based human pose estimation system built on ESP32 CSI (Channel State Information). Today, managing a RuView deployment requires juggling 6+ disconnected CLI tools: esptool.py for flashing, provision.py for NVS configuration, curl for OTA and WASM management, cargo run for the sensing server, a browser for visualization, and manual IP tracking for node discovery. There is no single tool that provides a unified view of the entire deployment — from ESP32 hardware through the sensing pipeline to pose visualization.

This issue tracks the implementation of RuView Desktop — a Tauri v2 cross-platform desktop application that replaces all of these tools with a single, cohesive interface. The application is designed as the control plane for the RuView platform, managing the full lifecycle: discover, flash, provision, OTA, load WASM, observe sensing.

Why Tauri (Not Electron/Flutter/Web)

RequirementWhy Desktop is Required
Serial port accessBrowser/PWA cannot touch COM/tty ports for firmware flashing
Raw UDP socketsNode discovery via broadcast probes requires raw socket access
Filesystem accessFirmware binaries, WASM modules, model files live on local disk
Process managementSensing server runs as a managed child process (sidecar)
Small binaryTauri ~20 MB vs Electron ~150 MB
Rust integrationShares crates with existing workspace

UI Design Language

The frontend uses a Foundation Book design scheme with Unity Editor-inspired UI panels. Think: clean typographic hierarchy, structured panels with dockable regions, monospaced data displays, and a professional dark theme with accent colors for status indicators. Powered by rUv.


ADR-052 Deep Overview

The full architecture is documented in ADR-052 with a companion DDD bounded contexts appendix.

Workspace Integration

The desktop app is a new Rust crate (wifi-densepose-desktop) in the existing workspace, sharing types with the sensing server and hardware crate. The frontend uses React + Vite + TypeScript with a Foundation Book / Unity-inspired design system.

6 Rust Command Groups

GroupCommandsBounded Context
Discoverydiscover_nodes, get_node_status, watch_nodesDevice Discovery
Flashlist_serial_ports, flash_firmware, read_chip_infoFirmware Management
OTAota_update, ota_status, ota_batch_updateFirmware Management
WASMwasm_list, wasm_upload, wasm_controlEdge Module
Serverstart_server, stop_server, server_statusSensing Pipeline
Provisionprovision_node, read_nvsConfiguration

7 Frontend Pages

PagePurpose
DashboardNode count (online/offline), server status, quick actions, activity feed
Node DetailSingle node deep-dive: firmware, health, TDM config, WASM modules
Flash Firmware3-step wizard: select port, select firmware, flash with progress bar
WASM ModulesDrag-and-drop upload, module list with start/stop/unload
Sensing ViewLive CSI heatmap, pose skeleton overlay, vital signs
Mesh TopologyForce-directed graph: TDM slots, sync drift, node health
SettingsServer ports, bind address, OTA PSK, UI theme

DDD Bounded Contexts

6 bounded contexts with 9 aggregates, 25+ domain events, and 3 anti-corruption layers. See the DDD appendix for full details.

ContextAggregate Root(s)Key Events
Device DiscoveryNodeRegistryNodeDiscovered, NodeWentOffline, ScanCompleted
Firmware ManagementFlashSession, OtaSession, BatchOtaSessionFlashProgress, OtaCompleted, BatchOtaCompleted
ConfigurationProvisioningSessionNodeProvisioned, ConfigReadBack
Sensing PipelineSensingServer, WebSocketSessionServerStarted, FrameReceived
Edge Module (WASM)ModuleRegistryModuleUploaded, ModuleStarted
VisualizationQuery model (no aggregate)Consumes all upstream events

Persistent Node Registry

Stored in ~/.ruview/nodes.db (SQLite). On startup, previously known nodes load as Offline and reconcile against fresh discovery. The app remembers the mesh across restarts.

OTA Safety Gate

The TdmSafe rolling update strategy updates even-slot nodes first, then odd-slot nodes, ensuring adjacent nodes are never offline simultaneously during mesh-wide firmware updates.

Platform-Specific Considerations

PlatformConcernSolution
macOSUSB serial drivers need signing on Sequoia+Document driver requirements
WindowsCOM port naming, UACAuto-detect via registry
LinuxSerial port permissionsBundle udev rules installer

Implementation Phases

PhaseScopePriority
1. SkeletonTauri scaffolding, workspace integration, React windowP0
2. DiscoverySerial ports, node discovery, dashboard cardsP0
3. Flashespflash integration, flashing wizardP0
4. ServerSidecar sensing server, log viewerP1
5. OTAHTTP OTA with PSK auth, batch TdmSafeP1
6. ProvisioningNVS GUI form, read-back, mesh presetsP1
7. WASMModule upload/list/controlP2
8. SensingWebSocket, live charts, pose overlayP2
9. Mesh ViewTopology graph, TDM visualizationP2
10. PolishApp signing, auto-update, onboarding wizardP3

Total estimated effort: ~11 weeks for a single developer.

Acceptance Criteria

  • Tauri app builds on Windows, macOS, Linux
  • Can discover ESP32 nodes on local network
  • Node registry persists across restarts
  • Can flash firmware via serial port (no Python dependency)
  • Can push OTA updates with PSK authentication
  • Rolling OTA with TdmSafe strategy for mesh deployments
  • Can upload/manage WASM modules on nodes
  • Can start/stop sensing server and view live logs
  • Can view real-time sensing data via WebSocket
  • Can provision NVS config via GUI form
  • Mesh topology visualization shows TDM slots and health
  • Binary size less than 30 MB
  • Foundation Book / Unity-inspired UI design system
  • Each new Rust module has unit tests

Dependencies

  • ADR-012: ESP32 CSI Sensor Mesh
  • ADR-039: ESP32 Edge Intelligence
  • ADR-040: WASM Programmable Sensing
  • ADR-044: Provisioning Tool Enhancements
  • ADR-050: Quality Engineering Security Hardening
  • ADR-051: Sensing Server Decomposition
  • ADR-053: UI Design System (Foundation Book + Unity-inspired)

Branch

feat/tauri-desktop-frontend

References

Powered by rUv