Refactoring a FastAPI Journey and Route API for clarity and maintainability
Source: Dev.to
RouteReality v1.3 is Live

What RouteReality Does
RouteReality is an open‑source real‑time bus arrival prediction system. It combines static timetable data with live journey events reported by users. The goal is to give people a clearer picture of when their bus is actually arriving, rather than relying solely on the static schedule. The more users interact with the system, the smarter and more accurate the predictions become.
How RouteReality is Different
Many Belfast‑based bus trackers focus on tracking events after they happen (e.g., departures, arrivals, delays). Those systems are mostly reactive.
RouteReality, on the other hand, is predictive and community‑driven:
- Predicts bus arrival times instead of just reporting past events.
- Blends static timetables with live user reports for more accurate predictions.
- Uses community input to improve accuracy over time; the system learns from repeated journeys.
- Predictions include a confidence measure, showing how reliable the estimate is.
- Open‑source and developer‑friendly, making it easy for others to contribute or extend the system.
What’s New in v1.3
This update focuses on stability, reliability, and improving the foundations of the system.
Stabilization and Improvements
- Added UI screenshots to the README to help new developers understand the app.
- Improved handling of journey event types for a clearer journey lifecycle.
- Expanded prediction payloads to include context such as recent event counts, source metadata, and historical data.
- Introduced more robust logging and instrumentation throughout the prediction and event handling layers.
Naming and Refactor
- Renamed key prediction fields (e.g.,
static_dtis nowreference_time) for better clarity and consistency. - Centralized prediction refresh logic to reduce duplicated code and improve maintainability.
- Improved timetable loading and fallback logic for situations where static data is limited.
Bug Fixes
- Fixed crashes caused by unsafe timetable unpacking.
- Stabilized prediction confidence scoring when limited data is available.
- Improved API error handling for invalid routes or stops.
Release Notes
You can view the full v1.3 release notes here:
https://github.com/dillionhuston/RouteReality/releases/tag/V1.3
Updated README
The updated README also includes guides and screenshots to help you get started:
https://github.com/dillionhuston/RouteReality/blob/main/README.md
What’s Next
We’re already working toward:
- User accounts and preferences
- Prediction models that consider time‑of‑day patterns and historical trends
- Improved mobile‑friendly UI and performance
- Stronger community reporting and feedback loops
A big thank you to everyone who has tested, reported bugs, and provided feedback. Your contributions are shaping the future of RouteReality.
Happy building and coding!