# raushankumarpandit/railoptima-sih2026 architecture

> Architecture diagram of the GitHub repository raushankumarpandit/railoptima-sih2026, 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/raushankumarpandit/railoptima-sih2026
- Repository: https://github.com/raushankumarpandit/railoptima-sih2026

## Overview

RAILOPTIMA is a human-governed railway maintenance decision-support platform. Planners review asset condition, maintenance backlog, and traffic forecasts, request ranked possession windows, then approve or reject recommendations and review decisions and model analytics. The graph includes the React workflow, API/backend boundary, persistence, and documented ML and optimization capabilities. Some backend routes and model wiring were not excerpted; those relationships are shown only where the README documents them.

Main entry points: [`frontend/src/main.tsx`](https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/frontend/src/main.tsx) (Application shell), [`frontend/src/api.ts`](https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/frontend/src/api.ts) (REST client), [`backend/main.py`](https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/backend/main.py) (FastAPI application), [`backend/optimization/optimization_service.py`](https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/backend/optimization/optimization_service.py) (Window optimizer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Planner interface"]
  node_app["Application shell<br/>[main.tsx]"]
  node_login["Authentication screen<br/>[Login.tsx]"]
  node_dashboard["Network overview<br/>[Dashboard.tsx]"]
  node_assets["Asset intelligence<br/>[Assets.tsx]"]
  node_traffic["Traffic forecast<br/>[Traffic.tsx]"]
  node_backlog["Maintenance backlog<br/>[Backlog.tsx]"]
  node_planner_ui["Block planner<br/>[Planner.tsx]"]
  node_decisions["Block decisions<br/>[Blocks.tsx]"]
  node_analytics["Model analytics<br/>[Analytics.tsx]"]
  node_api_client["REST client<br/>[api.ts]"]
end

subgraph group_backend["API and domain services"]
  node_backend_api["FastAPI application<br/>[main.py]"]
end

subgraph group_intelligence["Prediction and scheduling"]
  node_asset_models["Asset prediction models"]
  node_traffic_model["Traffic classifier"]
  node_optimizer["Window optimizer"]
end

subgraph group_persistence["Operational data"]
  node_orm["Operational models<br/>[orm.py]"]
  node_database[("SQLite database<br/>[db.py]")]
  node_canonical_data["Canonical railway data"]
end

node_planner(("Railway planner"))

node_planner -->|"signs in"| node_login
node_app -->|"renders"| node_login
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_planner_ui
node_app -->|"routes to"| node_assets
node_app -->|"routes to"| node_traffic
node_app -->|"routes to"| node_backlog
node_app -->|"routes to"| node_decisions
node_app -->|"routes to"| node_analytics
node_login -->|"authenticates through"| node_api_client
node_dashboard -->|"requests overview"| node_api_client
node_assets -->|"requests asset data"| node_api_client
node_traffic -->|"requests forecasts"| node_api_client
node_backlog -->|"requests backlog"| node_api_client
node_planner_ui -->|"submits planning actions"| node_api_client
node_decisions -->|"requests decisions"| node_api_client
node_analytics -->|"requests metrics"| node_api_client
node_api_client -->|"sends REST requests"| node_backend_api
node_canonical_data -->|"supplies records"| node_backend_api
node_backend_api -->|"queries and updates"| node_orm
node_orm -->|"uses ORM base"| node_database
node_backend_api -->|"requests ranked windows"| node_optimizer
node_backend_api -.->|"uses for risk and health"| node_asset_models
node_backend_api -.->|"uses for density forecasts"| node_traffic_model
node_optimizer -->|"forecasts candidate traffic"| node_traffic_model
node_optimizer -->|"returns recommendation"| node_backend_api
node_planner -->|"reviews and decides"| node_planner_ui
node_backend_api -->|"persists decisions and feedback"| node_database

click node_app "https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/frontend/src/main.tsx"
click node_login "https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/frontend/src/pages/Login.tsx"
click node_dashboard "https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/frontend/src/pages/Dashboard.tsx"
click node_assets "https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/frontend/src/pages/Assets.tsx"
click node_traffic "https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/frontend/src/pages/Traffic.tsx"
click node_backlog "https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/frontend/src/pages/Backlog.tsx"
click node_planner_ui "https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/frontend/src/pages/Planner.tsx"
click node_decisions "https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/frontend/src/pages/Blocks.tsx"
click node_analytics "https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/frontend/src/pages/Analytics.tsx"
click node_api_client "https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/frontend/src/api.ts"
click node_backend_api "https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/backend/main.py"
click node_orm "https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/backend/models/orm.py"
click node_database "https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/backend/database/db.py"
click node_asset_models "https://github.com/raushankumarpandit/railoptima-sih2026/tree/main/backend/ml/saved_models"
click node_traffic_model "https://github.com/raushankumarpandit/railoptima-sih2026/tree/main/backend/ml/saved_models"
click node_optimizer "https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/backend/optimization/optimization_service.py"
click node_canonical_data "https://github.com/raushankumarpandit/railoptima-sih2026/tree/main/dataset/canonical_reference"

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_app,node_login,node_dashboard,node_assets,node_traffic,node_backlog,node_planner_ui,node_decisions,node_analytics,node_api_client toneBlue
class node_backend_api toneAmber
class node_asset_models,node_traffic_model,node_optimizer toneMint
class node_orm,node_database,node_canonical_data toneRose
class node_planner toneIndigo
```

## Components

### Planner interface

- [Application shell](https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/frontend/src/main.tsx): `frontend/src/main.tsx`
- [Authentication screen](https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/frontend/src/pages/Login.tsx): `frontend/src/pages/Login.tsx`
- [Network overview](https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/frontend/src/pages/Dashboard.tsx): `frontend/src/pages/Dashboard.tsx`
- [Asset intelligence](https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/frontend/src/pages/Assets.tsx): `frontend/src/pages/Assets.tsx`
- [Traffic forecast](https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/frontend/src/pages/Traffic.tsx): `frontend/src/pages/Traffic.tsx`
- [Maintenance backlog](https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/frontend/src/pages/Backlog.tsx): `frontend/src/pages/Backlog.tsx`
- [Block planner](https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/frontend/src/pages/Planner.tsx): `frontend/src/pages/Planner.tsx`
- [Block decisions](https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/frontend/src/pages/Blocks.tsx): `frontend/src/pages/Blocks.tsx`
- [Model analytics](https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/frontend/src/pages/Analytics.tsx): `frontend/src/pages/Analytics.tsx`
- [REST client](https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/frontend/src/api.ts): `frontend/src/api.ts`

### API and domain services

- [FastAPI application](https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/backend/main.py): `backend/main.py`

### Prediction and scheduling

- [Asset prediction models](https://github.com/raushankumarpandit/railoptima-sih2026/tree/main/backend/ml/saved_models): `backend/ml/saved_models`
- [Traffic classifier](https://github.com/raushankumarpandit/railoptima-sih2026/tree/main/backend/ml/saved_models): `backend/ml/saved_models`
- [Window optimizer](https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/backend/optimization/optimization_service.py): `backend/optimization/optimization_service.py`

### Operational data

- [Operational models](https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/backend/models/orm.py): `backend/models/orm.py`
- [SQLite database](https://github.com/raushankumarpandit/railoptima-sih2026/blob/main/backend/database/db.py): `backend/database/db.py`
- [Canonical railway data](https://github.com/raushankumarpandit/railoptima-sih2026/tree/main/dataset/canonical_reference): `dataset/canonical_reference`

### Other components

- **Railway planner**

## Connections

- Railway planner → Authentication screen: signs in (evidence: `README.md`)
- Application shell → Authentication screen: renders (evidence: `frontend/src/main.tsx`)
- Application shell → Network overview: routes to (evidence: `frontend/src/main.tsx`)
- Application shell → Block planner: routes to (evidence: `frontend/src/main.tsx`)
- Application shell → Asset intelligence: routes to (evidence: `frontend/src/main.tsx`)
- Application shell → Traffic forecast: routes to (evidence: `frontend/src/main.tsx`)
- Application shell → Maintenance backlog: routes to (evidence: `frontend/src/main.tsx`)
- Application shell → Block decisions: routes to (evidence: `frontend/src/main.tsx`)
- Application shell → Model analytics: routes to (evidence: `frontend/src/main.tsx`)
- Authentication screen → REST client: authenticates through (evidence: `frontend/src/pages/Login.tsx`)
- Network overview → REST client: requests overview (evidence: `frontend/src/pages/Dashboard.tsx`)
- Asset intelligence → REST client: requests asset data (evidence: `frontend/src/pages/Assets.tsx`)
- Traffic forecast → REST client: requests forecasts (evidence: `frontend/src/pages/Traffic.tsx`)
- Maintenance backlog → REST client: requests backlog (evidence: `frontend/src/pages/Backlog.tsx`)
- Block planner → REST client: submits planning actions (evidence: `frontend/src/pages/Planner.tsx`)
- Block decisions → REST client: requests decisions (evidence: `frontend/src/pages/Blocks.tsx`)
- Model analytics → REST client: requests metrics (evidence: `frontend/src/pages/Analytics.tsx`)
- REST client → FastAPI application: sends REST requests (evidence: `README.md`)
- Canonical railway data → FastAPI application: supplies records (evidence: `README.md`)
- FastAPI application → Operational models: queries and updates (evidence: `backend/main.py`)
- Operational models → SQLite database: uses ORM base (evidence: `backend/models/orm.py`)
- FastAPI application → Window optimizer: requests ranked windows (evidence: `backend/main.py`)
- FastAPI application → Asset prediction models: uses for risk and health (evidence: `README.md`)
- FastAPI application → Traffic classifier: uses for density forecasts (evidence: `README.md`)
- Window optimizer → Traffic classifier: forecasts candidate traffic (evidence: `README.md`)
- Window optimizer → FastAPI application: returns recommendation (evidence: `README.md`)
- Railway planner → Block planner: reviews and decides (evidence: `README.md`)
- FastAPI application → SQLite database: persists decisions and feedback (evidence: `README.md`)
