Open
Conversation
Adds admin-toggleable Road Trip addon with OSRM road routing, fuel cost tracking, driving constraints, real stop finder, and historical route visualisation. Split into focused services: routingService, fuelService, stopSearchService. All external calls have timeouts, input validation, and rate limiting. Full i18n support across all 12 languages. https://claude.ai/code/session_01Gbv3XcW64sYVptMTmcyW62
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Road Trip Addon
Adds a new admin-toggleable "Road Trip" addon for vehicle-based trip planning with OSRM road routing, fuel cost tracking, driving constraints, real stop finding, and historical route visualisation.
Route Planning
OSRM_API_URLenv var)Fuel & Range
Real Stop Finder
amenity=fuel,shop=fuel,fuel:diesel=yesfor Australian roadhouse coverageDriving Constraints
Navigation & Export
Historical Road Trip Atlas
User Settings
Architecture & Code Quality
Addressed all feedback from #259:
roadtrip.tsmonolith into three focused services (routingService.ts,fuelService.ts,stopSearchService.ts) + thin 250-line route handlercatch {}blocks replaced with contextualconsole.errorlogging; Maps API key lookup failures loggedparseDirections()/dirSymbol()deduplicated into shareddirectionFormatters.tsas anycasts replaced with proper interfaces (OsrmResponse,OsrmRoute,OsrmStep,OverpassElement,GooglePlaceResult, etc.)SEARCH_RADII,ROUTE_PROXIMITY_THRESHOLD,CORRIDOR_SAMPLE_INTERVAL,OSRM_TIMEOUT_MS, etc.)requireAddonmiddleware + trip access checks on all endpointsImplementation Details
isEnabled('roadtrip')gating throughouttrip_route_legstable + existingsettingskey-value store + trip-level fuel price columnsrouter.project-osrm.organdoverpass-api.deNew files
server/src/routes/roadtrip.ts— Thin route handlers with input validationserver/src/services/routingService.ts— OSRM integration, speed caps, directionsserver/src/services/fuelService.ts— Fuel cost calculation, budget syncserver/src/services/stopSearchService.ts— Overpass/Google Places search, corridor search, filteringclient/src/store/roadtripStore.ts— Zustand store with route leg managementclient/src/components/Map/RoadTripRoute.tsx— Route polyline, stop markers, refuel markersclient/src/components/Trip/RoadTripSummary.tsx— Summary panel with totals, per-day breakdown, inline fuel price editorclient/src/utils/roadtripFormatters.ts— Formatters, vehicle range, daylight driving calculatorsclient/src/utils/solarCalculation.ts— Sunrise/sunset calculatorclient/src/utils/directionFormatters.ts— Shared direction parsing and symbolsModified files
server/src/db/schema.ts—trip_route_legstable + trip fuel price columnsserver/src/db/seeds.ts—roadtripaddon seedserver/src/index.ts— route registration + CSP entriesserver/src/routes/atlas.ts— road trips history endpointclient/src/api/client.ts—roadtripApiclient/src/types.ts—RouteLeg,RouteDirection,FoundStop,Tripinterfaces + settings fieldsclient/src/pages/SettingsPage.tsx— Road Trip settings sectionclient/src/pages/TripPlannerPage.tsx— load/cleanup/reorder hooksclient/src/pages/AtlasPage.tsx— Road Trips tabclient/src/components/Planner/DayPlanSidebar.tsx— per-leg toggle, info, stops, daylight recommendationsclient/src/components/Trip/DayDetailPanel.tsx— driving section with directions and daylightclient/src/components/Trip/TripPDF.tsx— driving summaries and directions in PDFclient/src/components/Map/MapView.tsx— per-segment rendering, full trip map buttonclient/src/components/Admin/AddonManager.tsx— Car iconclient/src/i18n/translations/*.ts— all 12 language files