# subhankar235/sih2k26_ps26250 architecture

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

- Interactive diagram: https://gitdiagram.com/subhankar235/sih2k26_ps26250
- Repository: https://github.com/subhankar235/sih2k26_ps26250

## Overview

Air Power is a grid-resilience monitoring and optimization platform. Operators use a dashboard and API to submit grid events and inspect operational results; the clearest traceable runtime path is the API’s ingestion endpoint through event validation, normalization, deduplication, and persistence. The README also identifies forecasting, optimization, streaming, simulation, and evaluation as product capabilities. Their internal wiring is not shown in the excerpts, so those branches are represented as distinct subsystems without inferred call chains.

Main entry points: [`backend/app/services/ingestion/ingestion_service.py`](https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/services/ingestion/ingestion_service.py) (Ingestion orchestration), [`backend/app/api/v1/ingestion.py`](https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/api/v1/ingestion.py) (Ingestion endpoint), [`frontend/src/app/page.tsx`](https://github.com/subhankar235/sih2k26_ps26250/blob/main/frontend/src/app/page.tsx) (Operator dashboard), [`backend/app/main.py`](https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/main.py) (FastAPI application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operator["Operator experience"]
  node_dashboard["Operator dashboard<br/>[page.tsx]"]
end

subgraph group_api["API and ingestion"]
  node_app["FastAPI application<br/>[main.py]"]
  node_router["API router<br/>[router.py]"]
  node_ingestion_api["Ingestion endpoint<br/>[ingestion.py]"]
  node_ingestion_service["Ingestion orchestration"]
  node_validator["Event validation<br/>[validator.py]"]
  node_normaliser["Event normalization<br/>[normaliser.py]"]
  node_deduplicator["Record deduplication<br/>[deduplicator.py]"]
  node_entity_matcher["Entity matching<br/>[entity_matcher.py]"]
  node_records[("Grid record store<br/>[record.py]")]
end

subgraph group_intelligence["Evidence and decisions"]
  node_evidence["Evidence analysis"]
  node_validity["Decision validity<br/>[status.py]"]
  node_verification["Independent verification"]
  node_approvals["Human approvals<br/>[approvals.py]"]
end

subgraph group_planning["Forecasting and planning"]
  node_forecasting["Grid forecasting<br/>[predictor.py]"]
  node_planning["Schedule optimization<br/>[solver_service.py]"]
  node_replanning["Incremental replanning"]
end

subgraph group_platform["Integration and simulation"]
  node_streaming["Kafka integration<br/>[consumer.py]"]
  node_simulation["Grid digital twin<br/>[digital_twin.py]"]
  node_evaluation["Experiments and benchmarks"]
end

node_operator(("Grid operator"))

node_operator -.->|"uses"| node_dashboard
node_dashboard -.->|"requests data"| node_app
node_app -->|"registers"| node_router
node_router -->|"registers"| node_ingestion_api
node_ingestion_api -->|"dispatches"| node_ingestion_service
node_ingestion_service -->|"validates"| node_validator
node_ingestion_service -->|"normalizes"| node_normaliser
node_ingestion_service -->|"classifies duplicates"| node_deduplicator
node_ingestion_service -->|"matches entities"| node_entity_matcher
node_ingestion_service -->|"persists records"| node_records
node_streaming -.->|"feeds ingestion"| node_ingestion_api
node_simulation -.->|"produces events"| node_streaming

click node_dashboard "https://github.com/subhankar235/sih2k26_ps26250/blob/main/frontend/src/app/page.tsx"
click node_app "https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/main.py"
click node_router "https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/api/router.py"
click node_ingestion_api "https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/api/v1/ingestion.py"
click node_ingestion_service "https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/services/ingestion/ingestion_service.py"
click node_validator "https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/services/ingestion/validator.py"
click node_normaliser "https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/services/ingestion/normaliser.py"
click node_deduplicator "https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/services/ingestion/deduplicator.py"
click node_entity_matcher "https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/services/ingestion/entity_matcher.py"
click node_records "https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/db/models/record.py"
click node_evidence "https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/services/evidence/evidence_service.py"
click node_validity "https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/services/validity/status.py"
click node_verification "https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/services/verification/consistency_checker.py"
click node_approvals "https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/api/v1/approvals.py"
click node_forecasting "https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/services/forecasting/predictor.py"
click node_planning "https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/services/planning/solver_service.py"
click node_replanning "https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/services/replanning/incremental_recompute.py"
click node_streaming "https://github.com/subhankar235/sih2k26_ps26250/blob/main/streaming/consumer.py"
click node_simulation "https://github.com/subhankar235/sih2k26_ps26250/blob/main/simulation/digital_twin.py"
click node_evaluation "https://github.com/subhankar235/sih2k26_ps26250/blob/main/evaluation/experiments/exp_stress_end_to_end.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_dashboard toneBlue
class node_app,node_router,node_ingestion_api,node_ingestion_service,node_validator,node_normaliser,node_deduplicator,node_entity_matcher,node_records toneAmber
class node_evidence,node_validity,node_verification,node_approvals toneMint
class node_forecasting,node_planning,node_replanning toneRose
class node_streaming,node_simulation,node_evaluation,node_operator toneIndigo
```

## Components

### Operator experience

- [Operator dashboard](https://github.com/subhankar235/sih2k26_ps26250/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`

### API and ingestion

- [FastAPI application](https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/main.py): `backend/app/main.py`
- [API router](https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/api/router.py): `backend/app/api/router.py`
- [Ingestion endpoint](https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/api/v1/ingestion.py): `backend/app/api/v1/ingestion.py`
- [Ingestion orchestration](https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/services/ingestion/ingestion_service.py): `backend/app/services/ingestion/ingestion_service.py`
- [Event validation](https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/services/ingestion/validator.py): `backend/app/services/ingestion/validator.py`
- [Event normalization](https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/services/ingestion/normaliser.py): `backend/app/services/ingestion/normaliser.py`
- [Record deduplication](https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/services/ingestion/deduplicator.py): `backend/app/services/ingestion/deduplicator.py`
- [Entity matching](https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/services/ingestion/entity_matcher.py): `backend/app/services/ingestion/entity_matcher.py`
- [Grid record store](https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/db/models/record.py): `backend/app/db/models/record.py`

### Evidence and decisions

- [Evidence analysis](https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/services/evidence/evidence_service.py): `backend/app/services/evidence/evidence_service.py`
- [Decision validity](https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/services/validity/status.py): `backend/app/services/validity/status.py`
- [Independent verification](https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/services/verification/consistency_checker.py): `backend/app/services/verification/consistency_checker.py`
- [Human approvals](https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/api/v1/approvals.py): `backend/app/api/v1/approvals.py`

### Forecasting and planning

- [Grid forecasting](https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/services/forecasting/predictor.py): `backend/app/services/forecasting/predictor.py`
- [Schedule optimization](https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/services/planning/solver_service.py): `backend/app/services/planning/solver_service.py`
- [Incremental replanning](https://github.com/subhankar235/sih2k26_ps26250/blob/main/backend/app/services/replanning/incremental_recompute.py): `backend/app/services/replanning/incremental_recompute.py`

### Integration and simulation

- [Kafka integration](https://github.com/subhankar235/sih2k26_ps26250/blob/main/streaming/consumer.py): `streaming/consumer.py`
- [Grid digital twin](https://github.com/subhankar235/sih2k26_ps26250/blob/main/simulation/digital_twin.py): `simulation/digital_twin.py`
- [Experiments and benchmarks](https://github.com/subhankar235/sih2k26_ps26250/blob/main/evaluation/experiments/exp_stress_end_to_end.py): `evaluation/experiments/exp_stress_end_to_end.py`

### Other components

- **Grid operator**

## Connections

- Grid operator → Operator dashboard: uses (evidence: `README.md`)
- Operator dashboard → FastAPI application: requests data
- FastAPI application → API router: registers (evidence: `backend/app/main.py`)
- API router → Ingestion endpoint: registers (evidence: `backend/app/api/router.py`)
- Ingestion endpoint → Ingestion orchestration: dispatches (evidence: `backend/app/api/v1/ingestion.py`)
- Ingestion orchestration → Event validation: validates (evidence: `backend/app/services/ingestion/ingestion_service.py`)
- Ingestion orchestration → Event normalization: normalizes (evidence: `backend/app/services/ingestion/ingestion_service.py`)
- Ingestion orchestration → Record deduplication: classifies duplicates (evidence: `backend/app/services/ingestion/ingestion_service.py`)
- Ingestion orchestration → Entity matching: matches entities (evidence: `backend/app/services/ingestion/ingestion_service.py`)
- Ingestion orchestration → Grid record store: persists records (evidence: `backend/app/services/ingestion/ingestion_service.py`)
- Kafka integration → Ingestion endpoint: feeds ingestion
- Grid digital twin → Kafka integration: produces events
