How anilkumara9/asignment works
Fuel-Route API turns USA start and finish locations into a driving route, a minimum-cost refuelling plan, and either JSON or an interactive map. The documented workflow is handled by the HTTP views and the planner, which coordinates geocoding, routing, nearby-station matching, and fuel optimization; the planner also shapes the response geometry and summary. The map is a separate presentation path that reuses the planner. The README documents offline station data and map capabilities; unsampled module wiring is shown only where documented or directly supported by the sampled source.
Main entry points: planner.py Trip planner · views.py Map page view · urls.py URL dispatch · geocode.py Place geocoder
Components 17
HTTP interface
- Route API
fuelrouter/views.py - Map page view
fuelrouter/views.py - URL dispatch
fuelrouter/urls.py - Interactive map
templates/fuelrouter/map.html - Map error page
templates/fuelrouter/map_error.html
Trip planning
- Trip planner
fuelrouter/services/planner.py - Place geocoder
fuelrouter/services/geocode.py - Driving router
fuelrouter/services/routing.py - Fuel optimizer
fuelrouter/services/optimizer.py
Station data and geometry
- Station matcher
fuelrouter/services/stations.py - Route geometry
fuelrouter/services/geo.py - Station price data
fuelrouter/data/stations.json
External integrations
- Django cache
config/settings.py - Nominatim
- OSRM
- OSM map tiles
Other components
- Trip requester
Connections 21
- Trip requester → URL dispatch: requests
- URL dispatch → Route API: dispatches API
- URL dispatch → Map page view: dispatches map
- Route API → Trip planner: plans trip
- Map page view → Trip planner: plans trip
- Trip planner → Place geocoder: geocodes places
- Trip planner → Driving router: gets route
- Trip planner → Station matcher: matches stations
- Trip planner → Fuel optimizer: plans refuelling
- Trip planner → Route geometry: simplifies route
- Place geocoder → Nominatim: queries
- Driving router → OSRM: requests route
- Station matcher → Station price data: loads data
- Station matcher → Route geometry: measures route
- Place geocoder → Django cache: reads and writes
- Driving router → Django cache: reads and writes
- Trip planner → Django cache: reads and writes
- Route API → Trip requester: returns JSON
- Map page view → Interactive map: renders plan
- Map page view → Map error page: renders errors
- Interactive map → OSM map tiles: loads tiles