# vikashl25/sih-26 architecture

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

- Interactive diagram: https://gitdiagram.com/vikashl25/sih-26
- Repository: https://github.com/vikashl25/sih-26

## Overview

Project GARUD is an aero-engine digital twin for telemetry monitoring, fault prediction, remaining-useful-life estimation, and mission reliability. The primary demo workflow replays mission telemetry through Simulink/UDP and CAN-FD, processes it in the telemetry service, and has the API Gateway coordinate inference, XAI/advisories, persistence, and a WebSocket dashboard stream. The dashboard also supports mission replay, fleet views, and scenario/fault-injection workflows. Edges follow README architecture statements and shown source references; unsampled subsystem internals are represented at their documented service boundary.

Main entry points: [`services/api_gateway/main.py`](https://github.com/vikashl25/sih-26/blob/main/services/api_gateway/main.py) (API Gateway), [`frontend/src/App.tsx`](https://github.com/vikashl25/sih-26/blob/main/frontend/src/App.tsx) (Dashboard App), [`backend/simulation_engine.py`](https://github.com/vikashl25/sih-26/blob/main/backend/simulation_engine.py) (Mission Simulation), [`services/ml_inference_service/main.py`](https://github.com/vikashl25/sih-26/blob/main/services/ml_inference_service/main.py) (Model Inference)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Telemetry Ingestion"]
  node_simulink["Simulink Replay"]
  node_bridge["UDP–CAN Bridge<br/>[udp_can_bridge.py]"]
  node_canrx["CAN Receiver<br/>[can_receiver.py]"]
end

subgraph group_backend["Twin and Services"]
  node_telemetry["Telemetry Service<br/>[main.py]"]
  node_simulation["Mission Simulation"]
  node_features["Feature Engine<br/>[feature_engine.py]"]
  node_gateway["API Gateway<br/>[main.py]"]
  node_persistence[("Mission Persistence<br/>[main.py]")]
  node_stream["Telemetry WebSocket<br/>[main.py]"]
end

subgraph group_analytics["Health Analytics"]
  node_models["Model Inference<br/>[main.py]"]
  node_model_loader["Model Loader<br/>[model_loader.py]"]
  node_xai["XAI and Advisories<br/>[main.py]"]
  node_xai_engine["XAI Engine<br/>[xai_engine.py]"]
  node_diagnostics["Fault Diagnostics<br/>[diagnostics.py]"]
  node_rul["RUL Prediction"]
end

subgraph group_frontend["Ground Dashboard"]
  node_app["Dashboard App<br/>[App.tsx]"]
  node_live["Live Dashboard<br/>[LiveDashboard.tsx]"]
  node_replay["Mission Replay<br/>[MissionReplay.tsx]"]
  node_fleet["Fleet Overview<br/>[FleetOverview.tsx]"]
  node_scenario["Scenario Simulation"]
  node_store["Twin State Store"]
  node_engine3d["3D Engine Twin"]
  node_model_builder["Engine Model Builder"]
end

node_operator(("Mission Operator"))

node_operator -->|"uses"| node_app
node_simulink -->|"sends UDP"| node_bridge
node_bridge -->|"forwards CAN-FD"| node_canrx
node_canrx -->|"supplies telemetry"| node_telemetry
node_telemetry -->|"runs"| node_simulation
node_simulation -->|"processes samples"| node_features
node_simulation -->|"loads models"| node_model_loader
node_gateway -->|"coordinates HTTP"| node_telemetry
node_gateway -->|"requests inference"| node_models
node_gateway -->|"requests explanations"| node_xai
node_gateway -->|"requests persistence"| node_persistence
node_models -->|"uses"| node_model_loader
node_simulation -->|"explains predictions"| node_xai_engine
node_xai -->|"uses"| node_xai_engine
node_simulation -->|"checks faults"| node_diagnostics
node_operator -->|"controls missions"| node_gateway
node_gateway -->|"publishes frames"| node_stream
node_stream -->|"streams telemetry"| node_app
node_app -->|"routes to"| node_live
node_app -->|"routes to"| node_replay
node_app -->|"routes to"| node_fleet
node_app -->|"routes to"| node_scenario
node_replay -->|"requests mission data"| node_gateway
node_app -.->|"receives stream state"| node_store
node_live -.->|"renders twin"| node_engine3d
node_engine3d -->|"builds geometry"| node_model_builder
node_models -.->|"predicts RUL"| node_rul

click node_bridge "https://github.com/vikashl25/sih-26/blob/main/simulink/udp_can_bridge.py"
click node_canrx "https://github.com/vikashl25/sih-26/blob/main/backend/can_receiver.py"
click node_telemetry "https://github.com/vikashl25/sih-26/blob/main/services/telemetry_service/main.py"
click node_simulation "https://github.com/vikashl25/sih-26/blob/main/backend/simulation_engine.py"
click node_features "https://github.com/vikashl25/sih-26/blob/main/backend/feature_engine.py"
click node_gateway "https://github.com/vikashl25/sih-26/blob/main/services/api_gateway/main.py"
click node_models "https://github.com/vikashl25/sih-26/blob/main/services/ml_inference_service/main.py"
click node_model_loader "https://github.com/vikashl25/sih-26/blob/main/backend/model_loader.py"
click node_xai "https://github.com/vikashl25/sih-26/blob/main/services/xai_service/main.py"
click node_xai_engine "https://github.com/vikashl25/sih-26/blob/main/explainability/xai_engine.py"
click node_diagnostics "https://github.com/vikashl25/sih-26/blob/main/backend/diagnostics.py"
click node_rul "https://github.com/vikashl25/sih-26/blob/main/models/rul_prediction/inference/realtime_rul_predictor.py"
click node_persistence "https://github.com/vikashl25/sih-26/blob/main/services/mongodb_service/main.py"
click node_stream "https://github.com/vikashl25/sih-26/blob/main/services/api_gateway/main.py"
click node_app "https://github.com/vikashl25/sih-26/blob/main/frontend/src/App.tsx"
click node_live "https://github.com/vikashl25/sih-26/blob/main/frontend/src/pages/LiveDashboard.tsx"
click node_replay "https://github.com/vikashl25/sih-26/blob/main/frontend/src/pages/MissionReplay.tsx"
click node_fleet "https://github.com/vikashl25/sih-26/blob/main/frontend/src/pages/FleetOverview.tsx"
click node_scenario "https://github.com/vikashl25/sih-26/blob/main/frontend/src/pages/ScenarioSimulation.tsx"
click node_store "https://github.com/vikashl25/sih-26/blob/main/frontend/src/store/useDigitalTwinStore.ts"
click node_engine3d "https://github.com/vikashl25/sih-26/blob/main/frontend/src/components/dashboard/AeroPistonEngine3D.tsx"
click node_model_builder "https://github.com/vikashl25/sih-26/blob/main/frontend/src/components/dashboard/engineModelBuilder.ts"

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_simulink,node_bridge,node_canrx toneBlue
class node_telemetry,node_simulation,node_features,node_gateway,node_persistence,node_stream toneAmber
class node_models,node_model_loader,node_xai,node_xai_engine,node_diagnostics,node_rul toneMint
class node_app,node_live,node_replay,node_fleet,node_scenario,node_store,node_engine3d,node_model_builder toneRose
class node_operator toneIndigo
```

## Components

### Telemetry Ingestion

- **Simulink Replay**
- [UDP–CAN Bridge](https://github.com/vikashl25/sih-26/blob/main/simulink/udp_can_bridge.py): `simulink/udp_can_bridge.py`
- [CAN Receiver](https://github.com/vikashl25/sih-26/blob/main/backend/can_receiver.py): `backend/can_receiver.py`

### Twin and Services

- [Telemetry Service](https://github.com/vikashl25/sih-26/blob/main/services/telemetry_service/main.py): `services/telemetry_service/main.py`
- [Mission Simulation](https://github.com/vikashl25/sih-26/blob/main/backend/simulation_engine.py): `backend/simulation_engine.py`
- [Feature Engine](https://github.com/vikashl25/sih-26/blob/main/backend/feature_engine.py): `backend/feature_engine.py`
- [API Gateway](https://github.com/vikashl25/sih-26/blob/main/services/api_gateway/main.py): `services/api_gateway/main.py`
- [Mission Persistence](https://github.com/vikashl25/sih-26/blob/main/services/mongodb_service/main.py): `services/mongodb_service/main.py`
- [Telemetry WebSocket](https://github.com/vikashl25/sih-26/blob/main/services/api_gateway/main.py): `services/api_gateway/main.py`

### Health Analytics

- [Model Inference](https://github.com/vikashl25/sih-26/blob/main/services/ml_inference_service/main.py): `services/ml_inference_service/main.py`
- [Model Loader](https://github.com/vikashl25/sih-26/blob/main/backend/model_loader.py): `backend/model_loader.py`
- [XAI and Advisories](https://github.com/vikashl25/sih-26/blob/main/services/xai_service/main.py): `services/xai_service/main.py`
- [XAI Engine](https://github.com/vikashl25/sih-26/blob/main/explainability/xai_engine.py): `explainability/xai_engine.py`
- [Fault Diagnostics](https://github.com/vikashl25/sih-26/blob/main/backend/diagnostics.py): `backend/diagnostics.py`
- [RUL Prediction](https://github.com/vikashl25/sih-26/blob/main/models/rul_prediction/inference/realtime_rul_predictor.py): `models/rul_prediction/inference/realtime_rul_predictor.py`

### Ground Dashboard

- [Dashboard App](https://github.com/vikashl25/sih-26/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Live Dashboard](https://github.com/vikashl25/sih-26/blob/main/frontend/src/pages/LiveDashboard.tsx): `frontend/src/pages/LiveDashboard.tsx`
- [Mission Replay](https://github.com/vikashl25/sih-26/blob/main/frontend/src/pages/MissionReplay.tsx): `frontend/src/pages/MissionReplay.tsx`
- [Fleet Overview](https://github.com/vikashl25/sih-26/blob/main/frontend/src/pages/FleetOverview.tsx): `frontend/src/pages/FleetOverview.tsx`
- [Scenario Simulation](https://github.com/vikashl25/sih-26/blob/main/frontend/src/pages/ScenarioSimulation.tsx): `frontend/src/pages/ScenarioSimulation.tsx`
- [Twin State Store](https://github.com/vikashl25/sih-26/blob/main/frontend/src/store/useDigitalTwinStore.ts): `frontend/src/store/useDigitalTwinStore.ts`
- [3D Engine Twin](https://github.com/vikashl25/sih-26/blob/main/frontend/src/components/dashboard/AeroPistonEngine3D.tsx): `frontend/src/components/dashboard/AeroPistonEngine3D.tsx`
- [Engine Model Builder](https://github.com/vikashl25/sih-26/blob/main/frontend/src/components/dashboard/engineModelBuilder.ts): `frontend/src/components/dashboard/engineModelBuilder.ts`

### Other components

- **Mission Operator**

## Connections

- Mission Operator → Dashboard App: uses (evidence: `README.md`)
- Simulink Replay → UDP–CAN Bridge: sends UDP (evidence: `README.md`)
- UDP–CAN Bridge → CAN Receiver: forwards CAN-FD (evidence: `README.md`)
- CAN Receiver → Telemetry Service: supplies telemetry (evidence: `README.md`)
- Telemetry Service → Mission Simulation: runs (evidence: `services/telemetry_service/main.py`)
- Mission Simulation → Feature Engine: processes samples (evidence: `backend/simulation_engine.py`)
- Mission Simulation → Model Loader: loads models (evidence: `backend/simulation_engine.py`)
- API Gateway → Telemetry Service: coordinates HTTP (evidence: `README.md`)
- API Gateway → Model Inference: requests inference (evidence: `README.md`)
- API Gateway → XAI and Advisories: requests explanations (evidence: `README.md`)
- API Gateway → Mission Persistence: requests persistence (evidence: `README.md`)
- Model Inference → Model Loader: uses (evidence: `services/ml_inference_service/main.py`)
- Mission Simulation → XAI Engine: explains predictions (evidence: `backend/simulation_engine.py`)
- XAI and Advisories → XAI Engine: uses (evidence: `services/xai_service/main.py`)
- Mission Simulation → Fault Diagnostics: checks faults (evidence: `backend/simulation_engine.py`)
- Mission Operator → API Gateway: controls missions (evidence: `README.md`)
- API Gateway → Telemetry WebSocket: publishes frames (evidence: `README.md`)
- Telemetry WebSocket → Dashboard App: streams telemetry (evidence: `README.md`)
- Dashboard App → Live Dashboard: routes to (evidence: `frontend/src/App.tsx`)
- Dashboard App → Mission Replay: routes to (evidence: `frontend/src/App.tsx`)
- Dashboard App → Fleet Overview: routes to (evidence: `frontend/src/App.tsx`)
- Dashboard App → Scenario Simulation: routes to (evidence: `frontend/src/App.tsx`)
- Mission Replay → API Gateway: requests mission data
- Dashboard App → Twin State Store: receives stream state
- Live Dashboard → 3D Engine Twin: renders twin
- 3D Engine Twin → Engine Model Builder: builds geometry (evidence: `frontend/src/components/dashboard/AeroPistonEngine3D.tsx`)
- Model Inference → RUL Prediction: predicts RUL
