How notarsal/food-delivery-simulator works
This is a full-stack food-delivery logistics simulator and route optimizer. Users configure a city, fleet, and order volume in the dashboard; the API starts a tick-based simulation that loads a road network, generates and batches orders, assigns drivers, computes routes, and streams live state back to the map and metrics panels. Separate branches provide routing benchmarks and ETA prediction. The README documents capabilities beyond the sampled code; uncertain implementation links are omitted rather than inferred.
Main entry points: simulation.py Simulation engine · Dashboard.jsx Live dashboard · main.py FastAPI and sockets · App.jsx App state
Components 23
Dashboard
- App state
frontend/src/App.jsx - Live dashboard
frontend/src/components/Dashboard.jsx - Map view
frontend/src/components/MapView.jsx - Sim controls
frontend/src/components/SimControls.jsx - Algorithm selector
frontend/src/components/AlgorithmSelector.jsx - Metrics panel
frontend/src/components/MetricsPanel.jsx - Benchmark chart
frontend/src/components/AlgorithmChart.jsx
Simulation service
- FastAPI and sockets
backend/main.py - Simulation engine
backend/simulation.py - Order generation
backend/orders.py - Order batching
backend/batching.py - Driver dispatch
backend/drivers.py - Traffic updates
backend/traffic.py
Routing and prediction
- Route optimization
backend/route_optimizer.py - Pathfinding algorithms
backend/routing.py - Dynamic selection
backend/routing_algorithms/algorithm_router.py - Genetic optimizer
backend/routing_algorithms/genetic_algorithm.py - ETA prediction
ml/predict.py
Inputs and state
- Road network
backend/road_network.py - Road graph data
data - Restaurant data
backend/pune_data.py
Other components
- Operator
- OpenStreetMap
Connections 25
- Operator → App state: configures
README.md - App state → Live dashboard: renders
frontend/src/App.jsx - Live dashboard → Map view: renders
frontend/src/components/Dashboard.jsx - Live dashboard → Sim controls: renders
frontend/src/components/Dashboard.jsx - Live dashboard → Algorithm selector: renders
frontend/src/components/Dashboard.jsx - Live dashboard → Metrics panel: renders
frontend/src/components/Dashboard.jsx - App state → Benchmark chart: renders
frontend/src/App.jsx - App state → FastAPI and sockets: starts and stops
frontend/src/App.jsx - FastAPI and sockets → App state: streams updates
README.md - FastAPI and sockets → Simulation engine: controls
backend/main.py - Simulation engine → Road network: loads graph
backend/simulation.py - Simulation engine → Order generation: generates orders
backend/simulation.py - Order generation → Restaurant data: loads restaurant data
backend/orders.py - Simulation engine → Order batching: batches orders
backend/simulation.py - Simulation engine → Driver dispatch: assigns batches
backend/simulation.py - Simulation engine → Traffic updates: updates traffic
backend/simulation.py - Simulation engine → Route optimization: computes routes
backend/simulation.py - Route optimization → Pathfinding algorithms: uses pathfinding
backend/route_optimizer.py - Route optimization → Genetic optimizer: uses optimizer
backend/route_optimizer.py - Pathfinding algorithms → Road network: reads graph
backend/routing.py - FastAPI and sockets → Pathfinding algorithms: benchmarks routes
README.md - FastAPI and sockets → ETA prediction: predicts ETA
backend/main.py - Simulation engine → Dynamic selection: selects strategy
- Road network → Road graph data: caches graph
- Road network → OpenStreetMap: downloads roads
README.md