How syedhaider037/spotter-hos-app works
HOS Trip Planner turns a driver's current location, pickup, dropoff, and used cycle hours into an HOS-compliant route plan with stops and daily logs. The React app submits that request to the Django planning endpoint, then presents the returned route and schedule as a map, stop timeline, trip summary, limits strip, and ELD-style daily sheets. The backend planner owns simulation and calls routing and HOS-rule services; the frontend owns request handling and result presentation. Source excerpts confirm key call relationships; other documented features are included with only README-supported links.
Main entry points: App.js Trip form and controller · views.py Plan endpoint · trip_planner.py Trip simulation · planApi.js Plan API client
Components 19
Trip planning interface
- Trip form and controller
frontend/src/App.js - Plan API client
frontend/src/utils/planApi.js
Planning API
- Django API routing
backend/backend/urls.py - Plan endpoint
backend/trip/views.py - Request throttling
backend/trip/throttles.py
Route and HOS planning
- Trip simulation
backend/trip/services/trip_planner.py - Geocoding and routing
backend/trip/services/route_service.py - HOS rules
backend/trip/services/hos_rules.py
Plan presentation
- Stops and time labels
frontend/src/utils/stops.js - Trip summary calculations
frontend/src/utils/tripSummary.js - Polyline decoding
frontend/src/utils/polyline.js - HOS limits display
frontend/src/components/HosLimits.js - Trip summary display
frontend/src/components/TripSummary.js - Route map and stops
frontend/src/components/TripMap.js - Plan preview
frontend/src/components/PlanPreview.js - Daily log sheet rendering
frontend/src/components/EldLogSheet.js - Log sheet calculations
frontend/src/utils/logSheet.js
Other components
- Driver
- OpenRouteService
Connections 23
- Driver → Trip form and controller: enters trip
frontend/src/App.js - Trip form and controller → Plan API client: submits plan
frontend/src/App.js - Plan API client → Django API routing: sends JSON
README.md - Django API routing → Plan endpoint: routes request
backend/backend/urls.py - Plan endpoint → Request throttling: applies throttle
backend/trip/views.py - Plan endpoint → Trip simulation: calls planner
backend/trip/views.py - Trip simulation → Geocoding and routing: gets route legs
backend/trip/services/trip_planner.py - Trip simulation → HOS rules: checks limits
backend/trip/services/trip_planner.py - Geocoding and routing → OpenRouteService: requests geocoding and directions
backend/trip/services/route_service.py - Trip simulation → Plan endpoint: returns plan
backend/trip/views.py - Plan endpoint → Plan API client: returns JSON
README.md - Plan API client → Trip form and controller: returns result
frontend/src/App.js - Trip form and controller → Stops and time labels: groups stops
frontend/src/App.js - Trip form and controller → Trip summary calculations: summarizes plan
frontend/src/App.js - Trip summary calculations → Polyline decoding: decodes route
frontend/src/utils/tripSummary.js - Trip form and controller → HOS limits display: renders limits
frontend/src/App.js - Trip form and controller → Trip summary display: renders summary
frontend/src/App.js - Trip form and controller → Route map and stops: renders map
frontend/src/App.js - Trip form and controller → Plan preview: renders preview
frontend/src/App.js - Trip form and controller → Daily log sheet rendering: renders daily logs
frontend/src/App.js - Route map and stops → Polyline decoding: decodes route
frontend/src/components/TripMap.js - Route map and stops → Stops and time labels: describes stops
frontend/src/components/TripMap.js - Daily log sheet rendering → Log sheet calculations: builds sheet
frontend/src/components/EldLogSheet.js