How hemampandey/railvia works
RailVia is a railway maintenance block-planning product: controllers use a web dashboard to view a plan that coordinates ENGG, TRD, and S&T work against train traffic, then manage approvals and completion/reporting. The documented planning path combines timetable-grounded or synthetic inputs, predictive criticality, and CP-SAT allocation; the API serves results and operational actions to the browser. The tree and excerpts support the main modules and API boundaries, but not every route’s internal wiring, so uncertain links are omitted.
Main entry points: app.py FastAPI service · api.ts API client · hybrid.py Grounded inputs · core.py Planning vocabulary
Components 19
Operations dashboard
- Planner views
web/app/(app) - Sign-in state
web/components/AuthProvider.tsx - API client
web/lib/api.ts
Planning data
- Planning vocabulary
src/models/core.py - Timetable parsing
src/ingest/timetable.py - Grounded inputs
src/adapters/hybrid.py - Synthetic inputs
src/generator/synthetic.py
Planning engine
- Urgency scoring
src/ml/criticality.py - Risk features
src/ml/features.py - CP-SAT planner
src/optimiser/model.py - Disruption replanner
src/optimiser/replan.py - Manual comparison
src/baseline/manual.py
API and state
- FastAPI service
src/api/app.py - Plan cache
src/api/cache.py - Token verification
src/store/auth.py - Decision storage
src/store/supabase_store.py
Other components
- Railway controller
- RailRadar timetable
- Supabase and Postgres
Connections 22
- Railway controller → Planner views: uses
- Planner views → API client: requests data
- Sign-in state → API client: fetches identity
- Sign-in state → Supabase and Postgres: signs in
- API client → FastAPI service: calls API
- FastAPI service → Plan cache: checks plans
- FastAPI service → Grounded inputs: builds grounded input
- FastAPI service → Synthetic inputs: builds synthetic input
- RailRadar timetable → Timetable parsing: supplies timetable
- Timetable parsing → Grounded inputs: derives traffic
- Grounded inputs → Planning vocabulary: produces instance data
- Synthetic inputs → Planning vocabulary: produces instance data
- FastAPI service → Urgency scoring: scores urgency
- Urgency scoring → Risk features: uses features
- FastAPI service → CP-SAT planner: solves plan
- CP-SAT planner → Planning vocabulary: reads instance
- FastAPI service → Disruption replanner: replans disruptions
- FastAPI service → Manual comparison: compares plans
- FastAPI service → Token verification: verifies caller
- FastAPI service → Decision storage: reads and writes decisions
- Decision storage → Supabase and Postgres: persists decisions
- Token verification → Supabase and Postgres: verifies signing keys