How 143sanjay58/sih26028-eta-train works
RAILPULSE AI presents passenger and railway-operations interfaces over a FastAPI railway intelligence service. The principal workflow is train selection/tracking through live train state to ETA prediction and delay explanation, with operational branches for weather, congestion, alerts, station reports and simulation. The README documents these capabilities; some route/service internals are unsampled, so only documented or directly evidenced relationships are connected.
Main entry points: main.py FastAPI application · service.py ETA service · session.py Railway database · App.tsx Role-based app
Components 27
User interfaces
- Role-based app
frontend/src/App.tsx - API client
frontend/src/services/api.ts - ETA experience
frontend/src/pages/ETAEngine.tsx - Operations views
frontend/src/pages/ControlRoom.tsx
API and services
- FastAPI application
backend/app/main.py - Train endpoints
backend/app/api/routes/trains.py - Prediction endpoints
backend/app/api/routes/predictions.py - Train service
backend/app/services/train_service.py
Railway intelligence
- ETA service
backend/app/sih_eta/service.py - Dynamic ETA engine
backend/app/sih_eta/dynamic_eta_engine.py - ETA predictor
eta_predictor.py - ML predictor
backend/app/ml/predictor.py - Weather service
backend/app/services/weather_service.py - Congestion service
backend/app/services/congestion_service.py
Operations and realtime
- Alert service
backend/app/services/alert_service.py - Simulation engine
backend/app/simulation/engine.py - WebSocket manager
backend/app/realtime/websocket_manager.py - AI copilot reports
backend/app/services/copilot_report_service.py - AI provider service
backend/app/services/ai/service.py
Persistence
- Railway database
backend/app/database/session.py - Train and route models
backend/app/models/train.py - Station model
backend/app/models/station.py - Weather model
backend/app/models/weather.py
Other components
- Passengers
- Railway staff
- Open-Meteo
- Redis cache
Connections 35
- Passengers → Role-based app: use
- Railway staff → Role-based app: use
- Role-based app → API client: requests
- Role-based app → ETA experience: routes to
frontend/src/App.tsx - Role-based app → Operations views: routes to
frontend/src/App.tsx - API client → Prediction endpoints: calls
- API client → Train endpoints: calls
- FastAPI application → Train endpoints: registers
backend/app/main.py - FastAPI application → Prediction endpoints: registers
backend/app/main.py - FastAPI application → Simulation engine: starts
backend/app/main.py - FastAPI application → WebSocket manager: routes
backend/app/main.py - Prediction endpoints → ETA service: dispatches
- Train endpoints → Train service: dispatches
- ETA service → Train service: loads train state
backend/app/sih_eta/service.py - ETA service → Dynamic ETA engine: predicts with
backend/app/sih_eta/service.py - Dynamic ETA engine → ETA predictor: uses
backend/app/sih_eta/dynamic_eta_engine.py - ETA service → Railway database: reads
- Train service → Railway database: reads
- Train and route models → Railway database: maps to
backend/app/models/train.py - Station model → Railway database: maps to
backend/app/models/station.py - Weather model → Railway database: maps to
backend/app/models/weather.py - Simulation engine → Railway database: writes positions
backend/app/simulation/engine.py - ETA service → Train and route models: loads positions
backend/app/sih_eta/service.py - ETA service → Station model: resolves station
backend/app/sih_eta/service.py - Weather service → Weather model: uses
backend/app/services/weather_service.py - Weather service → Open-Meteo: fetches weather
- Prediction endpoints → ML predictor: uses
- FastAPI application → Alert service: exposes alerts
- FastAPI application → Congestion service: exposes congestion
- FastAPI application → Weather service: exposes weather
- FastAPI application → AI copilot reports: exposes copilot
backend/app/main.py - AI copilot reports → AI provider service: requests generation
- FastAPI application → Redis cache: configured for
- FastAPI application → WebSocket manager: broadcasts simulation status
backend/app/main.py - Operations views → WebSocket manager: receives updates