# dakshverma-dev/sih-2026-121 architecture

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

- Interactive diagram: https://gitdiagram.com/dakshverma-dev/sih-2026-121
- Repository: https://github.com/dakshverma-dev/sih-2026-121

## Overview

ThermoLift Twin is a local digital-twin prototype for synthetic heavy-oil wells, not a field-control system. Its user workflow is Monitor → Diagnose → Simulate and decide → Validate: the replay combines synthetic plant observations, state estimates and pump diagnosis; the API exposes forecasts and pump/CSS recommendations; operators review and apply decisions only to the simulation; benchmark screens compare outcomes. The map retains the documented health and benchmark capabilities. Relationships among backend modules are based on the SOURCE INDEX and README; unsampled implementation details are not inferred.

Main entry points: [`apps/web/src/Console.tsx`](https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/Console.tsx) (Operations console), [`apps/web/src/api.ts`](https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/api.ts) (API client), [`thermolift/api.py`](https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/api.py) (REST and jobs API), [`thermolift/sim.py`](https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/sim.py) (Simulation replay)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Operator interface"]
  node_landing["Landing page<br/>[Landing.tsx]"]
  node_console["Operations console<br/>[Console.tsx]"]
  node_overview["Well overview<br/>[Overview.tsx]"]
  node_pump_evidence["Pump evidence<br/>[PumpEvidence.tsx]"]
  node_pump_whatif["Pump what-if<br/>[WhatIf.tsx]"]
  node_css_planner["CSS planner<br/>[CssPlanner.tsx]"]
  node_benchmarks_ui["Evidence and benchmarks<br/>[Benchmarks.tsx]"]
  node_health_ui["Data and model health<br/>[Health.tsx]"]
  node_chart["Charts<br/>[Chart.tsx]"]
  node_wellbore["Wellbore view<br/>[Wellbore.tsx]"]
  node_ui_shared["Shared UI<br/>[ui.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_runtime["Replay and API"]
  node_api["REST and jobs API<br/>[api.py]"]
  node_replay["Simulation replay<br/>[sim.py]"]
  node_store[("Recommendation audit store<br/>[store.py]")]
end

subgraph group_models["Well models"]
  node_plant["Synthetic plant and sensors<br/>[plant.py]"]
  node_physics["Thermal and lift physics<br/>[physics.py]"]
  node_twin["State observer and forecasts<br/>[twin.py]"]
  node_config["Assets and constraints<br/>[config.py]"]
end

subgraph group_decisions["Advice and validation"]
  node_diagnostics["Stroke diagnosis<br/>[diagnostics.py]"]
  node_optimise_pump["Pump policy search<br/>[optimise.py]"]
  node_optimise_css["CSS plan search<br/>[optimise.py]"]
  node_benchmark["Matched-run evaluation<br/>[benchmark.py]"]
end

node_operator(("Operator"))

node_operator -->|"opens"| node_landing
node_operator -->|"operates"| node_console
node_landing -->|"routes to"| node_console
node_console -->|"renders"| node_overview
node_console -->|"renders"| node_pump_evidence
node_console -->|"renders"| node_pump_whatif
node_console -->|"renders"| node_css_planner
node_console -->|"renders"| node_benchmarks_ui
node_console -->|"renders"| node_health_ui
node_console -->|"fetches state"| node_api_client
node_overview -->|"requests data"| node_api_client
node_pump_evidence -->|"requests data"| node_api_client
node_pump_whatif -->|"submits candidates"| node_api_client
node_css_planner -->|"submits plans"| node_api_client
node_benchmarks_ui -->|"requests results"| node_api_client
node_health_ui -->|"requests status"| node_api_client
node_overview -->|"renders trends"| node_chart
node_overview -->|"renders detail"| node_wellbore
node_overview -->|"uses controls"| node_ui_shared
node_api_client -->|"calls REST API"| node_api
node_api -->|"reads replay"| node_replay
node_api -->|"records decisions"| node_store
node_api -->|"requests advice"| node_optimise_pump
node_api -->|"requests plans"| node_optimise_css
node_api -->|"runs evaluation"| node_benchmark
node_replay -->|"advances plant"| node_plant
node_replay -->|"updates observer"| node_twin
node_replay -->|"evaluates strokes"| node_diagnostics
node_replay -->|"generates advice"| node_optimise_pump
node_plant -->|"steps physics"| node_physics
node_plant -->|"loads parameters"| node_config
node_twin -->|"uses models"| node_physics
node_twin -->|"loads parameters"| node_config
node_optimise_pump -->|"evaluates candidates"| node_physics
node_optimise_pump -->|"uses constraints"| node_config
node_optimise_css -->|"evaluates injection"| node_physics
node_optimise_css -->|"uses constraints"| node_config
node_benchmark -.->|"compares runs"| node_replay

click node_landing "https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/pages/Landing.tsx"
click node_console "https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/Console.tsx"
click node_overview "https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/pages/Overview.tsx"
click node_pump_evidence "https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/pages/PumpEvidence.tsx"
click node_pump_whatif "https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/pages/WhatIf.tsx"
click node_css_planner "https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/pages/CssPlanner.tsx"
click node_benchmarks_ui "https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/pages/Benchmarks.tsx"
click node_health_ui "https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/pages/Health.tsx"
click node_chart "https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/components/Chart.tsx"
click node_wellbore "https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/components/Wellbore.tsx"
click node_ui_shared "https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/components/ui.tsx"
click node_api_client "https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/api.ts"
click node_api "https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/api.py"
click node_replay "https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/sim.py"
click node_store "https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/store.py"
click node_plant "https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/plant.py"
click node_physics "https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/physics.py"
click node_twin "https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/twin.py"
click node_config "https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/config.py"
click node_diagnostics "https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/diagnostics.py"
click node_optimise_pump "https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/optimise.py"
click node_optimise_css "https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/optimise.py"
click node_benchmark "https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/benchmark.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_landing,node_console,node_overview,node_pump_evidence,node_pump_whatif,node_css_planner,node_benchmarks_ui,node_health_ui,node_chart,node_wellbore,node_ui_shared,node_api_client toneBlue
class node_api,node_replay,node_store toneAmber
class node_plant,node_physics,node_twin,node_config toneMint
class node_diagnostics,node_optimise_pump,node_optimise_css,node_benchmark toneRose
class node_operator toneIndigo
```

## Components

### Operator interface

- [Landing page](https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/pages/Landing.tsx): `apps/web/src/pages/Landing.tsx`
- [Operations console](https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/Console.tsx): `apps/web/src/Console.tsx`
- [Well overview](https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/pages/Overview.tsx): `apps/web/src/pages/Overview.tsx`
- [Pump evidence](https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/pages/PumpEvidence.tsx): `apps/web/src/pages/PumpEvidence.tsx`
- [Pump what-if](https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/pages/WhatIf.tsx): `apps/web/src/pages/WhatIf.tsx`
- [CSS planner](https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/pages/CssPlanner.tsx): `apps/web/src/pages/CssPlanner.tsx`
- [Evidence and benchmarks](https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/pages/Benchmarks.tsx): `apps/web/src/pages/Benchmarks.tsx`
- [Data and model health](https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/pages/Health.tsx): `apps/web/src/pages/Health.tsx`
- [Charts](https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/components/Chart.tsx): `apps/web/src/components/Chart.tsx`
- [Wellbore view](https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/components/Wellbore.tsx): `apps/web/src/components/Wellbore.tsx`
- [Shared UI](https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/components/ui.tsx): `apps/web/src/components/ui.tsx`
- [API client](https://github.com/dakshverma-dev/sih-2026-121/blob/main/apps/web/src/api.ts): `apps/web/src/api.ts`

### Replay and API

- [REST and jobs API](https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/api.py): `thermolift/api.py`
- [Simulation replay](https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/sim.py): `thermolift/sim.py`
- [Recommendation audit store](https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/store.py): `thermolift/store.py`

### Well models

- [Synthetic plant and sensors](https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/plant.py): `thermolift/plant.py`
- [Thermal and lift physics](https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/physics.py): `thermolift/physics.py`
- [State observer and forecasts](https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/twin.py): `thermolift/twin.py`
- [Assets and constraints](https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/config.py): `thermolift/config.py`

### Advice and validation

- [Stroke diagnosis](https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/diagnostics.py): `thermolift/diagnostics.py`
- [Pump policy search](https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/optimise.py): `thermolift/optimise.py`
- [CSS plan search](https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/optimise.py): `thermolift/optimise.py`
- [Matched-run evaluation](https://github.com/dakshverma-dev/sih-2026-121/blob/main/thermolift/benchmark.py): `thermolift/benchmark.py`

### Other components

- **Operator**

## Connections

- Operator → Landing page: opens
- Operator → Operations console: operates (evidence: `README.md`)
- Landing page → Operations console: routes to (evidence: `apps/web/src/App.tsx`)
- Operations console → Well overview: renders (evidence: `apps/web/src/Console.tsx`)
- Operations console → Pump evidence: renders (evidence: `apps/web/src/Console.tsx`)
- Operations console → Pump what-if: renders (evidence: `apps/web/src/Console.tsx`)
- Operations console → CSS planner: renders (evidence: `apps/web/src/Console.tsx`)
- Operations console → Evidence and benchmarks: renders (evidence: `apps/web/src/Console.tsx`)
- Operations console → Data and model health: renders (evidence: `apps/web/src/Console.tsx`)
- Operations console → API client: fetches state (evidence: `apps/web/src/Console.tsx`)
- Well overview → API client: requests data (evidence: `apps/web/src/pages/Overview.tsx`)
- Pump evidence → API client: requests data (evidence: `apps/web/src/pages/PumpEvidence.tsx`)
- Pump what-if → API client: submits candidates (evidence: `apps/web/src/pages/WhatIf.tsx`)
- CSS planner → API client: submits plans (evidence: `apps/web/src/pages/CssPlanner.tsx`)
- Evidence and benchmarks → API client: requests results (evidence: `apps/web/src/pages/Benchmarks.tsx`)
- Data and model health → API client: requests status (evidence: `apps/web/src/pages/Health.tsx`)
- Well overview → Charts: renders trends (evidence: `apps/web/src/pages/Overview.tsx`)
- Well overview → Wellbore view: renders detail (evidence: `apps/web/src/pages/Overview.tsx`)
- Well overview → Shared UI: uses controls (evidence: `apps/web/src/pages/Overview.tsx`)
- API client → REST and jobs API: calls REST API (evidence: `README.md`)
- REST and jobs API → Simulation replay: reads replay (evidence: `thermolift/api.py`)
- REST and jobs API → Recommendation audit store: records decisions (evidence: `thermolift/api.py`)
- REST and jobs API → Pump policy search: requests advice (evidence: `thermolift/api.py`)
- REST and jobs API → CSS plan search: requests plans (evidence: `thermolift/api.py`)
- REST and jobs API → Matched-run evaluation: runs evaluation (evidence: `thermolift/api.py`)
- Simulation replay → Synthetic plant and sensors: advances plant (evidence: `thermolift/sim.py`)
- Simulation replay → State observer and forecasts: updates observer (evidence: `thermolift/sim.py`)
- Simulation replay → Stroke diagnosis: evaluates strokes (evidence: `thermolift/sim.py`)
- Simulation replay → Pump policy search: generates advice (evidence: `thermolift/sim.py`)
- Synthetic plant and sensors → Thermal and lift physics: steps physics (evidence: `thermolift/plant.py`)
- Synthetic plant and sensors → Assets and constraints: loads parameters (evidence: `thermolift/plant.py`)
- State observer and forecasts → Thermal and lift physics: uses models (evidence: `thermolift/twin.py`)
- State observer and forecasts → Assets and constraints: loads parameters (evidence: `thermolift/twin.py`)
- Pump policy search → Thermal and lift physics: evaluates candidates (evidence: `thermolift/optimise.py`)
- Pump policy search → Assets and constraints: uses constraints (evidence: `thermolift/optimise.py`)
- CSS plan search → Thermal and lift physics: evaluates injection (evidence: `thermolift/optimise.py`)
- CSS plan search → Assets and constraints: uses constraints (evidence: `thermolift/optimise.py`)
- Matched-run evaluation → Simulation replay: compares runs
