How mzuhaibkhan/route_router works
Route Radar is a freight-corridor weather-risk product: dispatchers submit an origin, destination, load weight, and departure time; the service compares routes, samples weather along each corridor, applies vehicle-sensitive risk rules, and returns route recommendations and map-ready risk data. The graph preserves the documented forecast, heatmap, departure-window, demo, and UI capabilities. Some backend wiring is supported by the README and source references rather than complete excerpts; uncertain links are omitted.
Main entry points: views.py API controller · App.jsx Application shell · weather.py Weather forecasts · data_types.py Analysis data models
Components 23
Dispatcher application
- Application shell
frontend/src/App.jsx - Route form
frontend/src/components/RouteForm/RouteForm.jsx - API client
frontend/src/services/api.js - Risk map
frontend/src/components/MapView/MapView.jsx - Route comparison
frontend/src/components/RouteCards/RouteCards.jsx - Forecast slider
frontend/src/components/ForecastSlider/ForecastSlider.jsx - Checkpoint details
frontend/src/components/CheckpointTable/CheckpointTable.jsx - Risk sandbox
frontend/src/components/RiskSandbox/RiskSandbox.jsx
API and coordination
- API controller
backend/api/views.py - Input validation
backend/api/serializers.py
Route risk analysis
- Geocoding
backend/services/geocoding.py - Alternative routing
backend/services/routing.py - Checkpoint sampling
backend/services/checkpoints.py - Weather forecasts
backend/services/weather.py - Risk classification
backend/services/risk_engine.py - Route recommendation
backend/services/recommendation.py - Corridor heatmap
backend/services/heatmap.py - Departure windows
backend/services/departure.py - Cache utilities
backend/services/cache_utils.py - Analysis data models
backend/services/data_types.py
External providers
- OpenRouteService
- Open-Meteo
Other components
- Dispatcher
Connections 30
- Dispatcher → Application shell: uses
- Application shell → Route form: presents
frontend/src/App.jsx - Route form → API client: submits route
- Application shell → API client: requests analysis
frontend/src/App.jsx - API client → API controller: calls API
- API controller → Input validation: validates input
backend/api/views.py - Input validation → Geocoding: resolves addresses
backend/api/serializers.py - API controller → Geocoding: serves autocomplete
backend/api/views.py - Geocoding → OpenRouteService: geocodes places
backend/services/geocoding.py - API controller → Alternative routing: requests routes
backend/api/views.py - Alternative routing → OpenRouteService: requests directions
backend/services/routing.py - API controller → Checkpoint sampling: samples routes
backend/api/views.py - API controller → Weather forecasts: fetches forecasts
backend/api/views.py - Weather forecasts → Open-Meteo: fetches hourly data
backend/services/weather.py - API controller → Risk classification: assesses checkpoint risk
- Weather forecasts → Risk classification: provides readings
backend/services/weather.py - API controller → Route recommendation: ranks routes
backend/api/views.py - API controller → Corridor heatmap: precomputes heatmap
backend/api/views.py - API controller → Departure windows: optimizes departure
backend/api/views.py - API controller → Cache utilities: caches analysis
backend/api/views.py - API controller → Analysis data models: builds results
backend/api/views.py - Risk classification → Analysis data models: produces risk records
backend/services/risk_engine.py - Weather forecasts → Analysis data models: parses readings
backend/services/weather.py - Checkpoint sampling → Analysis data models: creates checkpoints
backend/services/checkpoints.py - Application shell → Risk map: renders corridor
frontend/src/App.jsx - Application shell → Route comparison: shows alternatives
frontend/src/App.jsx - Application shell → Forecast slider: scrubs forecast
frontend/src/App.jsx - Application shell → Checkpoint details: shows checkpoints
frontend/src/App.jsx - Application shell → Risk sandbox: presents risk tools
frontend/src/App.jsx - Forecast slider → Risk map: updates hour