# nilimkr/jeevone architecture

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

- Interactive diagram: https://gitdiagram.com/nilimkr/jeevone
- Repository: https://github.com/nilimkr/jeevone

## Overview

JEEVONE is an offline edge health-monitoring service. Sensor readings arrive over MQTT, pass through validation and normalization, are persisted and processed into features and risk assessments, then drive alerts and local API/dashboard updates. The graph preserves the README’s major product stages and capabilities. Pipeline orchestration is visible only in partial excerpts; documented but unsampled links are identified as such rather than treated as inspected implementation.

Main entry points: [`app/main.py`](https://github.com/nilimkr/jeevone/blob/main/app/main.py) (Pipeline Orchestrator), [`app/api/routes.py`](https://github.com/nilimkr/jeevone/blob/main/app/api/routes.py) (REST API), [`app/processing/features.py`](https://github.com/nilimkr/jeevone/blob/main/app/processing/features.py) (Feature Extraction), [`app/config_loader.py`](https://github.com/nilimkr/jeevone/blob/main/app/config_loader.py) (Configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Sensor Ingestion"]
  node_mqtt["MQTT Client<br/>[client.py]"]
  node_validator["Payload Validator<br/>[validator.py]"]
  node_normalizer["Reading Normalizer<br/>[normalizer.py]"]
  node_processor["Ingestion Processor<br/>[processor.py]"]
end

subgraph group_analysis["Health Analysis"]
  node_main["Pipeline Orchestrator<br/>[main.py]"]
  node_windows["Sliding Windows<br/>[windows.py]"]
  node_baseline["Personal Baseline<br/>[baseline.py]"]
  node_features["Feature Extraction<br/>[features.py]"]
  node_heat["Heat Risk<br/>[heat.py]"]
  node_vital["Vital Risk<br/>[vital.py]"]
  node_respiratory["Respiratory Risk<br/>[respiratory.py]"]
  node_fusion["Risk Fusion<br/>[fusion.py]"]
  node_recommendations["Recommendations<br/>[recommendations.py]"]
end

subgraph group_state["State and Storage"]
  node_state["In-memory Pipeline State<br/>[pipeline_state.py]"]
  node_database[("SQLite Database<br/>[database.py]")]
  node_repository["Storage Repository<br/>[repository.py]"]
  node_models["Storage Models<br/>[models.py]"]
  node_config["Configuration<br/>[config_loader.py]"]
end

subgraph group_delivery["Local Delivery"]
  node_alerts["Alert Manager<br/>[manager.py]"]
  node_api["REST API<br/>[routes.py]"]
  node_stream["Live Update Stream<br/>[websocket.py]"]
  node_dashboard["Local Dashboard<br/>[index.html]"]
end

node_sensors(("Health Sensors"))
node_esp32["ESP32 Gateway<br/>[ESP32_Gateway.ino]"]
node_broker["MQTT Broker"]

node_sensors -->|"provide readings"| node_esp32
node_esp32 -->|"publishes MQTT"| node_broker
node_broker -->|"delivers messages"| node_mqtt
node_mqtt -->|"message callback"| node_main
node_main -->|"processes payload"| node_processor
node_processor -->|"validates payload"| node_validator
node_processor -->|"normalizes payload"| node_normalizer
node_main -->|"stores reading"| node_repository
node_main -->|"updates windows"| node_windows
node_main -->|"updates baseline"| node_baseline
node_main -->|"computes features"| node_features
node_features -->|"reads windows"| node_windows
node_features -->|"uses baseline"| node_baseline
node_main -->|"assesses heat"| node_heat
node_main -->|"assesses vitals"| node_vital
node_main -->|"assesses respiration"| node_respiratory
node_heat -->|"reads features"| node_features
node_vital -->|"reads features"| node_features
node_respiratory -->|"reads features"| node_features
node_main -->|"combines risks"| node_fusion
node_fusion -->|"gets recommendation"| node_recommendations
node_main -->|"stores risk state"| node_repository
node_main -.->|"updates snapshot"| node_state
node_fusion -.->|"triggers alerts"| node_alerts
node_main -->|"initializes database"| node_database
node_repository -->|"opens sessions"| node_database
node_database -->|"creates tables"| node_models
node_api -->|"reads snapshot"| node_state
node_api -->|"reads history"| node_repository
node_api -->|"reads baseline"| node_baseline
node_api -->|"reads alert history"| node_alerts
node_state -->|"shares update state"| node_stream
node_main -->|"registers routes"| node_api
node_main -->|"registers stream"| node_stream
node_api -->|"serves dashboard data"| node_dashboard
node_stream -->|"pushes live updates"| node_dashboard
node_config -->|"configures client"| node_mqtt
node_config -->|"configures checks"| node_validator
node_config -->|"configures baseline"| node_baseline
node_config -->|"configures database"| node_database

click node_esp32 "https://github.com/nilimkr/jeevone/blob/main/esp32/ESP32_Gateway.ino"
click node_mqtt "https://github.com/nilimkr/jeevone/blob/main/app/mqtt/client.py"
click node_validator "https://github.com/nilimkr/jeevone/blob/main/app/ingestion/validator.py"
click node_normalizer "https://github.com/nilimkr/jeevone/blob/main/app/ingestion/normalizer.py"
click node_processor "https://github.com/nilimkr/jeevone/blob/main/app/ingestion/processor.py"
click node_main "https://github.com/nilimkr/jeevone/blob/main/app/main.py"
click node_windows "https://github.com/nilimkr/jeevone/blob/main/app/processing/windows.py"
click node_baseline "https://github.com/nilimkr/jeevone/blob/main/app/processing/baseline.py"
click node_features "https://github.com/nilimkr/jeevone/blob/main/app/processing/features.py"
click node_heat "https://github.com/nilimkr/jeevone/blob/main/app/risk/heat.py"
click node_vital "https://github.com/nilimkr/jeevone/blob/main/app/risk/vital.py"
click node_respiratory "https://github.com/nilimkr/jeevone/blob/main/app/risk/respiratory.py"
click node_fusion "https://github.com/nilimkr/jeevone/blob/main/app/risk/fusion.py"
click node_recommendations "https://github.com/nilimkr/jeevone/blob/main/app/risk/recommendations.py"
click node_alerts "https://github.com/nilimkr/jeevone/blob/main/app/alerts/manager.py"
click node_state "https://github.com/nilimkr/jeevone/blob/main/app/pipeline_state.py"
click node_database "https://github.com/nilimkr/jeevone/blob/main/app/storage/database.py"
click node_repository "https://github.com/nilimkr/jeevone/blob/main/app/storage/repository.py"
click node_models "https://github.com/nilimkr/jeevone/blob/main/app/storage/models.py"
click node_api "https://github.com/nilimkr/jeevone/blob/main/app/api/routes.py"
click node_stream "https://github.com/nilimkr/jeevone/blob/main/app/api/websocket.py"
click node_dashboard "https://github.com/nilimkr/jeevone/blob/main/dashboard/templates/index.html"
click node_config "https://github.com/nilimkr/jeevone/blob/main/app/config_loader.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_mqtt,node_validator,node_normalizer,node_processor toneBlue
class node_main,node_windows,node_baseline,node_features,node_heat,node_vital,node_respiratory,node_fusion,node_recommendations toneAmber
class node_state,node_database,node_repository,node_models,node_config toneMint
class node_alerts,node_api,node_stream,node_dashboard toneRose
class node_sensors,node_broker toneIndigo
class node_esp32 toneTeal
```

## Components

### Sensor Ingestion

- [MQTT Client](https://github.com/nilimkr/jeevone/blob/main/app/mqtt/client.py): `app/mqtt/client.py`
- [Payload Validator](https://github.com/nilimkr/jeevone/blob/main/app/ingestion/validator.py): `app/ingestion/validator.py`
- [Reading Normalizer](https://github.com/nilimkr/jeevone/blob/main/app/ingestion/normalizer.py): `app/ingestion/normalizer.py`
- [Ingestion Processor](https://github.com/nilimkr/jeevone/blob/main/app/ingestion/processor.py): `app/ingestion/processor.py`

### Health Analysis

- [Pipeline Orchestrator](https://github.com/nilimkr/jeevone/blob/main/app/main.py): `app/main.py`
- [Sliding Windows](https://github.com/nilimkr/jeevone/blob/main/app/processing/windows.py): `app/processing/windows.py`
- [Personal Baseline](https://github.com/nilimkr/jeevone/blob/main/app/processing/baseline.py): `app/processing/baseline.py`
- [Feature Extraction](https://github.com/nilimkr/jeevone/blob/main/app/processing/features.py): `app/processing/features.py`
- [Heat Risk](https://github.com/nilimkr/jeevone/blob/main/app/risk/heat.py): `app/risk/heat.py`
- [Vital Risk](https://github.com/nilimkr/jeevone/blob/main/app/risk/vital.py): `app/risk/vital.py`
- [Respiratory Risk](https://github.com/nilimkr/jeevone/blob/main/app/risk/respiratory.py): `app/risk/respiratory.py`
- [Risk Fusion](https://github.com/nilimkr/jeevone/blob/main/app/risk/fusion.py): `app/risk/fusion.py`
- [Recommendations](https://github.com/nilimkr/jeevone/blob/main/app/risk/recommendations.py): `app/risk/recommendations.py`

### State and Storage

- [In-memory Pipeline State](https://github.com/nilimkr/jeevone/blob/main/app/pipeline_state.py): `app/pipeline_state.py`
- [SQLite Database](https://github.com/nilimkr/jeevone/blob/main/app/storage/database.py): `app/storage/database.py`
- [Storage Repository](https://github.com/nilimkr/jeevone/blob/main/app/storage/repository.py): `app/storage/repository.py`
- [Storage Models](https://github.com/nilimkr/jeevone/blob/main/app/storage/models.py): `app/storage/models.py`
- [Configuration](https://github.com/nilimkr/jeevone/blob/main/app/config_loader.py): `app/config_loader.py`

### Local Delivery

- [Alert Manager](https://github.com/nilimkr/jeevone/blob/main/app/alerts/manager.py): `app/alerts/manager.py`
- [REST API](https://github.com/nilimkr/jeevone/blob/main/app/api/routes.py): `app/api/routes.py`
- [Live Update Stream](https://github.com/nilimkr/jeevone/blob/main/app/api/websocket.py): `app/api/websocket.py`
- [Local Dashboard](https://github.com/nilimkr/jeevone/blob/main/dashboard/templates/index.html): `dashboard/templates/index.html`

### Other components

- **Health Sensors**
- [ESP32 Gateway](https://github.com/nilimkr/jeevone/blob/main/esp32/ESP32_Gateway.ino): `esp32/ESP32_Gateway.ino`
- **MQTT Broker**

## Connections

- Health Sensors → ESP32 Gateway: provide readings (evidence: `README.md`)
- ESP32 Gateway → MQTT Broker: publishes MQTT (evidence: `README.md`)
- MQTT Broker → MQTT Client: delivers messages (evidence: `README.md`)
- MQTT Client → Pipeline Orchestrator: message callback (evidence: `README.md`)
- Pipeline Orchestrator → Ingestion Processor: processes payload (evidence: `app/main.py`)
- Ingestion Processor → Payload Validator: validates payload (evidence: `app/ingestion/processor.py`)
- Ingestion Processor → Reading Normalizer: normalizes payload (evidence: `app/ingestion/processor.py`)
- Pipeline Orchestrator → Storage Repository: stores reading (evidence: `app/main.py`)
- Pipeline Orchestrator → Sliding Windows: updates windows (evidence: `app/main.py`)
- Pipeline Orchestrator → Personal Baseline: updates baseline (evidence: `app/main.py`)
- Pipeline Orchestrator → Feature Extraction: computes features (evidence: `app/main.py`)
- Feature Extraction → Sliding Windows: reads windows (evidence: `app/processing/features.py`)
- Feature Extraction → Personal Baseline: uses baseline (evidence: `app/processing/features.py`)
- Pipeline Orchestrator → Heat Risk: assesses heat (evidence: `app/main.py`)
- Pipeline Orchestrator → Vital Risk: assesses vitals (evidence: `app/main.py`)
- Pipeline Orchestrator → Respiratory Risk: assesses respiration (evidence: `app/main.py`)
- Heat Risk → Feature Extraction: reads features (evidence: `app/risk/heat.py`)
- Vital Risk → Feature Extraction: reads features (evidence: `app/risk/vital.py`)
- Respiratory Risk → Feature Extraction: reads features (evidence: `app/risk/respiratory.py`)
- Pipeline Orchestrator → Risk Fusion: combines risks (evidence: `app/main.py`)
- Risk Fusion → Recommendations: gets recommendation (evidence: `app/risk/fusion.py`)
- Pipeline Orchestrator → Storage Repository: stores risk state (evidence: `app/main.py`)
- Pipeline Orchestrator → In-memory Pipeline State: updates snapshot (evidence: `app/main.py`)
- Risk Fusion → Alert Manager: triggers alerts (evidence: `README.md`)
- Pipeline Orchestrator → SQLite Database: initializes database (evidence: `app/main.py`)
- Storage Repository → SQLite Database: opens sessions (evidence: `app/storage/repository.py`)
- SQLite Database → Storage Models: creates tables (evidence: `app/storage/database.py`)
- REST API → In-memory Pipeline State: reads snapshot (evidence: `app/api/routes.py`)
- REST API → Storage Repository: reads history (evidence: `app/api/routes.py`)
- REST API → Personal Baseline: reads baseline (evidence: `app/api/routes.py`)
- REST API → Alert Manager: reads alert history (evidence: `app/api/routes.py`)
- In-memory Pipeline State → Live Update Stream: shares update state (evidence: `app/api/websocket.py`)
- Pipeline Orchestrator → REST API: registers routes (evidence: `app/main.py`)
- Pipeline Orchestrator → Live Update Stream: registers stream (evidence: `app/main.py`)
- REST API → Local Dashboard: serves dashboard data (evidence: `README.md`)
- Live Update Stream → Local Dashboard: pushes live updates (evidence: `README.md`)
- Configuration → MQTT Client: configures client (evidence: `app/mqtt/client.py`)
- Configuration → Payload Validator: configures checks (evidence: `app/ingestion/validator.py`)
- Configuration → Personal Baseline: configures baseline (evidence: `app/processing/baseline.py`)
- Configuration → SQLite Database: configures database (evidence: `app/storage/database.py`)
