How savitp/transit-reliablility works
Transit Reliability turns King County Metro vehicle-position reports into observed stop departures, compares those departures with the static schedule, and presents route/stop reliability and worst-performing views. Riders can also create commute-window delay alerts, which are evaluated in the processing pipeline and delivered through ntfy. The graph reflects the sampled ingestion, processing, API, and notification code; some API endpoints and browser views are documented by excerpts but their full implementations were not sampled.
Main entry points: processor.py Report processor · schema.sql Transit database · api.py Reliability API · schedule.py Schedule model
Components 15
Live data collection
- Feed ingester
ingester.py - Vehicle decoding
fetch_vehicles.py - Redpanda stream
stream.py
Schedule and analysis
- Report processor
processor.py - Static GTFS schedule
- Schedule model
schedule.py - Departure detection
delays.py - Transit database
schema.sql
Rider experience
- Reliability API
api.py - Transit web app
static/app.js
Delay alerts
- Alert matching
alerts.py - Alert notifier
notifier.py - ntfy service
Other components
- Metro vehicle feed
- Rider
Connections 20
- Metro vehicle feed → Feed ingester: provides feed
- Feed ingester → Vehicle decoding: calls
- Feed ingester → Redpanda stream: publishes reports
- Report processor → Redpanda stream: consumes reports
- Static GTFS schedule → Schedule model: provides GTFS
- Report processor → Schedule model: loads schedule
- Report processor → Departure detection: processes reports
- Departure detection → Schedule model: looks up trips
- Report processor → Transit database: writes departures
- Report processor → Transit database: loads subscriptions
- Report processor → Alert matching: checks departures
- Alert matching → Schedule model: checks stop times
- Report processor → Transit database: queues alerts
- Rider → Transit web app: uses
- Transit web app → Reliability API: requests data
- Reliability API → Transit database: queries and updates
- Transit database → Reliability API: returns records
- Reliability API → Transit web app: returns JSON
- Alert notifier → Transit database: claims and updates alerts
- Alert notifier → ntfy service: sends notifications