Delivered remotely for a business based in Rome, Italy. Names withheld by agreement.
Project Overview
Long-distance driving exposes a consistent mismatch in generic consumer map apps: they optimize for geographic density rather than personal habit. A motorist crossing regional motorways rarely wants a list of twenty unfamiliar diners or unbranded pumps scattered five kilometers off an exit ramp. Drivers rely on specific fuel loyalty networks, preferred EV charging operators, trusted coffee chains, and predictable family rest stops—and they want to know which upcoming exit holds them without manually searching town by town while driving.
We engineered a corridor-aware road-trip planning platform spanning native Swift on iOS, Kotlin and Java on Android, and a Laravel, PHP, MySQL, Bootstrap, and Firebase backend. Drivers enter an origin, destination, and personal brand preferences to generate an en-route itinerary ranked by actual detour cost, exit reachability, and operating hours at the projected arrival time.
Route Discovery & Detour Bottlenecks
Building useful highway discovery required overcoming limitations inherent to off-the-shelf POI search:
- Radial search pollution: Naive circle-radius queries around a midpoint return stores unreachable across divided motorways or separated by rivers, costing drivers frustrating detours.
- Brand preference overload: Filtering manually for six different fuel, EV, and dining brands one search at a time forces unsafe mid-drive screen interaction.
- Time-blind recommendations: Highlighting a driver's favorite restaurant 200 kilometers ahead is useless if the location closes twenty minutes before the vehicle's projected arrival ETA.
- Highway battery and data drain: Continuous full-map polling over rural cellular towers drains battery quickly and stalls right when drivers pass mountain passes or long agricultural stretches.
Architectural Strategy
We organized the platform around polyline-segmented corridor matching paired with time-projected brand filtering. Rather than running expensive live matrix calculations on every pan gesture, the Laravel backend breaks an active route polyline into compact geographic bounding capsules, executes indexed MySQL spatial queries pre-filtered by the user's selected brand roster, and scores candidates by perpendicular offset and forward travel direction.
On mobile, choosing native Swift for iOS and Kotlin with interoperable Java location services for Android gave us full control over foreground/background location throttling, vector map rendering smoothness, and offline trip-bundle caching. Firebase bridges trip sharing across devices and delivers urgent route-closure or weather-stop alerts without maintaining heavy persistent socket connections inside moving vehicles.
Core Capabilities
- Multi-Brand Preference Profiles: Drivers save reusable travel presets—such as preferred fuel cards, EV connector networks, quick-service dining, and pharmacy chains—applied automatically to every new trip.
- Detour-Capped Corridor Filtering: Users set a strict maximum off-route tolerance (for example, within three minutes of the motorway exit), hiding inconvenient locations automatically.
- ETA-Aware Open Status: Stop cards evaluate store operating schedules against the driver's projected arrival clock at each milepost rather than current departure time.
- One-Tap Waypoint Chaining & Handoff: Selected stops insert cleanly into multi-stop itineraries and hand off seamlessly to turn-by-turn navigation cues.
- Brand & Amenity Curation Portal: A Bootstrap-powered Laravel admin console lets operations teams maintain brand hierarchies, verify 24-hour facilities, and reconcile merchant feed updates.
Technical Architecture
Mobile apps obtain route geometry and submit saved brand filters to Laravel REST endpoints. Laravel decomposes the encoded route polyline into indexed spatial corridor envelopes, queries MySQL POINT records filtered by active brand IDs and amenity flags, and returns an ordered stop manifest with projected arrival windows.
Flow: Native Apps (Swift iOS / Kotlin+Java Android) → Laravel REST API → Corridor Polyline Segmenter → MySQL Spatial Index (POINT Brand Catalog) → Cached Trip Bundle + Firebase Sync & Alerts → Bootstrap Curation Portal
Once a trip is planned, Swift and Kotlin clients persist the stop list and local map annotations to on-device storage. As the driver moves, local GPS progress advances the active leg marker client-side without hammering the API, calling Laravel only when a driver manually requests a detour refresh or alters brand filters mid-route.
Technology Stack
| Category | Technology detail |
|---|---|
| iOS Native Client | Swift using MapKit/CoreLocation for route overlays and voice cues |
| Android Native Client | Kotlin UI & coroutine engine paired with Java location service bridges |
| Backend Route & POI API | Laravel 11 on PHP 8.4 serving corridor queries and trip persistence |
| Spatial & Brand Database | MySQL 8 spatial indexes (POINT, MBR filtering) for highway POI lookup |
| Curation & Admin Console | Bootstrap web portal managing brand catalogs, amenities, and hours |
| Trip Sync & Telemetry | Firebase Cloud Messaging and Realtime sync for cross-device trips |
| Geospatial Corridor Math | Encoded polyline segmentation with directional bearing validation |
| Analytics & Stability | Firebase Crashlytics and Performance Monitoring across native builds |
| Caching Layer | Indexed corridor chunk caching minimizing repeat spatial queries |
Engineering Trade-offs & Solutions
| Engineering Challenge | Solution & Trade-off |
|---|---|
| Exact road-network detour routing for hundreds of POIs is too slow per search | Used fast spatial corridor pruning + exit-bearing heuristics in PHP/MySQL first, reserving exact routing API calls strictly for top shortlisted stops; cuts API latency dramatically. |
| Large national brand databases inflate mobile app download sizes | Kept the authoritative POI catalog in MySQL and streamed only active corridor slices on demand, caching current trips locally without bundling massive static map DBs. |
| Rewriting tested Java Android location wrappers risked GPS drift bugs | Retained battle-tested Java geolocation helpers under clean Kotlin coroutine wrappers rather than forcing a risky ground-up rewrite. |
| Highway connectivity drops mid-drive could hide upcoming fuel stops | Pre-fetched full multi-hour corridor stop lists at trip start so drivers maintain offline access to upcoming exits, amenities, and store hours. |
Location Privacy & Reliability
Continuous location access carries heightened user privacy expectations. The mobile applications track active GPS coordinates strictly while a trip session is running, computing leg progression locally on the device rather than streaming raw breadcrumb trails to backend servers. Only explicit user actions—such as saving a favorite itinerary or refreshing nearby brand stops—transmit coarse corridor identifiers to Laravel.
API access uses scoped bearer tokens with strict rate limiting on spatial search endpoints to guard curated merchant databases against automated scraping. Firebase Crashlytics monitors native Swift and Kotlin stability across diverse OS versions and low-memory vehicle head units, catching location-permission edge cases before broad rollouts.
Geospatial Query Performance
A naive spatial query covering a cross-country route bounding box scans huge metropolitan areas irrelevant to highway travel. By slicing route polylines into narrow overlapping directional rectangles and applying composite MySQL spatial and brand indexes, query execution stays tightly bounded regardless of total trip length.
Popular motorway corridors—such as heavily traveled weekend intercity routes—benefit from shared server-side segment caching in Laravel, turning repeated spatial lookups into fast memory hits. On the mobile side, Kotlin coroutines and Swift background dispatch queues decode polyline geometries and cluster dense urban pins off the main UI thread so map scrolling remains fluid.
Operational Outcomes
Delivering a brand-first road-trip companion across iOS, Android, and web administration reshaped how drivers plan and execute highway travel:
- Effortless en-route loyalty discovery: Motorists locate preferred fuel, EV charging, and dining brands along their exact travel direction without juggling multiple merchant apps.
- Fewer wasted highway detours: Directional bearing checks and detour caps filter out opposite-carriageway traps and distant off-highway outlets.
- Dependable rural navigation support: On-device trip bundle caching ensures upcoming stop schedules and amenity details stay readable through weak-signal corridors.
- Maintainable brand governance: Partner managers update store hours, EV stall counts, and seasonal closures cleanly from the Bootstrap operations console.