How ankitkapse594/eld-trip-planner works
This is a full-stack FMCSA Hours-of-Service dispatch planner. Dispatchers enter origin, pickup, dropoff, cycle usage, and driver/log details; the client submits a plan request, and the backend routes the trip, simulates duty segments, validates compliance, and builds stops and daily logs. The console presents the route, schedule, HOS summary, and printable log sheets, while location autocomplete uses a separate geocoding endpoint. Some backend orchestration is only partially excerpted; relationships not directly shown in source are grounded in the README where noted.
Main entry points: views.py Django API · App.tsx Console App · routing.py Truck Routing · log_builder.py Daily Log Builder
Components 24
Dispatch Console
- Trip Form
frontend/src/features/form/TripForm.tsx - Location Search
frontend/src/features/form/LocationInput.tsx - Plan Mutation
frontend/src/hooks/useTripPlan.ts - API Client
frontend/src/api/client.ts - Console App
frontend/src/App.tsx
API Gateway
- Django API
backend/trips/views.py - Request Validation
backend/trips/serializers.py - Geocoding
backend/trips/services/geocoding.py
Trip Planning
- Truck Routing
backend/trips/services/routing.py - Geo Utilities
backend/trips/services/geo_utils.py - HOS Simulation
backend/trips/services/hos_planner.py - Compliance Validation
backend/trips/services/hos_validator.py - Daily Log Builder
backend/trips/services/log_builder.py - Route Geometry
backend/trips/services/geo_utils.py
Trip Results
- Trip Summary
frontend/src/features/summary/SummaryCards.tsx - HOS Gauges
frontend/src/features/summary/HosGauges.tsx - Route Map
frontend/src/features/map/RouteMap.tsx - Stops Timeline
frontend/src/features/summary/StopsTimeline.tsx - Log Viewer
frontend/src/features/logs/LogSheetViewer.tsx - Daily Log Sheet
frontend/src/features/logs/LogSheet.tsx
Other components
- Dispatcher
- OpenRouteService
- OSRM Router
- Nominatim
Connections 31
- Dispatcher → Trip Form: enters trip
README.md - Trip Form → Location Search: uses search
frontend/src/features/form/TripForm.tsx - Location Search → API Client: requests geocodes
frontend/src/features/form/LocationInput.tsx - Dispatcher → Trip Form: submits plan
README.md - Trip Form → Console App: submits request
frontend/src/App.tsx - Console App → Plan Mutation: requests plan
frontend/src/App.tsx - Plan Mutation → API Client: calls planTrip
frontend/src/hooks/useTripPlan.ts - API Client → Django API: POSTs plan
README.md - API Client → Django API: GETs geocodes
README.md - Django API → Request Validation: validates request
backend/trips/views.py - Django API → Truck Routing: gets route
backend/trips/views.py - Django API → HOS Simulation: plans duty
backend/trips/views.py - Django API → Compliance Validation: checks compliance
backend/trips/views.py - Django API → Daily Log Builder: builds daily logs
backend/trips/views.py - Django API → Geocoding: searches locations
backend/trips/views.py - Truck Routing → OpenRouteService: requests route
README.md - Truck Routing → OSRM Router: fallback route
README.md - Geocoding → Nominatim: geocodes locations
README.md - Truck Routing → Geo Utilities: uses distance tools
backend/trips/services/routing.py - HOS Simulation → Geo Utilities: uses mileage tools
backend/trips/services/hos_planner.py - HOS Simulation → Compliance Validation: validates plan
README.md - Daily Log Builder → HOS Simulation: splits segments
backend/trips/services/log_builder.py - Daily Log Builder → Geo Utilities: interpolates locations
backend/trips/services/log_builder.py - Daily Log Builder → Geocoding: reverse geocodes remarks
README.md - Django API → Console App: returns plan
README.md - Console App → Trip Summary: renders summary
frontend/src/App.tsx - Console App → HOS Gauges: renders HOS gauges
frontend/src/App.tsx - Console App → Route Map: renders route
frontend/src/App.tsx - Console App → Stops Timeline: renders schedule
frontend/src/App.tsx - Console App → Log Viewer: renders logs
frontend/src/App.tsx - Log Viewer → Daily Log Sheet: renders sheets
frontend/src/features/logs/LogSheetViewer.tsx