# atharvghavare/wifisense architecture

> Architecture diagram of the GitHub repository atharvghavare/wifisense, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/atharvghavare/wifisense
- Repository: https://github.com/atharvghavare/wifisense

## Overview

π WiFiSense turns radio disturbances into room-level sensing: ESP32 nodes capture WiFi CSI, sensing pipelines infer occupancy, pose, activity and vital signs, and user interfaces present the results. The README also describes model training/loading, privacy-governed evidence, edge execution, and HOMECORE smart-home automation and ecosystem bridges. The graph preserves those documented branches; several runtime connections rely on README descriptions because their implementation was not sampled.

Main entry points: [`ui/components/LiveDemoTab.js`](https://github.com/atharvghavare/wifisense/blob/main/ui/components/LiveDemoTab.js) (Live sensing UI), [`v2/crates/wifi-densepose-pointcloud/src/csi_pipeline.rs`](https://github.com/atharvghavare/wifisense/blob/main/v2/crates/wifi-densepose-pointcloud/src/csi_pipeline.rs) (CSI processing), [`v2/crates/wifi-densepose-sensing-server/src/rvf_pipeline.rs`](https://github.com/atharvghavare/wifisense/blob/main/v2/crates/wifi-densepose-sensing-server/src/rvf_pipeline.rs) (Sensing server), [`ui/app.js`](https://github.com/atharvghavare/wifisense/blob/main/ui/app.js) (Dashboard entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sensing["Sensing and Inference"]
  node_csi_pipeline["CSI processing<br/>[csi_pipeline.rs]"]
  node_physics["Pose physics<br/>[engine.rs]"]
  node_sensing_server["Sensing server<br/>[rvf_pipeline.rs]"]
end

subgraph group_edge["Edge and Privacy"]
  node_esp32["ESP32 CSI node<br/>[csi_collector.c]"]
  node_adaptive["Adaptive sensing"]
  node_feature_state["Feature state<br/>[rv_feature_state.h]"]
  node_radio_ops["Radio operations<br/>[rv_radio_ops.h]"]
  node_veil["Privacy shield<br/>[veil_shield.h]"]
  node_ris_controller["RIS controller"]
end

subgraph group_models["Models and Calibration"]
  node_rvf_container["RVF container<br/>[rvf_container.rs]"]
  node_calibration["Calibration<br/>[calibrate.py]"]
end

subgraph group_experience["User Interfaces"]
  node_training_ui["Model workflow UI<br/>[TrainingPanel.js]"]
  node_live_ui["Live sensing UI<br/>[LiveDemoTab.js]"]
  node_pose_canvas["Pose visualization"]
  node_dashboard_app["Dashboard entry<br/>[app.js]"]
  node_health["Health monitoring<br/>[health.service.js]"]
  node_pose_service["Pose service<br/>[pose.service.js]"]
  node_sensing_service["Sensing service<br/>[sensing.service.js]"]
  node_websocket_service["WebSocket service"]
end

subgraph group_automation["Automation and Integrations"]
  node_automation["Automation engine<br/>[engine.rs]"]
  node_ha_matter["Home Matter bridge<br/>[runtime.rs]"]
  node_home_ecosystems(("Smart-home ecosystems"))
end

node_person(("Room occupant"))
node_user(("Operator"))

node_person -->|"disturbs radio"| node_esp32
node_esp32 -.->|"streams CSI"| node_csi_pipeline
node_adaptive -->|"controls radio"| node_radio_ops
node_adaptive -->|"reads state"| node_feature_state
node_csi_pipeline -.->|"refines pose"| node_physics
node_csi_pipeline -.->|"serves sensing"| node_sensing_server
node_sensing_server -->|"builds models"| node_rvf_container
node_user -->|"views results"| node_dashboard_app
node_dashboard_app -->|"initializes"| node_live_ui
node_dashboard_app -->|"starts monitoring"| node_health
node_live_ui -->|"requests pose"| node_pose_service
node_live_ui -->|"requests sensing"| node_sensing_service
node_live_ui -->|"streams updates"| node_websocket_service
node_live_ui -->|"renders pose"| node_pose_canvas
node_user -->|"trains models"| node_training_ui
node_training_ui -.->|"loads RVF"| node_rvf_container
node_user -->|"calibrates sensing"| node_calibration
node_csi_pipeline -.->|"applies privacy"| node_veil
node_veil -.->|"configures surface"| node_ris_controller
node_sensing_server -.->|"provides room states"| node_automation
node_automation -.->|"exposes automation"| node_ha_matter
node_ha_matter -->|"bridges Matter"| node_home_ecosystems

click node_esp32 "https://github.com/atharvghavare/wifisense/blob/main/firmware/esp32-csi-node/main/csi_collector.c"
click node_adaptive "https://github.com/atharvghavare/wifisense/blob/main/firmware/esp32-csi-node/main/adaptive_controller.c"
click node_feature_state "https://github.com/atharvghavare/wifisense/blob/main/firmware/esp32-csi-node/main/rv_feature_state.h"
click node_radio_ops "https://github.com/atharvghavare/wifisense/blob/main/firmware/esp32-csi-node/main/rv_radio_ops.h"
click node_veil "https://github.com/atharvghavare/wifisense/blob/main/wifi-veil/firmware/core/veil_shield.h"
click node_ris_controller "https://github.com/atharvghavare/wifisense/blob/main/wifi-veil/firmware/esp32/veil_ris_controller/veil_ris_controller.c"
click node_csi_pipeline "https://github.com/atharvghavare/wifisense/blob/main/v2/crates/wifi-densepose-pointcloud/src/csi_pipeline.rs"
click node_physics "https://github.com/atharvghavare/wifisense/blob/main/v2/crates/wifi-densepose-physics/src/engine.rs"
click node_sensing_server "https://github.com/atharvghavare/wifisense/blob/main/v2/crates/wifi-densepose-sensing-server/src/rvf_pipeline.rs"
click node_rvf_container "https://github.com/atharvghavare/wifisense/blob/main/v2/crates/wifi-densepose-sensing-server/src/rvf_container.rs"
click node_training_ui "https://github.com/atharvghavare/wifisense/blob/main/ui/components/TrainingPanel.js"
click node_live_ui "https://github.com/atharvghavare/wifisense/blob/main/ui/components/LiveDemoTab.js"
click node_pose_canvas "https://github.com/atharvghavare/wifisense/blob/main/ui/components/PoseDetectionCanvas.js"
click node_dashboard_app "https://github.com/atharvghavare/wifisense/blob/main/ui/app.js"
click node_health "https://github.com/atharvghavare/wifisense/blob/main/ui/services/health.service.js"
click node_pose_service "https://github.com/atharvghavare/wifisense/blob/main/ui/services/pose.service.js"
click node_sensing_service "https://github.com/atharvghavare/wifisense/blob/main/ui/services/sensing.service.js"
click node_websocket_service "https://github.com/atharvghavare/wifisense/blob/main/ui/services/websocket.service.js"
click node_calibration "https://github.com/atharvghavare/wifisense/blob/main/aether-arena/calibration/calibrate.py"
click node_automation "https://github.com/atharvghavare/wifisense/blob/main/v2/crates/homecore-automation/src/engine.rs"
click node_ha_matter "https://github.com/atharvghavare/wifisense/blob/main/v2/crates/cog-ha-matter/src/runtime.rs"

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_csi_pipeline,node_physics,node_sensing_server toneBlue
class node_esp32,node_adaptive,node_feature_state,node_radio_ops,node_veil,node_ris_controller toneAmber
class node_rvf_container,node_calibration toneMint
class node_training_ui,node_live_ui,node_pose_canvas,node_dashboard_app,node_health,node_pose_service,node_sensing_service,node_websocket_service toneRose
class node_automation,node_ha_matter,node_home_ecosystems,node_person,node_user toneIndigo
```

## Components

### Sensing and Inference

- [CSI processing](https://github.com/atharvghavare/wifisense/blob/main/v2/crates/wifi-densepose-pointcloud/src/csi_pipeline.rs): `v2/crates/wifi-densepose-pointcloud/src/csi_pipeline.rs`
- [Pose physics](https://github.com/atharvghavare/wifisense/blob/main/v2/crates/wifi-densepose-physics/src/engine.rs): `v2/crates/wifi-densepose-physics/src/engine.rs`
- [Sensing server](https://github.com/atharvghavare/wifisense/blob/main/v2/crates/wifi-densepose-sensing-server/src/rvf_pipeline.rs): `v2/crates/wifi-densepose-sensing-server/src/rvf_pipeline.rs`

### Edge and Privacy

- [ESP32 CSI node](https://github.com/atharvghavare/wifisense/blob/main/firmware/esp32-csi-node/main/csi_collector.c): `firmware/esp32-csi-node/main/csi_collector.c`
- [Adaptive sensing](https://github.com/atharvghavare/wifisense/blob/main/firmware/esp32-csi-node/main/adaptive_controller.c): `firmware/esp32-csi-node/main/adaptive_controller.c`
- [Feature state](https://github.com/atharvghavare/wifisense/blob/main/firmware/esp32-csi-node/main/rv_feature_state.h): `firmware/esp32-csi-node/main/rv_feature_state.h`
- [Radio operations](https://github.com/atharvghavare/wifisense/blob/main/firmware/esp32-csi-node/main/rv_radio_ops.h): `firmware/esp32-csi-node/main/rv_radio_ops.h`
- [Privacy shield](https://github.com/atharvghavare/wifisense/blob/main/wifi-veil/firmware/core/veil_shield.h): `wifi-veil/firmware/core/veil_shield.h`
- [RIS controller](https://github.com/atharvghavare/wifisense/blob/main/wifi-veil/firmware/esp32/veil_ris_controller/veil_ris_controller.c): `wifi-veil/firmware/esp32/veil_ris_controller/veil_ris_controller.c`

### Models and Calibration

- [RVF container](https://github.com/atharvghavare/wifisense/blob/main/v2/crates/wifi-densepose-sensing-server/src/rvf_container.rs): `v2/crates/wifi-densepose-sensing-server/src/rvf_container.rs`
- [Calibration](https://github.com/atharvghavare/wifisense/blob/main/aether-arena/calibration/calibrate.py): `aether-arena/calibration/calibrate.py`

### User Interfaces

- [Model workflow UI](https://github.com/atharvghavare/wifisense/blob/main/ui/components/TrainingPanel.js): `ui/components/TrainingPanel.js`
- [Live sensing UI](https://github.com/atharvghavare/wifisense/blob/main/ui/components/LiveDemoTab.js): `ui/components/LiveDemoTab.js`
- [Pose visualization](https://github.com/atharvghavare/wifisense/blob/main/ui/components/PoseDetectionCanvas.js): `ui/components/PoseDetectionCanvas.js`
- [Dashboard entry](https://github.com/atharvghavare/wifisense/blob/main/ui/app.js): `ui/app.js`
- [Health monitoring](https://github.com/atharvghavare/wifisense/blob/main/ui/services/health.service.js): `ui/services/health.service.js`
- [Pose service](https://github.com/atharvghavare/wifisense/blob/main/ui/services/pose.service.js): `ui/services/pose.service.js`
- [Sensing service](https://github.com/atharvghavare/wifisense/blob/main/ui/services/sensing.service.js): `ui/services/sensing.service.js`
- [WebSocket service](https://github.com/atharvghavare/wifisense/blob/main/ui/services/websocket.service.js): `ui/services/websocket.service.js`

### Automation and Integrations

- [Automation engine](https://github.com/atharvghavare/wifisense/blob/main/v2/crates/homecore-automation/src/engine.rs): `v2/crates/homecore-automation/src/engine.rs`
- [Home Matter bridge](https://github.com/atharvghavare/wifisense/blob/main/v2/crates/cog-ha-matter/src/runtime.rs): `v2/crates/cog-ha-matter/src/runtime.rs`
- **Smart-home ecosystems**

### Other components

- **Room occupant**
- **Operator**

## Connections

- Room occupant → ESP32 CSI node: disturbs radio (evidence: `README.md`)
- ESP32 CSI node → CSI processing: streams CSI
- Adaptive sensing → Radio operations: controls radio (evidence: `firmware/esp32-csi-node/main/adaptive_controller.c`)
- Adaptive sensing → Feature state: reads state (evidence: `firmware/esp32-csi-node/main/adaptive_controller.c`)
- CSI processing → Pose physics: refines pose
- CSI processing → Sensing server: serves sensing
- Sensing server → RVF container: builds models (evidence: `v2/crates/wifi-densepose-sensing-server/src/rvf_pipeline.rs`)
- Operator → Dashboard entry: views results (evidence: `README.md`)
- Dashboard entry → Live sensing UI: initializes (evidence: `ui/app.js`)
- Dashboard entry → Health monitoring: starts monitoring (evidence: `ui/app.js`)
- Live sensing UI → Pose service: requests pose (evidence: `ui/components/LiveDemoTab.js`)
- Live sensing UI → Sensing service: requests sensing (evidence: `ui/components/LiveDemoTab.js`)
- Live sensing UI → WebSocket service: streams updates (evidence: `ui/components/LiveDemoTab.js`)
- Live sensing UI → Pose visualization: renders pose (evidence: `ui/components/LiveDemoTab.js`)
- Operator → Model workflow UI: trains models (evidence: `README.md`)
- Model workflow UI → RVF container: loads RVF
- Operator → Calibration: calibrates sensing (evidence: `README.md`)
- CSI processing → Privacy shield: applies privacy
- Privacy shield → RIS controller: configures surface (evidence: `wifi-veil/firmware/esp32/veil_ris_controller/veil_ris_controller.c`)
- Sensing server → Automation engine: provides room states
- Automation engine → Home Matter bridge: exposes automation
- Home Matter bridge → Smart-home ecosystems: bridges Matter (evidence: `README.md`)
