ontheway App: On Demand Roadside Assistance

Imad Dhin

On The Way

A Revolutionary On-Demand Roadside Assistance Platform
On The Way is a comprehensive, production-grade mobile application that connects stranded motorists with nearby service providers (called "Heroes") for emergency roadside assistance. Built with cutting-edge technologies and featuring real-time GPS tracking, advanced pricing algorithms, and seamless payment integration, the platform delivers a complete end-to-end solution for both users seeking help and heroes providing services.

🛠️ Technology Stack

Mobile Application

Framework: Flutter (Dart 3.x)
Cross-platform mobile development (iOS & Android)
Material Design 3 with custom theming
Responsive UI with dark/light mode support
18+ language localization support (English, Spanish, French, Arabic, Hindi, Chinese, Japanese, Korean, and more)

Backend Infrastructure

Firebase Ecosystem (Primary Backend)
Cloud Firestore: Real-time NoSQL database for user data, service requests, and hero profiles
Firebase Authentication: Secure user authentication with email/password, Google Sign-In, and Apple Sign-In
Firebase Cloud Functions: Serverless backend logic for notifications, payments, and business workflows
Firebase Crashlytics: Real-time crash reporting and analytics
Firebase Analytics: User behavior tracking and engagement metrics
Firebase Performance Monitoring: App performance tracking
Firebase Realtime Database: Ultra-low latency real-time location updates during active trips
Firebase Storage: Secure cloud storage for user documents, hero licenses, insurance papers, and vehicle photos
Firebase Cloud Messaging (FCM): Push notifications for trip updates and hero assignments
Google Cloud Platform Integration
Serverless compute for scalability
Cloud Functions for backend logic
Advanced security and compliance

Location & Mapping Services

Radar.io - Primary GPS & Location Intelligence Platform
Real-Time GPS Tracking:
Adaptive tracking with battery optimization
Background location tracking for heroes
Foreground tracking for active trips
Smart caching to reduce API calls
Location accuracy filtering and validation
Advanced Trip Tracking:
Real-time ETA calculations
Trip anomaly detection (delays, wrong destinations)
Arrival detection with geofencing
Multi-priority trip management
Comprehensive event handling
Geocoding & Reverse Geocoding:
Address to coordinates conversion
Coordinates to address conversion
Smart caching for frequently used locations
Distance Matrix API:
Calculate distances between multiple points
Route optimization for heroes
ETA calculations with traffic data
MapLibre Native - Primary Map Rendering Engine
Native Map Rendering:
High-performance native map display
Custom map styling (light/dark themes)
Smooth animations and transitions
Offline map support
Custom Markers & Overlays:
Custom hero car markers with vehicle types
Animated user location markers with pulse effects
Route polylines with traffic colors
Search radius circles
Custom symbols and icons
Interactive Features:
Map gesture controls (pan, zoom, rotate)
Marker clustering for multiple heroes
Real-time marker updates
Camera animations and bounds fitting

Payment Processing

Stripe Integration:
Direct Stripe API integration (not using plugins)
Credit/debit card payments
Apple Pay support
Secure payment method storage
Connect platform for hero payouts
Subscription management
Refund handling
Payment analytics

Internal Admin Dashboard

Next.js (React-based framework)
Hero verification and approval system
Background check management
Service request monitoring
Analytics and reporting dashboards
User management
Payment reconciliation
Support ticket system

🚀 Core Features & Capabilities

1. Real-Time GPS Tracking System

Advanced Location Services
Continuous Background Tracking: Heroes are tracked in the background while in "Hero Mode" to ensure accurate availability
Adaptive Polling: Smart location update frequency based on:
App foreground/background state
Battery level
Movement speed
Network conditions
Battery Optimization:
Cached location data to reduce API calls
Intelligent update intervals (30 seconds when moving, 5 minutes when stationary)
App lifecycle management for efficient resource usage
Location Accuracy Filtering: Validates GPS accuracy before updating positions
Multi-Layer Location Updates:
Client-side immediate updates for responsive UI
Server-verified updates for accurate backend data
Firebase Realtime Database for ultra-low latency during trips
Trip Tracking Features
Real-Time Hero Location: Users see hero approaching in real-time on the map
Live ETA Calculations: Dynamic ETA updates based on traffic and movement
Arrival Detection: Automatic notification when hero arrives within geofence
Route Visualization: Polyline routes displayed with traffic conditions
Trip Anomaly Detection: Alerts for unusual delays or wrong destinations
Distance & Duration Updates: Continuous updates every 30 seconds during active trips

2. Advanced Hero Matching Engine

Nearby Heroes Discovery
The app features a sophisticated hero-finding algorithm with multiple layers:
Geographic Query Optimization:
Bounding box calculations for efficient Firestore queries
Haversine formula for accurate distance calculations
Earth radius calculations in kilometers
Multi-Criteria Filtering:
Distance-Based: Heroes within configurable radius (default: 10 miles)
Service-Based: Matches heroes offering the required service (Towing, Jump Start, etc.)
Availability: Only online heroes in "Hero Mode"
Capacity: Heroes not already on another assignment
Intelligent Sorting:
Primary: Distance (closest first)
Secondary: Service expertise match
Tertiary: Hero rating and reviews
Real-Time Updates:
Stream-based hero location updates
Automatic marker refresh as heroes move
Dynamic recalculation of distances
Map clustering for multiple nearby heroes
Hero Selection Process
User selects service type
System queries all available heroes in area
Filters by service capability
Calculates exact distances using GPS
Sorts by proximity
Displays top matches on map with custom car markers
User views hero profiles (rating, distance, ETA, vehicle type)
User selects preferred hero
Request sent with real-time notification

3. Dynamic Pricing Model

The app implements a comprehensive, multi-factor pricing engine that calculates service costs dynamically based on numerous variables:
Core Pricing Factors
A. Distance-Based Pricing
Per-Mile Rates: Variable rates depending on service type
Towing: $5.00/mile
Transportation: $2.00 - $4.00/mile (based on vehicle class)
Other services: Fixed pricing
B. Time-Based Factors
Nighttime Surcharge:
Applied between 10 PM - 6 AM
Additional $15-$25 depending on service
Automatic detection based on device time
Dynamic Demand Surge Pricing:
Peak hours (weekday 4-7 PM): Higher demand index
Rush hours (weekday 7-9 AM, 4-7 PM): 25% surge multiplier
Late night (10 PM - 6 AM): 20% surge multiplier
Weekends: 15% surge multiplier
Real-time demand index calculation (0.0 - 1.0)
C. Weather-Based Pricing
Weather Factor Integration:
Normal weather: 1.0x multiplier
Bad weather (rain, snow, ice): 1.2x multiplier (20% increase)
Google Maps Weather API integration
Real-time weather condition checks
Location-specific weather data
D. Service-Specific Factors
Towing Services:
Base hookup fee: $75.00
Vehicle type multipliers:
Standard car: 1.0x
Truck/SUV: 1.25x
Commercial vehicle: 1.5x
Motorcycle: 0.8x
Winching service: +$50.00
Distance-based mileage cost
Nighttime and surge fees
Battery Jump/EV Charging:
Base price: $50-$75 (vehicle type dependent)
Service type variation (Jump vs. EV Charge)
Surge pricing
Nighttime fees
Weather adjustments
Gas Delivery:
Base price: $85.00 (includes 3 gallons)
Additional gallons: $7.00 per gallon
Premium fuel surcharge: +$10.00
Surge pricing
Nighttime fees
Weather adjustments
Tire Change:
Base price: $65-$99 (vehicle type dependent)
Surge pricing
Nighttime fees
Weather adjustments
Lockout Service:
Base price: $75.00
Higher surge range ($15-$40)
Nighttime fees
Weather adjustments
Transportation/Ride Services:
Multi-tier pricing:
Standard: $5 base + $2/mile + $0.35/min
Comfortable (SUV): $10 base + $3/mile + $0.55/min
Luxury: $15 base + $4/mile + $0.75/min
Packages: Fixed $20 rate
Extra stop fee: $6.00
Waiting time: $0.75/min (first 5 minutes free)
Minimum fare enforcement
Time-of-day surge pricing
Pricing Transparency
Detailed Breakdown Display: Users see itemized pricing:
Base fare
Distance charges
Time-based fees
Surge amounts
Weather adjustments
Nighttime surcharges
Additional service fees
Upfront Pricing: Total cost shown before service confirmation
Dynamic Updates: Price recalculates if destination changes
Price History: Users can view past service costs

4. Service Offerings

The platform supports six core roadside assistance services:
🚗 1. Towing Service
Features:
Distance-based pricing with destination selection
Support for multiple vehicle types (cars, trucks, SUVs, motorcycles, commercial)
Winching service option
Real-time route tracking from pickup to destination
Two-location tracking (current location + tow destination)
🔋 2. Battery Jump Start / EV Charging
Features:
Traditional battery jump start
EV emergency charging option
Vehicle type considerations
Quick service time (average 15-30 minutes)
Service completion verification
⛽ 3. Gas Delivery
Features:
Customizable fuel quantity (3-10 gallons)
Regular or premium fuel options
Base price includes 3 gallons
Additional gallon pricing
Fuel type selection
🔧 4. Tire Change
Features:
Flat tire replacement with spare
Vehicle type considerations (standard vs. truck/SUV)
Quick service completion
Safety checks
Service verification with photos
🔑 5. Lockout Service
Features:
Vehicle lockout assistance
Key extraction services
Professional lock technicians
Quick response times
Damage-free entry methods
🚙 6. Transportation Service
Features:
Alternative to towing for driveable situations
Multiple vehicle classes (Standard, Comfortable, Luxury)
Distance and time-based pricing
Extra stop support
Waiting time tracking
Minimum fare guarantees

5. User Features

User Journey
Account Creation:
Email/password, Google, or Apple Sign-In
Phone number verification
Profile setup with vehicle information
Service Selection:
Visual service icons with descriptions
Tap to select needed service
Service-specific forms for details
Location & Destination:
Automatic GPS location detection
Manual location selection via map
Address search with autocomplete
Destination selection (for towing/transportation)
Vehicle Information:
Vehicle make, model, year
Vehicle type (car, truck, SUV, motorcycle)
Color and license plate
Additional notes
Hero Selection:
View nearby available heroes on map
Hero profiles with ratings and reviews
Distance and ETA information
Vehicle and service type badges
Direct hero selection or auto-matching
Price Confirmation:
Upfront pricing display
Detailed cost breakdown
Payment method selection
Service confirmation
Real-Time Tracking:
Live hero location on map
Dynamic ETA updates
Route visualization
In-app messaging with hero
Voice call option
Service Completion:
Arrival notification
Service verification
Automatic payment processing
Hero rating and review
Digital receipt
Additional User Features
Trip History: View all past service requests with details
Saved Payment Methods: Securely store multiple cards
Favorite Locations: Save home, work, and frequent destinations
In-App Chat: Real-time messaging with assigned hero
Voice Calls: Direct calling through the app
Push Notifications: Service status updates, hero arrival alerts
SOS Mode: Quick emergency assistance button
Ride Sharing: Split costs with passengers
Service Scheduling: Book services in advance (future feature)
Promotional Codes: Apply discounts and offers

6. Hero Features

Hero Onboarding
Application:
Hero eligibility check
Service type selection
Vehicle description and photos
Earnings calculator
Verification:
Background check integration
Driver's license upload and verification
Vehicle insurance documentation
Vehicle registration
Business insurance (for commercial services)
Profile photo upload
Document Review:
Admin dashboard verification
Approval notifications
Account status tracking
Payment Setup:
Stripe Connect onboarding
Bank account linking
Payout preferences
Tax information collection
Hero Operations
Hero Mode Toggle:
One-tap to go online/offline
Background location tracking when online
Availability status display
Request Management:
Real-time incoming request notifications
Audio alerts for new requests
Request details preview
Accept/decline options
Countdown timer for decision
Navigation:
Turn-by-turn navigation to user
Real-time route updates
Traffic-aware routing
In-app navigation or external app integration
Service Execution:
Customer details and contact info
Service type and requirements
In-app chat and calling
"Arrived" button with geofence verification
Service completion workflow
Photo upload for verification
Earnings:
Real-time earning updates
Trip history with earnings breakdown
Weekly/monthly summaries
Payout schedule tracking
Tips and bonuses
Hero Dashboard
Home Screen:
Online/offline toggle
Current location display
Nearby service requests (if auto-accept enabled)
Today's earnings summary
Active trip status
Trip Management:
Active trip tracking
Trip history
Earnings per trip
Customer ratings received
Profile & Settings:
Service types offered
Vehicle information
Documents management
Payout settings
Availability schedule
Performance metrics

7. Advanced Features

Real-Time Communication
In-App Chat:
Firebase-powered real-time messaging
Message history
Typing indicators
Read receipts
Image sharing
Voice Calling:
Direct phone calls through app
Call history
Call recording (optional, with consent)
Notification System
Push Notifications:
Hero assigned alerts
Hero approaching notifications
Hero arrival alerts
Trip status changes
Payment confirmations
Promotional offers
In-App Notifications:
Real-time badge updates
Notification center
Action buttons for quick responses
Payment & Billing
Multiple Payment Methods:
Credit/debit cards (Visa, Mastercard, Amex, Discover)
Apple Pay
Google Pay (future)
Saved payment methods
Payment Security:
PCI DSS compliant
Stripe tokenization
No card data stored locally
3D Secure support
Billing Features:
Automatic payment on service completion
Payment failure handling
Refund processing
Dispute resolution
Digital receipts via email
Payment history
Safety & Security
User Verification:
Phone number verification
Email verification
Government ID verification (optional)
Hero Background Checks:
Criminal background check
Driving record check
Document verification
Insurance validation
Trip Safety:
Real-time location sharing
Emergency contact notifications
SOS button with 911 integration
Trip tracking for safety
Rating and review system
Data Security:
End-to-end encryption for messages
Firebase security rules
Regular security audits
GDPR compliance
Data anonymization
Analytics & Monitoring
User Analytics:
Service usage patterns
Popular service types
Peak usage times
Geographic heatmaps
User retention metrics
Hero Analytics:
Acceptance rates
Average service time
Earnings trends
Customer ratings
Service completion rates
System Monitoring:
Firebase Crashlytics for error tracking
Performance monitoring
API response times
Location accuracy metrics
Payment success rates

🏗️ Architecture & Design

Frontend Architecture

State Management
FlutterFlow App State: Global application state
Provider Pattern: Widget-level state management
Stream Controllers: Real-time data streams
Local State: Component-specific state with StatefulWidget
Navigation
Go Router: Declarative routing with deep linking support
Route Guards: Authentication-based navigation
Named Routes: Type-safe navigation
Route Parameters: Data passing between screens
UI/UX Design
Material Design 3: Modern, accessible design system
Custom Theming:
Light and dark mode support
Theme persistence across sessions
Dynamic theme switching
Consistent color palette
Custom typography
Responsive Design:
Adaptive layouts for different screen sizes
Tablet and phone optimizations
Landscape and portrait support
Animations:
Page transitions
Marker animations on maps
Pulse effects for location markers
Smooth camera movements
Loading states and shimmer effects
Accessibility:
Screen reader support
Semantic labels
High contrast mode
Font scaling
Keyboard navigation

Backend Architecture

Database Structure
Firestore Collections:
users: User profiles and preferences
user/{userId}/herodata: Hero-specific data (subcollection)
rides: Service requests and trip data
payments: Payment records
notifications: Notification history
reviews: User and hero reviews
vehicles: Vehicle information
support_tickets: Customer support requests
Firebase Realtime Database:
rides/{rideId}/userLocation: Real-time user location
rides/{rideId}/heroLocation: Real-time hero location
rides/{rideId}/status: Trip status updates
Used for ultra-low latency updates during active trips
Cloud Functions
Payment Processing:
Create payment intents
Confirm payments
Handle webhooks
Process refunds
Notifications:
Send FCM push notifications
Create notification records
Handle notification actions
Hero Matching:
Find available heroes
Calculate optimal matches
Send request notifications
Automated Tasks:
Clean up expired requests
Generate daily earnings reports
Send reminder notifications
Update hero rankings
Security
Firestore Security Rules:
User data isolation
Role-based access control
Field-level permissions
Data validation rules
Authentication:
Firebase Authentication
JWT token validation
Session management
Multi-factor authentication support

📊 Performance Optimizations

Location Services

Smart Caching:
Location cache with 30-second expiry
Address cache for reverse geocoding
Reduces API calls by up to 80%
Adaptive Tracking:
Background: Update every 5 minutes
Foreground idle: Update every 30 seconds
Active trip: Update every 10 seconds
High-speed movement: Update every 5 seconds
Battery Optimization:
App lifecycle awareness
Conditional tracking based on app state
GPS accuracy filtering to avoid unnecessary updates

Map Rendering

Efficient Marker Management:
Only render markers in visible bounds
Cluster markers when zoomed out
Lazy load marker icons
Reuse marker objects
Route Optimization:
Simplify polyline points (Douglas-Peucker algorithm)
Only update route when hero position changes significantly
Cache route calculations

Database Queries

Firestore Optimizations:
Composite indexes for complex queries
Bounding box queries to limit data
Pagination for long lists
Offline persistence
Real-Time Database:
Targeted listeners on specific nodes
Automatic disconnection cleanup
Throttled updates (max 1 per second)

App Performance

Image Optimization:
Cached network images
Compressed assets
Lazy loading
Code Splitting:
Lazy import of heavy packages
Dynamic feature loading
Memory Management:
Dispose controllers and streams
Clear image caches periodically
Remove inactive listeners

🌐 Scalability & Deployment

Firebase Scaling

Automatic Scaling: Firebase services scale automatically with demand
Geographic Distribution: Multi-region data replication
Load Balancing: Built-in load balancing for Cloud Functions
Database Sharding: Strategic collection design for horizontal scaling

Deployment

Mobile Apps:
iOS: App Store (TestFlight for beta)
Android: Google Play Store (Internal testing track)
Admin Dashboard:
Next.js deployed on Vercel
Serverless functions
CDN distribution
Automatic HTTPS

Monitoring & Alerts

Crashlytics: Real-time crash reporting
Performance Monitoring: Track app startup time, network requests
Custom Metrics: Track business KPIs
Alerts: Email and Slack notifications for critical issues

🔮 Future Enhancements

Planned Features

Ride Scheduling: Book services in advance
Subscription Plans: Monthly roadside assistance packages
Fleet Management: Corporate accounts for vehicle fleets
Roadside Marketplace: Purchase items (gas cans, tire repair kits)
Insurance Integration: Direct billing to insurance companies
Hero Teams: Multi-hero coordination for large jobs
AI-Powered ETA: Machine learning for more accurate ETAs
Weather Alerts: Proactive notifications during bad weather
Multi-Vehicle Support: Manage multiple vehicles per user
Referral Program: Earn credits by referring friends

Technical Improvements

GraphQL API: More efficient data fetching
WebSocket Integration: Even lower latency for real-time updates
ML-Based Pricing: Dynamic pricing based on historical data
Advanced Analytics: Predictive analytics for demand forecasting
Offline Mode: Limited functionality without internet
Voice Assistant: Hands-free operation while driving

📈 Business Model

Revenue Streams

Service Commissions: 15-20% commission on each service
Subscription Plans: Premium user memberships
Hero Fees: Hero onboarding and platform fees
Advertising: Sponsored hero listings
Insurance Partnerships: Referral fees from insurance companies
Corporate Accounts: B2B fleet management services

Key Metrics

User Acquisition Cost (UAC)
Hero Retention Rate
Average Service Value
Customer Lifetime Value (CLV)
Service Completion Rate
Hero Utilization Rate
Geographic Coverage
Response Time (Request to Hero Assignment)

🏆 Competitive Advantages

Real-Time GPS Precision: Radar.io + MapLibre integration provides superior location accuracy
Dynamic Pricing: Weather-aware, time-based, and demand-based pricing maximizes revenue
Advanced Matching Algorithm: Multi-criteria hero matching ensures optimal service quality
Comprehensive Service Portfolio: Six core services in one app
Hero-Centric Design: Features designed to maximize hero earnings and satisfaction
Battery Efficiency: Smart tracking algorithms reduce battery drain
Enterprise-Grade Infrastructure: Firebase + Google Cloud ensures reliability and scalability
Payment Flexibility: Multiple payment options with instant payouts for heroes
Safety First: Background checks, real-time tracking, and emergency features
Multi-Language Support: 18+ languages for global expansion

📱 Technical Specifications

Minimum Requirements

iOS: 13.0+
Android: API Level 21+ (Android 5.0 Lollipop)
Internet: Required for core functionality
GPS: Required for location services
Storage: 100MB minimum free space

Permissions

Location: Always (for heroes), While Using (for users)
Camera: For document uploads and service verification
Photo Library: For profile photos and vehicle images
Notifications: For push alerts
Phone: For voice calls
Storage: For offline caching

Dependencies (Key Packages)

flutter_radar: ^3.12.4 - Radar SDK integration
maplibre_gl: ^0.20.0 - MapLibre native maps
firebase_core: 3.8.0 - Firebase initialization
cloud_firestore: 5.5.0 - Firestore database
firebase_auth: ^5.3.1 - Authentication
firebase_messaging: ^15.1.5 - Push notifications
firebase_database: ^11.1.6 - Realtime database
flutter_stripe: 11.1.0 - Stripe payments
geolocator: 13.0.1 - Geolocation services
geocoding: ^3.0.0 - Address geocoding
http: ^1.2.2 - API requests
provider: 6.1.2 - State management
go_router: 12.1.3 - Navigation

🎨 Design Philosophy

On The Way follows a user-first design philosophy:
Simplicity: Complex operations made simple through intuitive UI
Speed: Optimized for quick service requests in emergency situations
Transparency: Clear pricing and real-time updates build trust
Safety: Multiple safety layers protect users and heroes
Accessibility: Designed for all users, including those with disabilities
Reliability: Enterprise-grade infrastructure ensures 99.9% uptime

📞 Support & Documentation

User Support

In-app help center
24/7 customer support chat
Email support
Phone support for emergencies
FAQ and knowledge base

Hero Support

Dedicated hero support line
Hero community forum
Training materials and videos
Onboarding assistance
Technical support

Developer Documentation

API documentation (for admin dashboard)
Firebase setup guides
Radar integration guides
Stripe integration guides
Deployment documentation

🌟 Summary

On The Way represents the next generation of on-demand roadside assistance platforms. By combining Flutter's cross-platform capabilities, Firebase's robust backend infrastructure, Radar's industry-leading location services, and MapLibre's powerful mapping engine, the app delivers a seamless, reliable, and feature-rich experience for both users in need and heroes providing assistance.
The platform's advanced features—including real-time GPS tracking, intelligent hero matching, dynamic weather-aware pricing, and comprehensive service offerings—position it as a complete solution in the roadside assistance market. With its enterprise-grade architecture, scalability, and focus on user experience, On The Way is poised to revolutionize how people get help when they're stranded on the road.
Built with ❤️ using Flutter, Firebase, Radar, and MapLibre
Our early access on iOS thought TestFlight https://testflight.apple.com/join/gyMx5Nu2 Check our preview website: https://onthewayra.com/
Like this project

Posted Oct 27, 2025

Need roadside help? Our app connects you to skilled Heroes for gas, lockouts, tire changes, jump-starts, or towing. Get back on the road fast.

FoCoCo: New AI Golf Mental Coach Platform
FoCoCo: New AI Golf Mental Coach Platform
Step Into Fantasy with Coelle Audio App
Step Into Fantasy with Coelle Audio App
Studify: New Comprehensive AI Study Platform
Studify: New Comprehensive AI Study Platform
Lima Création: The hotel digital solution
Lima Création: The hotel digital solution

Join 50k+ companies and 1M+ independents

Contra Logo

© 2025 Contra.Work Inc