How argon573/optimization-urban-delivery-routes works
This is a delivery-route optimization product: users enter a start location and delivery points, choose transport preferences, request an optimized route, and inspect it on a Leaflet map. The backend exposes geocoding, route optimization, matrix and point-generation APIs; the README also documents saved history/favorites and local OSRM routing. Traffic-pattern CSV generation is a separate backend capability. Some frontend and backend internals were not sampled, so edges to them are limited to explicit README or index evidence.
Main entry points: RouteScreen.jsx Route editor · routes.py Route and address endpoints · RouteContext.jsx Route state and build · traffic_generator.py Traffic CSV generation
Components 28
Route planning UI
- Application shell
frontend/src/App.jsx - Page routing
frontend/src/router/AppRouter.jsx - Route editor
frontend/src/components/RouteScreen/RouteScreen.jsx - Point entry
frontend/src/components/RouteScreen/waypoints/WaypointInput.jsx - Waypoint settings
frontend/src/components/RouteScreen/waypoints/WaypointSettings.jsx - Waypoint list
frontend/src/components/RouteScreen/waypoints/WaypointList.jsx - Start location
frontend/src/components/RouteScreen/StartPointForm/StartPointForm.jsx - Address suggestions
frontend/src/hooks/usePhotonSearch.js - Geocoding client
frontend/src/api/geocodeAddress.js - Route state and build
frontend/src/context/RouteContext.jsx - Route actions
frontend/src/components/RouteScreen/RouteActions/RouteActions.jsx - Route map
frontend/src/components/map/RouteMapView.jsx - Route API client
frontend/src/api/fetchRouteGeoJson.js - History and generation
frontend/src/components/settings/Settings.jsx
Routing API
- FastAPI application
backend/app.py - Route and address endpoints
backend/routes.py - Request models
backend/models.py - Routing algorithms
backend/services.py - Synthetic point generation
backend/routes.py
Traffic data
- Traffic updater
backend/traffic/traffic_updater.py - Traffic CSV generation
backend/traffic/traffic_generator.py - Traffic patterns
backend/traffic/traffic_patterns.py - OSRM traffic CSV
Saved routes
- Saved-route access
frontend/src/hooks/useRouteStorage.js - History and favorites
frontend/src/services/routeStorage.js
Other components
- Delivery planner
- OSRM road routing
- Photon geocoder
Connections 31
- Delivery planner → Application shell: uses
frontend/src/App.jsx - Application shell → Page routing: renders
frontend/src/App.jsx - Page routing → Route editor: routes to
frontend/src/router/AppRouter.jsx - Route editor → Point entry: renders
frontend/src/components/RouteScreen/RouteScreen.jsx - Route editor → Waypoint settings: renders
frontend/src/components/RouteScreen/RouteScreen.jsx - Route editor → Waypoint list: renders
frontend/src/components/RouteScreen/RouteScreen.jsx - Route editor → Start location: renders
frontend/src/components/RouteScreen/RouteScreen.jsx - Point entry → Address suggestions: queries
frontend/src/components/RouteScreen/waypoints/WaypointInput.jsx - Point entry → Geocoding client: geocodes
frontend/src/components/RouteScreen/waypoints/WaypointInput.jsx - Start location → Address suggestions: queries
frontend/src/components/RouteScreen/StartPointForm/StartPointForm.jsx - Start location → Geocoding client: geocodes
frontend/src/components/RouteScreen/StartPointForm/StartPointForm.jsx - Address suggestions → Photon geocoder: requests suggestions
frontend/src/hooks/usePhotonSearch.js - Route editor → Route state and build: reads and updates
frontend/src/components/RouteScreen/RouteScreen.jsx - Route actions → Route state and build: requests build
frontend/src/components/RouteScreen/RouteActions/RouteActions.jsx - Route state and build → Route API client: fetches route
frontend/src/context/RouteContext.jsx - Route API client → Route and address endpoints: posts route request
README.md - FastAPI application → Route and address endpoints: mounts router
backend/app.py - Route and address endpoints → Request models: uses request models
backend/routes.py - Route and address endpoints → Routing algorithms: calls routing logic
backend/routes.py - Routing algorithms → OSRM road routing: gets road data
README.md - Route state and build → Route map: supplies route state
- Route state and build → History and favorites: saves history
frontend/src/context/RouteContext.jsx - History and generation → Saved-route access: uses saved routes
frontend/src/components/settings/Settings.jsx - Saved-route access → History and favorites: reads and writes
frontend/src/hooks/useRouteStorage.js - Route and address endpoints → Photon geocoder: requests geocoding
backend/routes.py - Route and address endpoints → Synthetic point generation: generates points
backend/routes.py - FastAPI application → Traffic CSV generation: generates on startup
backend/app.py - FastAPI application → Traffic updater: starts updater
backend/app.py - Traffic updater → Traffic CSV generation: refreshes CSV
backend/traffic/traffic_updater.py - Traffic CSV generation → Traffic patterns: uses patterns
backend/traffic/traffic_generator.py - Traffic CSV generation → OSRM traffic CSV: writes
backend/traffic/traffic_generator.py