How akash-sharma8/sih2026 works
RailETA is a railway journey ETA product: passengers search for trains or choose a journey, request a live or pre-departure forecast, and receive predictions and disruption context. The backend exposes forecast, search, demo, health/readiness, and staff APIs; forecast logic combines rail-provider data, feature preparation, model inference, and response building. Web and mobile clients consume the API. The README documents the intended forecast architecture; several subsystems are represented from the tree and source index because their implementation excerpts were not supplied.
Main entry points: forecast.py Forecast orchestration · api Forecast endpoints · main.py FastAPI app · train_search.py Train search service
Components 26
Backend API
- FastAPI app
app/main.py - Forecast endpoints
app/api - Train search endpoint
app/api/train_search.py - Health and readiness
app/api/health.py - Staff endpoint
app/api/staff.py
Journey Services
- Forecast orchestration
app/services/forecast.py - Train search service
app/services/train_search.py - Resilient cache
app/services/cache.py - Predeparture features
app/services/predeparture_features.py - Disruption alerts
app/services/disruption_alerts.py - Route and map building
app/services/route_map_builder.py
Forecast Inference
- Inference adapter
app/inference/adapter.py - Three-model routing
app/inference - Forecast response builder
app/inference/response_builder.py - Model explanations
app/inference/explainability.py - Saved-demo runtime
ml_handoff/raileta_space/runtime.py
External Data
- RailRadar client
app/clients/railradar.py - Weather clients
app/clients
Passenger Clients
- Web interface
frontend/src/app - Web API client
frontend/src/lib/api/api-client.ts - Mobile journey screen
mobile/src/app/index.tsx - Mobile API client
mobile/src/api/client.ts
Other components
- Passenger
- Staff
- RailRadar service
- Weather service
Connections 26
- FastAPI app → Forecast endpoints: registers routes
app/main.py - FastAPI app → Train search endpoint: registers routes
app/main.py - FastAPI app → Health and readiness: registers routes
app/main.py - FastAPI app → Staff endpoint: registers routes
app/main.py - Forecast endpoints → Forecast orchestration: dispatches forecast
- Train search endpoint → Train search service: dispatches search
- Forecast orchestration → RailRadar client: fetches journey
app/services/forecast.py - Train search service → RailRadar client: searches trains
app/services/train_search.py - Train search service → Resilient cache: reads and writes
app/services/train_search.py - Forecast orchestration → Predeparture features: prepares features
app/services/forecast.py - Forecast orchestration → Inference adapter: runs inference
app/services/forecast.py - Forecast orchestration → Disruption alerts: uses disruption context
app/services/forecast.py - Forecast orchestration → Weather clients: requests weather data
app/services/forecast.py - Forecast orchestration → Forecast response builder: builds forecast response
- Inference adapter → Three-model routing: routes by journey stage
- Forecast response builder → Model explanations: adds explanations
- RailRadar client → RailRadar service: requests rail data
- Weather clients → Weather service: requests weather
- Web interface → Web API client: requests forecasts
- Web API client → Forecast endpoints: calls forecast API
- Mobile journey screen → Mobile API client: requests journey data
mobile/src/app/index.tsx - Mobile API client → Forecast endpoints: calls forecast API
- Passenger → Web interface: uses
- Passenger → Mobile journey screen: uses
- Staff → Staff endpoint: requests staff data
- Forecast endpoints → Saved-demo runtime: serves saved demo