Connecting stranded drivers with nearby mechanics β in real time.
RoadMate is a real-time roadside assistance marketplace. When a driver breaks down, they raise a request; nearby mechanics are notified instantly, accept the job, and navigate to the driver β with live location tracking, in-app chat, and fare estimation throughout.
The platform sustains itself through a prepaid mechanic wallet: since driverβmechanic payments happen in cash, RoadMate pre-collects revenue at recharge time and deducts a commission (default 5%) from the mechanic's wallet after each completed job.
Status: Feature-complete, pre-launch. Preparing for Google Play release β see the Roadmap.
| Feature | Description |
|---|---|
| π§ Request Assistance | Broadcast a breakdown request to nearby mechanics in real time |
| πΊοΈ Find Mechanics | Browse nearby mechanics and workshops on an interactive map |
| π Live Tracking | Watch the assigned mechanic approach in real time |
| π¬ In-App Chat | Message the mechanic directly once the request is accepted |
| π§ Smart Diagnosis | Rule-based guided wizard that narrows down the likely fault before you call anyone |
| π° Fare Estimation | Distance-based fare preview before confirming |
| π¨ SOS | One-tap emergency screen for critical situations |
| β Ratings & Reviews | Rate the mechanic after job completion |
| π History | Full record of past requests and services |
| Feature | Description |
|---|---|
| π’ Job Requests | Receive live push notifications for nearby breakdowns |
| π’ Online / Offline | Toggle availability to control incoming jobs |
| π Prepaid Wallet | Top up balance; commission is auto-deducted per completed job |
| π³ Recharge | Submit an Easypaisa / JazzCash transaction for admin verification |
| π§Ύ Profile & Verification | Workshop details, services offered, experience, CNIC upload |
| π Earnings & Ratings | Auto-aggregated rating, computed server-side by Cloud Functions |
| Feature | Description |
|---|---|
| β Recharge Approval | Verify incoming payments and credit mechanic wallets |
| π₯ User Management | Oversee drivers and mechanics |
| βοΈ Remote Pricing Config | Change commission rate, minimum balance, and visit fee from Firestore β no app rebuild required |
RoadMate follows Clean Architecture with the MVVM presentation pattern. State is managed with provider.
lib/
βββ models/ # Firestore-mapped data structures
β # UserModel Β· DriverModel Β· MechanicModel
β # ServiceRequestModel Β· WalletModel Β· ReviewModel
β # ChatMessageModel Β· PricingConfig Β· NearbyMechanic
β
βββ repositories/ # Data access β the ONLY layer that touches Firebase
β # Auth Β· User Β· ServiceRequest Β· Tracking
β # Review Β· Wallet Β· Storage Β· Diagnosis
β
βββ viewmodels/ # State + business logic (ChangeNotifier)
β # Auth Β· Request Β· Chat Β· Wallet
β
βββ pages/ # Screens (Views)
β # Auth Β· Driver/Mechanic/Admin Dashboards
β # Chat Β· Wallet Β· Recharge Β· SOS Β· Profile Β· History β¦
β
βββ components/ # Reusable widgets
β # MapComponent Β· DiagnosisWizard Β· PaymentDialog
β # RatingDialog Β· AppDrawer Β· MobileLayout
β
βββ services/ # Domain services, framework-agnostic
β # DiagnosisEngine Β· FareEstimator Β· LocationService
β # MechanicFinder Β· NearbyShops Β· Notifications Β· EmailOTP
β
βββ theme/ # Design system
View βββΆ ViewModel βββΆ Repository βββΆ Firebase
β² β
βββββββββββ notifyListeners() ββββββββββββββββ
| Service | Role |
|---|---|
| Cloud Firestore | Primary datastore β users, requests, wallets, reviews, chat |
| Realtime Database | High-frequency GPS location streaming (cheaper & faster than Firestore for this) |
| Cloud Storage | Profile photos, CNIC images |
| Cloud Messaging (FCM) | Push notifications for new & accepted requests |
| Cloud Functions | onNewRequest β notify nearby mechanics Β· onRequestAccepted β notify the driver Β· rating aggregation |
| App Check | Abuse protection |
- Flutter SDK β₯ 3.0.0 Β· Dart β₯ 3.0.0
- Node.js (for Cloud Functions)
- Firebase CLI β
npm install -g firebase-tools - A Google Maps API key
git clone https://github.com/abdullahsokay/RoadMate.git
cd RoadMate
flutter pub getCreate a project in the Firebase Console, then enable:
- Authentication β Anonymous (backs the app's email-OTP session)
- Firestore Database
- Realtime Database (live location tracking)
- Cloud Storage (profile / CNIC uploads)
- Cloud Messaging
Register your Android app and drop google-services.json into android/app/.
For iOS, drop GoogleService-Info.plist into ios/Runner/.
π Detailed walkthrough: FIREBASE_SETUP.md
Enable Maps SDK for Android / iOS in the Google Cloud Console, generate an API key, then:
Android β android/app/src/main/AndroidManifest.xml
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="YOUR_API_KEY_HERE"/>iOS β ios/Runner/AppDelegate.swift
GMSServices.provideAPIKey("YOUR_API_KEY_HERE")
β οΈ Before going public: restrict the key to your Android SHA-1 + package name in the Cloud Console. An unrestricted Maps key that leaks will be abused and billed to your account.
cd functions
npm install
firebase login
firebase deploy --only functionsfirebase deploy --only firestore:rules,storage:rules,databaseRules live in firestore.rules, storage.rules, and database.rules.json.
flutter runPayments between driver and mechanic are settled in cash β so the platform can't skim a cut from the transaction itself. Instead:
1. Mechanic recharges PKR 1000 β money lands in the platform account
2. Wallet shows PKR 1000 β credit (a liability owed as service)
3. Job completed β5% β a slice becomes recognised revenue
4. Balance < minimum β β mechanic can't accept new jobs until they top up
Revenue is therefore pre-collected at recharge time β no chasing commission payments, and only one account to manage.
Recharge is currently manual: the mechanic pays via Easypaisa/JazzCash and submits the Transaction ID; an admin verifies and credits the wallet. A payment-gateway integration (Safepay / PayFast / Paymob) is the planned upgrade for scale.
Commission rate, minimum balance, starting bonus, and visit fee are all read from Firestore (config/pricing) β change them without shipping a new build.
π Full details: RECHARGE_AND_COMMISSION.md Β· WALLET_SETUP.md
flutter testCovers the diagnosis engine and the auth view-model.
- Change
applicationIdfromcom.example.roadmateto a real domain β Play Store rejectscom.example.* - Release signing β generate a keystore, wire up
key.properties, sign the App Bundle - Restrict the Maps API key to the release SHA-1 + package name
- Harden Firestore rules β the current identity model (anonymous auth keyed by an email-derived id) prevents per-owner rules; migrating to Firebase-native email/password auth would make
request.auth.uidtrustworthy - Target SDK 35 β mandatory for new Play Store submissions
- Privacy Policy hosted at a public URL β required, as the app collects location, phone, and payment data
- Data Safety form in the Play Console
- Payment gateway integration to automate recharges
- Store listing assets β icon, feature graphic, screenshots
| Layer | Technology |
|---|---|
| Framework | Flutter Β· Dart |
| State | Provider (MVVM) |
| Backend | Firebase β Firestore Β· Realtime DB Β· Storage Β· Auth Β· FCM Β· Functions Β· App Check |
| Maps & Location | google_maps_flutter Β· flutter_map Β· geolocator Β· location |
| Media | image_picker Β· flutter_image_compress |
| Utilities | flutter_local_notifications Β· url_launcher Β· share_plus Β· crypto Β· intl |
RoadMate/
βββ lib/ # Flutter application source
βββ functions/ # Firebase Cloud Functions (Node.js)
βββ android/ ios/ # Native platform shells
βββ web/ windows/ β¦ # Additional Flutter targets
βββ test/ # Unit & widget tests
βββ firestore.rules # Firestore security rules
βββ storage.rules # Cloud Storage security rules
βββ database.rules.json # Realtime Database rules
βββ firebase.json # Firebase project config
Built with Flutter & Firebase