# akash-2615/sentinex-diesel-engine-leak-detection-system architecture

> Architecture diagram of the GitHub repository akash-2615/sentinex-diesel-engine-leak-detection-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akash-2615/sentinex-diesel-engine-leak-detection-system
- Repository: https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system

## Overview

SENTINEX is a diesel-engine leak intelligence platform: a simulated or live sensor reading enters a seven-stage inference pipeline, then the dashboard presents detection, severity and explanations. The graph also preserves the documented digital-twin, operations and federated-learning capabilities. Edges are based on the README, sampled excerpts and SOURCE INDEX references; unsampled implementation details are not inferred beyond documented relationships.

Main entry points: [`api/main.py`](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/api/main.py) (Prediction API), [`dashboard/src/App.jsx`](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/dashboard/src/App.jsx) (Dashboard App), [`src/federated/simulation.py`](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/federated/simulation.py) (Federated Simulation), [`dashboard/src/simulator.js`](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/dashboard/src/simulator.js) (Sensor Simulator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Sensor Inference"]
  node_simulator["Sensor Simulator<br/>[simulator.js]"]
  node_api["Prediction API<br/>[main.py]"]
  node_quality["Data Quality"]
  node_steady["Steady Guard"]
  node_baseline["Dynamic Baseline<br/>[baseline_engine.py]"]
  node_engine["Engine Profiles<br/>[engine_config.py]"]
  node_inference["Leak Inference<br/>[predict.py]"]
end

subgraph group_explain["Diagnostics"]
  node_explain["SHAP Explanation<br/>[explain.py]"]
  node_sfi["Sensor Fault Isolation"]
  node_severity["Physics Severity<br/>[severity_engine.py]"]
  node_rca["Root Cause Analysis<br/>[rootCauseEngine.js]"]
end

subgraph group_dashboard["Dashboard"]
  node_app["Dashboard App<br/>[App.jsx]"]
  node_twin["Digital Twin<br/>[hologramMode.js]"]
  node_health["Sensor Health"]
  node_reports["Session Reports"]
end

subgraph group_operations["Cell Operations"]
  node_persistence[("Supabase Services")]
  node_cellchat["Cell Messaging<br/>[cellChat.js]"]
  node_tester["Tester Registry<br/>[testerRegistry.js]"]
  node_email["Email Reports<br/>[report_email.py]"]
end

subgraph group_federated["Federated Learning"]
  node_federated["Federated Simulation<br/>[simulation.py]"]
  node_client["Facility Clients<br/>[client.py]"]
  node_aggregate["FedAvg Aggregator<br/>[aggregator.py]"]
  node_facilities["Facility Profiles<br/>[facility_config.py]"]
  node_fedview["Federated Dashboard"]
end

node_operator(("Operator"))

node_operator -->|"uses"| node_app
node_app -->|"generates readings"| node_simulator
node_simulator -->|"submits readings"| node_api
node_api -->|"invokes prediction"| node_inference
node_api -->|"uses cleaning"| node_quality
node_api -->|"uses guard"| node_steady
node_api -->|"uses baselines"| node_baseline
node_baseline -->|"loads constants"| node_engine
node_api -->|"uses isolation"| node_sfi
node_api -->|"returns SHAP"| node_explain
node_api -->|"returns severity"| node_severity
node_api -->|"returns result"| node_app
node_app -->|"ranks causes"| node_rca
node_app -->|"renders result"| node_twin
node_app -->|"shows sensor health"| node_health
node_app -->|"shares reports"| node_reports
node_app -->|"loads messages"| node_cellchat
node_app -->|"loads tester state"| node_tester
node_cellchat -->|"syncs messages"| node_persistence
node_reports -->|"stores reports"| node_persistence
node_api -->|"sends email"| node_email
node_federated -->|"trains clients"| node_client
node_federated -->|"aggregates models"| node_aggregate
node_federated -->|"loads facilities"| node_facilities
node_fedview -->|"displays rounds"| node_federated

click node_simulator "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/dashboard/src/simulator.js"
click node_api "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/api/main.py"
click node_quality "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/data_quality_pipeline.py"
click node_steady "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/steady_state_guard.py"
click node_baseline "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/baseline_engine.py"
click node_engine "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/engine_config.py"
click node_inference "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/predict.py"
click node_explain "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/explain.py"
click node_sfi "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/sensor_fault_isolator.py"
click node_severity "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/severity_engine.py"
click node_rca "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/dashboard/src/utils/rootCauseEngine.js"
click node_app "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/dashboard/src/App.jsx"
click node_twin "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/dashboard/src/digitalTwin/hologramMode.js"
click node_health "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/dashboard/src/components/SensorHealthDashboard.jsx"
click node_reports "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/dashboard/src/utils/sessionReportShare.js"
click node_persistence "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/tree/main/dashboard/src/lib"
click node_cellchat "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/dashboard/src/utils/cellChat.js"
click node_tester "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/dashboard/src/utils/testerRegistry.js"
click node_email "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/api/report_email.py"
click node_federated "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/federated/simulation.py"
click node_client "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/federated/client.py"
click node_aggregate "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/federated/aggregator.py"
click node_facilities "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/federated/facility_config.py"
click node_fedview "https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/dashboard/src/components/federated/FLGlobeDashboard.jsx"

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_simulator,node_api,node_quality,node_steady,node_baseline,node_engine,node_inference toneBlue
class node_explain,node_sfi,node_severity,node_rca toneAmber
class node_app,node_twin,node_health,node_reports toneMint
class node_persistence,node_cellchat,node_tester,node_email toneRose
class node_federated,node_client,node_aggregate,node_facilities,node_fedview,node_operator toneIndigo
```

## Components

### Sensor Inference

- [Sensor Simulator](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/dashboard/src/simulator.js): `dashboard/src/simulator.js`
- [Prediction API](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/api/main.py): `api/main.py`
- [Data Quality](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/data_quality_pipeline.py): `src/data_quality_pipeline.py`
- [Steady Guard](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/steady_state_guard.py): `src/steady_state_guard.py`
- [Dynamic Baseline](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/baseline_engine.py): `src/baseline_engine.py`
- [Engine Profiles](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/engine_config.py): `src/engine_config.py`
- [Leak Inference](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/predict.py): `src/predict.py`

### Diagnostics

- [SHAP Explanation](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/explain.py): `src/explain.py`
- [Sensor Fault Isolation](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/sensor_fault_isolator.py): `src/sensor_fault_isolator.py`
- [Physics Severity](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/severity_engine.py): `src/severity_engine.py`
- [Root Cause Analysis](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/dashboard/src/utils/rootCauseEngine.js): `dashboard/src/utils/rootCauseEngine.js`

### Dashboard

- [Dashboard App](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/dashboard/src/App.jsx): `dashboard/src/App.jsx`
- [Digital Twin](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/dashboard/src/digitalTwin/hologramMode.js): `dashboard/src/digitalTwin/hologramMode.js`
- [Sensor Health](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/dashboard/src/components/SensorHealthDashboard.jsx): `dashboard/src/components/SensorHealthDashboard.jsx`
- [Session Reports](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/dashboard/src/utils/sessionReportShare.js): `dashboard/src/utils/sessionReportShare.js`

### Cell Operations

- [Supabase Services](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/tree/main/dashboard/src/lib): `dashboard/src/lib`
- [Cell Messaging](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/dashboard/src/utils/cellChat.js): `dashboard/src/utils/cellChat.js`
- [Tester Registry](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/dashboard/src/utils/testerRegistry.js): `dashboard/src/utils/testerRegistry.js`
- [Email Reports](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/api/report_email.py): `api/report_email.py`

### Federated Learning

- [Federated Simulation](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/federated/simulation.py): `src/federated/simulation.py`
- [Facility Clients](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/federated/client.py): `src/federated/client.py`
- [FedAvg Aggregator](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/federated/aggregator.py): `src/federated/aggregator.py`
- [Facility Profiles](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/src/federated/facility_config.py): `src/federated/facility_config.py`
- [Federated Dashboard](https://github.com/akash-2615/sentinex-diesel-engine-leak-detection-system/blob/main/dashboard/src/components/federated/FLGlobeDashboard.jsx): `dashboard/src/components/federated/FLGlobeDashboard.jsx`

### Other components

- **Operator**

## Connections

- Operator → Dashboard App: uses
- Dashboard App → Sensor Simulator: generates readings (evidence: `dashboard/src/App.jsx`)
- Sensor Simulator → Prediction API: submits readings
- Prediction API → Leak Inference: invokes prediction (evidence: `api/main.py`)
- Prediction API → Data Quality: uses cleaning (evidence: `api/main.py`)
- Prediction API → Steady Guard: uses guard (evidence: `api/main.py`)
- Prediction API → Dynamic Baseline: uses baselines (evidence: `api/main.py`)
- Dynamic Baseline → Engine Profiles: loads constants (evidence: `src/baseline_engine.py`)
- Prediction API → Sensor Fault Isolation: uses isolation (evidence: `api/main.py`)
- Prediction API → SHAP Explanation: returns SHAP
- Prediction API → Physics Severity: returns severity
- Prediction API → Dashboard App: returns result
- Dashboard App → Root Cause Analysis: ranks causes
- Dashboard App → Digital Twin: renders result
- Dashboard App → Sensor Health: shows sensor health (evidence: `dashboard/src/App.jsx`)
- Dashboard App → Session Reports: shares reports (evidence: `dashboard/src/App.jsx`)
- Dashboard App → Cell Messaging: loads messages (evidence: `dashboard/src/App.jsx`)
- Dashboard App → Tester Registry: loads tester state (evidence: `dashboard/src/App.jsx`)
- Cell Messaging → Supabase Services: syncs messages (evidence: `dashboard/src/components/CellCommsPage.jsx`)
- Session Reports → Supabase Services: stores reports (evidence: `dashboard/src/components/CellCommsPage.jsx`)
- Prediction API → Email Reports: sends email (evidence: `api/main.py`)
- Federated Simulation → Facility Clients: trains clients (evidence: `src/federated/simulation.py`)
- Federated Simulation → FedAvg Aggregator: aggregates models (evidence: `src/federated/simulation.py`)
- Federated Simulation → Facility Profiles: loads facilities (evidence: `src/federated/simulation.py`)
- Federated Dashboard → Federated Simulation: displays rounds
