# vinitpatil519/sentinel architecture

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

- Interactive diagram: https://gitdiagram.com/vinitpatil519/sentinel
- Repository: https://github.com/vinitpatil519/sentinel

## Overview

SENTINEL turns WiFi CSI sensing into per-subject vitals, behavioral states, and a safety-biased approach advisory, then presents live operations and research records in a console. The principal flow runs from ESP32 nodes through the external RuView sensing server, backend normalization and analysis, and the console; SQLite supports session history, exports, and labeling. The README documents console capabilities whose individual frontend implementations were not sampled, so those are represented at their listed paths; detailed wiring among some components remains unverified.

Main entry points: [`backend/sentinel/main.py`](https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/main.py) (Application runtime), [`backend/sentinel/core/telemetry.py`](https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/core/telemetry.py) (Telemetry hub), [`backend/sentinel/core/pipeline.py`](https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/core/pipeline.py) (Frame pipeline), [`backend/sentinel/sensors/ruview_rf.py`](https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/sensors/ruview_rf.py) (RuView adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sensing["Sensing input"]
  node_esp32["ESP32 CSI nodes<br/>[app_main.c]"]
  node_ruview["RuView sensing server"]
  node_adapter["RuView adapter<br/>[ruview_rf.py]"]
  node_sensorbase["Sensor abstraction<br/>[base.py]"]
end

subgraph group_analysis["Analysis pipeline"]
  node_pipeline["Frame pipeline<br/>[pipeline.py]"]
  node_dsp["Signal processing<br/>[dsp.py]"]
  node_vitals["Vitals estimation<br/>[vitals.py]"]
  node_tracks["Subject tracking<br/>[tracks.py]"]
  node_assessment["State and advisory<br/>[assessment.py]"]
  node_events["Event engine<br/>[events.py]"]
end

subgraph group_backend["Backend services"]
  node_main["Application runtime<br/>[main.py]"]
  node_settings["Configuration<br/>[settings.py]"]
  node_hub["Telemetry hub<br/>[telemetry.py]"]
  node_api["HTTP and WebSocket API<br/>[routes.py]"]
end

subgraph group_console["Operator console"]
  node_console["Six-screen console"]
  node_shell["Console shell<br/>[Shell.tsx]"]
  node_volume["3-D sensing volume<br/>[VolumeScene.tsx]"]
  node_panels["Console panels"]
end

subgraph group_research["Research records"]
  node_database[("Session database<br/>[db.py]")]
  node_simulation["Scenario simulator<br/>[scenario.py]"]
  node_evaluation["Model evaluation<br/>[evaluation.py]"]
end

node_operator(("Operator"))

node_operator -->|"views and labels"| node_console
node_esp32 -->|"sends CSI"| node_ruview
node_ruview -->|"streams sensing updates"| node_adapter
node_adapter -->|"publishes frames"| node_hub
node_sensorbase -->|"defines sensor contract"| node_adapter
node_main -->|"loads configuration"| node_settings
node_main -->|"starts sensors"| node_adapter
node_main -->|"creates pipeline"| node_pipeline
node_main -->|"creates hub"| node_hub
node_main -->|"starts event engine"| node_events
node_main -->|"opens and closes"| node_database
node_pipeline -->|"publishes derived channels"| node_hub
node_pipeline -->|"ingests frames"| node_tracks
node_tracks -.->|"estimates per-subject vitals"| node_vitals
node_tracks -.->|"assesses tracks"| node_assessment
node_vitals -->|"uses signal processing"| node_dsp
node_assessment -.->|"uses signal features"| node_dsp
node_assessment -.->|"uses vital features"| node_vitals
node_api -->|"reads live channels"| node_hub
node_api -->|"queries history"| node_database
node_hub -->|"taps telemetry"| node_database
node_hub -->|"streams telemetry"| node_console
node_api -.->|"serves console API"| node_console
node_console -.->|"renders screens"| node_shell
node_shell -.->|"renders sensing volume"| node_volume
node_shell -.->|"renders panels"| node_panels
node_simulation -.->|"supplies simulated frames"| node_pipeline
node_evaluation -->|"evaluates pipeline"| node_pipeline
node_evaluation -->|"scores scenarios"| node_simulation

click node_esp32 "https://github.com/vinitpatil519/sentinel/blob/main/hardware/esp32-csi-node/main/app_main.c"
click node_adapter "https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/sensors/ruview_rf.py"
click node_sensorbase "https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/sensors/base.py"
click node_pipeline "https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/core/pipeline.py"
click node_dsp "https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/core/dsp.py"
click node_vitals "https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/core/vitals.py"
click node_tracks "https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/core/tracks.py"
click node_assessment "https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/core/assessment.py"
click node_events "https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/core/events.py"
click node_main "https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/main.py"
click node_settings "https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/config/settings.py"
click node_hub "https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/core/telemetry.py"
click node_api "https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/api/routes.py"
click node_console "https://github.com/vinitpatil519/sentinel/tree/main/frontend/src/app"
click node_shell "https://github.com/vinitpatil519/sentinel/blob/main/frontend/src/components/Shell.tsx"
click node_volume "https://github.com/vinitpatil519/sentinel/blob/main/frontend/src/components/VolumeScene.tsx"
click node_panels "https://github.com/vinitpatil519/sentinel/tree/main/frontend/src/components/panels"
click node_database "https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/database/db.py"
click node_simulation "https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/simulation/scenario.py"
click node_evaluation "https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/evaluation.py"

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_esp32,node_ruview,node_adapter,node_sensorbase toneBlue
class node_pipeline,node_dsp,node_vitals,node_tracks,node_assessment,node_events toneAmber
class node_main,node_settings,node_hub,node_api toneMint
class node_console,node_shell,node_volume,node_panels toneRose
class node_database,node_simulation,node_evaluation,node_operator toneIndigo
```

## Components

### Sensing input

- [ESP32 CSI nodes](https://github.com/vinitpatil519/sentinel/blob/main/hardware/esp32-csi-node/main/app_main.c): `hardware/esp32-csi-node/main/app_main.c`
- **RuView sensing server**
- [RuView adapter](https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/sensors/ruview_rf.py): `backend/sentinel/sensors/ruview_rf.py`
- [Sensor abstraction](https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/sensors/base.py): `backend/sentinel/sensors/base.py`

### Analysis pipeline

- [Frame pipeline](https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/core/pipeline.py): `backend/sentinel/core/pipeline.py`
- [Signal processing](https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/core/dsp.py): `backend/sentinel/core/dsp.py`
- [Vitals estimation](https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/core/vitals.py): `backend/sentinel/core/vitals.py`
- [Subject tracking](https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/core/tracks.py): `backend/sentinel/core/tracks.py`
- [State and advisory](https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/core/assessment.py): `backend/sentinel/core/assessment.py`
- [Event engine](https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/core/events.py): `backend/sentinel/core/events.py`

### Backend services

- [Application runtime](https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/main.py): `backend/sentinel/main.py`
- [Configuration](https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/config/settings.py): `backend/sentinel/config/settings.py`
- [Telemetry hub](https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/core/telemetry.py): `backend/sentinel/core/telemetry.py`
- [HTTP and WebSocket API](https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/api/routes.py): `backend/sentinel/api/routes.py`

### Operator console

- [Six-screen console](https://github.com/vinitpatil519/sentinel/tree/main/frontend/src/app): `frontend/src/app`
- [Console shell](https://github.com/vinitpatil519/sentinel/blob/main/frontend/src/components/Shell.tsx): `frontend/src/components/Shell.tsx`
- [3-D sensing volume](https://github.com/vinitpatil519/sentinel/blob/main/frontend/src/components/VolumeScene.tsx): `frontend/src/components/VolumeScene.tsx`
- [Console panels](https://github.com/vinitpatil519/sentinel/tree/main/frontend/src/components/panels): `frontend/src/components/panels`

### Research records

- [Session database](https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/database/db.py): `backend/sentinel/database/db.py`
- [Scenario simulator](https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/simulation/scenario.py): `backend/sentinel/simulation/scenario.py`
- [Model evaluation](https://github.com/vinitpatil519/sentinel/blob/main/backend/sentinel/evaluation.py): `backend/sentinel/evaluation.py`

### Other components

- **Operator**

## Connections

- Operator → Six-screen console: views and labels (evidence: `README.md`)
- ESP32 CSI nodes → RuView sensing server: sends CSI (evidence: `README.md`)
- RuView sensing server → RuView adapter: streams sensing updates (evidence: `README.md`)
- RuView adapter → Telemetry hub: publishes frames (evidence: `backend/sentinel/sensors/ruview_rf.py`)
- Sensor abstraction → RuView adapter: defines sensor contract (evidence: `backend/sentinel/sensors/__init__.py`)
- Application runtime → Configuration: loads configuration (evidence: `backend/sentinel/main.py`)
- Application runtime → RuView adapter: starts sensors (evidence: `backend/sentinel/main.py`)
- Application runtime → Frame pipeline: creates pipeline (evidence: `backend/sentinel/main.py`)
- Application runtime → Telemetry hub: creates hub (evidence: `backend/sentinel/main.py`)
- Application runtime → Event engine: starts event engine (evidence: `backend/sentinel/main.py`)
- Application runtime → Session database: opens and closes (evidence: `backend/sentinel/main.py`)
- Frame pipeline → Telemetry hub: publishes derived channels (evidence: `backend/sentinel/core/pipeline.py`)
- Frame pipeline → Subject tracking: ingests frames (evidence: `backend/sentinel/core/pipeline.py`)
- Subject tracking → Vitals estimation: estimates per-subject vitals (evidence: `backend/sentinel/core/tracks.py`)
- Subject tracking → State and advisory: assesses tracks (evidence: `backend/sentinel/core/tracks.py`)
- Vitals estimation → Signal processing: uses signal processing (evidence: `backend/sentinel/core/vitals.py`)
- State and advisory → Signal processing: uses signal features (evidence: `backend/sentinel/core/assessment.py`)
- State and advisory → Vitals estimation: uses vital features (evidence: `backend/sentinel/core/assessment.py`)
- HTTP and WebSocket API → Telemetry hub: reads live channels (evidence: `backend/sentinel/api/routes.py`)
- HTTP and WebSocket API → Session database: queries history (evidence: `backend/sentinel/api/routes.py`)
- Telemetry hub → Session database: taps telemetry (evidence: `backend/sentinel/main.py`)
- Telemetry hub → Six-screen console: streams telemetry (evidence: `README.md`)
- HTTP and WebSocket API → Six-screen console: serves console API
- Six-screen console → Console shell: renders screens
- Console shell → 3-D sensing volume: renders sensing volume
- Console shell → Console panels: renders panels
- Scenario simulator → Frame pipeline: supplies simulated frames
- Model evaluation → Frame pipeline: evaluates pipeline (evidence: `backend/sentinel/evaluation.py`)
- Model evaluation → Scenario simulator: scores scenarios (evidence: `backend/sentinel/evaluation.py`)
