MechResQ is a comprehensive emergency roadside assistance mobile application built with Flutter. It connects users with nearby mechanics during vehicle emergencies, providing real-time tracking, service billing, digital payments, receipt generation, and multi-language support.
- Features
- Architecture
- Tech Stack
- Project Structure
- Getting Started
- Configuration
- Localization
- Firebase Setup
- Permissions
- Build and Run
- Key Services
- App Statistics
- Theming
- Roadmap
- License
- Emergency SOS - Quick access to emergency assistance with one tap
- Real-time Location Tracking - Live mechanic tracking on an OpenStreetMap (flutter_map) map with route and ETA
- Find Nearby Mechanics - Discover mechanics based on your current location
- Structured Service Request - Vehicle type (Car, Bike, Auto, Other) plus brand, model and year so the mechanic brings the right tools
- Photo and Video Attachments - Attach media to a request (uploaded to Cloudinary) that the mechanic can view full-screen
- In-app Chat - Direct communication with assigned mechanics
- Ratings and Reviews - Rate and review mechanic services
- Service Request Management - Create, track, and manage service requests
- Smart Bill Screen - Auto-calculated service estimate shown immediately after request creation
- Dynamic Pricing Engine - Calculates cost based on vehicle type, issue complexity, distance, labour, spare parts, platform fee, and GST (18%)
- Mechanic Final Bill - After the service, the mechanic adjusts labour and spare parts and submits a final bill; the customer sees this final bill (not the estimate) before paying
- Pay by Cash or Digitally - Razorpay integration for digital payments; cash uses a confirmation handshake
- Cash Confirmation Handshake - Cash bills stay pending until the mechanic confirms cash received, which then generates the receipt exactly like a digital payment
- Digital Receipts - Instant PDF receipt generation after payment
- PDF Download - Unlimited receipt downloads with MechResQ branding
- Payment History - Full payment history screen with filter options
- Estimate Mode - Bill screen shown after submission with Cancel Request option
- Tracking Mode - Track on Map button appears in Active tab when request is accepted
- History Mode - View Bill and Pay button in History tab for completed requests
- Receipt View - View Receipt button after payment; accessible from History tab indefinitely
- Phone OTP Authentication - Login via mobile number with SMS OTP verification
- Profile Management - Complete user profile with personal and vehicle information
- Vehicle Management - Add and manage multiple vehicles
- Emergency Contacts - Store and manage emergency contact information
- Service Reminders - Schedule and receive vehicle service reminders
- Multi-language Support - English and Kannada with full localization coverage
- Dark and Light Theme - Hazard-focused theme with customizable appearance
- Push Notifications - Real-time notifications for service updates with smart navigation
- Request History - View all past service requests with per-item delete (after payment)
- SOS History - Track all emergency events
- Legal and Support - Terms, Privacy Policy, and Help documentation
MechResQ follows a feature-based architecture with clear separation of concerns:
lib/
+-- core/ # Core utilities and constants
+-- l10n/ # Localization files (English and Kannada)
+-- models/ # Data models
+-- screens/ # UI screens
+-- services/ # Business logic and Firebase integration
+-- utils/ # Helper utilities
+-- widgets/ # Reusable UI components
+-- locale_provider.dart # Language management
+-- theme_controller.dart # Theme management
+-- theme.dart # App theming
+-- main.dart # App entry point
- Provider for state management
- Service Layer for business logic separation
- Repository Pattern for data access
- Singleton Pattern for Firebase services
- Flutter 3.10+ - Cross-platform UI framework
- Material Design 3 - Modern UI components
- Provider - State management solution
- Firebase Authentication - Phone number authentication with SMS OTP
- Cloud Firestore - Real-time NoSQL database and the bridge between the user and mechanic apps
- Cloudinary - Image and video storage (Firebase Storage avoided; it requires billing)
- Firebase Cloud Messaging - Push notifications
- flutter_map (OpenStreetMap / Geoapify) - Live mechanic tracking map, route, and ETA
- Geoapify Routing API - Driving route, distance, and ETA (free tier, no card)
- Google Maps Flutter - Used by some legacy map screens; being phased out in favour of flutter_map
- Geolocator - Location services
- Geocoding - Address resolution
- Cloudinary - Photos and videos attached to service requests (unsigned upload preset). Firebase Storage is intentionally avoided as it now requires a billing plan.
- Razorpay Flutter - Payment gateway (Test and Live mode support)
- PDF - Receipt and invoice generation
- Printing - PDF preview, download, and share
- flutter_localizations - Internationalization
- intl - Date/time formatting and localization
- cached_network_image - Efficient image loading
- image_picker - Camera and gallery access
- url_launcher - External link handling
- flutter_secure_storage - Secure data storage
- permission_handler - Runtime permissions
- timezone - Timezone handling
- path_provider - File system access for PDF saving
MechResQ_App/
+-- android/ # Android native code
+-- ios/ # iOS native code
+-- assets/ # Images, icons, and assets
| +-- icons/ # App icons
| +-- mechresq_logo.png # App logo (used in receipts and PDF)
| +-- mechresq_logo.svg # SVG version of logo
+-- lib/
| +-- core/ # Core utilities
| | +-- config/
| | +-- payment_config.dart # Razorpay keys and settings
| +-- l10n/ # Localization
| | +-- app_en.arb # English translations (350+ strings)
| | +-- app_kn.arb # Kannada translations (350+ strings)
| | +-- app_localizations.dart
| +-- models/ # Data models
| | +-- emergency_contact.dart
| | +-- payment.dart
| | +-- receipt.dart
| | +-- request_tracking.dart
| | +-- service_reminder.dart
| | +-- sos_event.dart
| | +-- vehicle.dart
| +-- screens/ # UI Screens
| | +-- bill_screen.dart
| | +-- chat_mechanic_screen.dart
| | +-- create_request_screen.dart
| | +-- home_screen.dart
| | +-- login_screen.dart
| | +-- my_requests_screen.dart
| | +-- payment_history_screen.dart
| | +-- receipt_detail_screen.dart
| | +-- receipt_success_screen.dart
| | +-- request_tracking_screen.dart
| | +-- settings_screen.dart
| | +-- submit_review_screen.dart
| | +-- track_mechanic_screen.dart
| | +-- ... (additional screens)
| +-- services/ # Business logic services
| | +-- auth_service.dart
| | +-- billing_service.dart
| | +-- firestore_service.dart
| | +-- location_service.dart
| | +-- notification_service.dart
| | +-- payment_firestore_service.dart
| | +-- pdf_receipt_service.dart
| | +-- razorpay_service.dart
| | +-- receipt_service.dart
| | +-- request_firestore_service.dart
| | +-- request_tracking_service.dart
| | +-- review_service.dart
| | +-- sos_service.dart
| | +-- vehicle_service.dart
| +-- utils/ # Helper utilities
| +-- widgets/ # Reusable components
| +-- locale_provider.dart # Language management
| +-- theme_controller.dart # Theme management
| +-- theme.dart # App theming
| +-- main.dart # Entry point
+-- test/ # Unit and widget tests
+-- pubspec.yaml # Dependencies
+-- l10n.yaml # Localization config
+-- README.md # This file
- Flutter SDK 3.10.0 or higher
- Dart SDK 3.10.0 or higher
- Android Studio or Xcode (for mobile development)
- Firebase Account (for backend services)
- Geoapify API key (free, for map tiles and routing)
- Cloudinary account (free, for photo/video uploads)
- Razorpay Account (for payment features)
-
Clone the repository
git clone <repository-url> cd MechResQ_App
-
Install dependencies
flutter pub get
-
Generate localization files
flutter gen-l10n
-
Configure Firebase (see Firebase Setup section)
-
Add Google Maps API Key (see Configuration section)
-
Run the app
flutter run
- Get an API key from Google Cloud Console
- Enable Maps SDK for Android and Maps SDK for iOS
- Add the key to:
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")Open lib/core/config/payment_config.dart and update:
static const String razorpayKeyId = 'rzp_live_YOUR_KEY_HERE';
static const bool isTestMode = false;For test mode, use the test key. For production, replace with your live key from the Razorpay Dashboard.
Live tracking and request media use free services configured via local files that are excluded from version control. Copy the templates and fill in your values:
lib/utils/map_config.dart (from map_config.example.dart)
lib/utils/cloudinary_config.dart (from cloudinary_config.example.dart)
- Geoapify (
map_config.dart): sign up at geoapify.com (no credit card), create a project, and paste the API key. Used for map tiles and routing. If no key is set, the app falls back to plain OpenStreetMap tiles and straight-line ETA. - Cloudinary (
cloudinary_config.dart): create an unsigned upload preset and set the cloud name plus preset name. Theautoupload endpoint accepts both images and videos.
MechResQ supports multi-language internationalization.
- English (en) - Complete (350+ strings)
- Kannada (kn) - Complete (350+ strings)
- Hindi (hi)
- Tamil (ta)
- Telugu (te)
- Malayalam (ml)
- All screens fully localized
- Dynamic language switching at runtime
- Language preference persisted across app restarts
- Billing and receipt screens fully translated
- Create a new ARB file:
lib/l10n/app_<locale>.arb - Copy
app_en.arband translate all strings - Add the locale to
main.dartsupported locales:supportedLocales: const [ Locale('en'), Locale('kn'), Locale('hi'), // New language ]
- Run
flutter gen-l10n
- Go to Firebase Console
- Create a new project
- Add Android and/or iOS app
Android:
- Download
google-services.json - Place in
android/app/
iOS:
- Download
GoogleService-Info.plist - Place in
ios/Runner/
- Authentication: Phone Number with SMS OTP
- Cloud Firestore: Create database
- Cloud Storage: Create storage bucket
- Cloud Messaging: Enable for push notifications
The app uses the following Firestore collections:
| Collection | Purpose |
|---|---|
users |
User profiles |
requests |
Service requests (status, finalBill, billStatus, live tracking source) |
requestTracking |
Legacy tracking collection (retired; tracking now reads requests + mechanics live GPS) |
payments |
Payment transactions (legacy) |
receipts |
Service receipts (current) |
reviews |
Mechanic ratings and reviews |
mechanics |
Mechanic profiles + live GPS (liveLat/liveLng), read by user app |
sosEvents |
SOS emergency events |
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
allow read: if request.auth != null;
allow write: if request.auth != null && request.auth.uid == userId;
}
match /requests/{requestId} {
allow read: if request.auth != null;
allow create: if request.auth != null;
allow update: if request.auth != null;
}
match /receipts/{receiptId} {
allow read: if request.auth != null;
allow create: if request.auth != null;
allow update: if request.auth != null;
}
match /reviews/{reviewId} {
allow read: if request.auth != null;
allow create: if request.auth != null;
}
}
}<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/><key>NSLocationWhenInUseUsageDescription</key>
<string>We need your location to find nearby mechanics</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>We need your location for real-time tracking</string>
<key>NSCameraUsageDescription</key>
<string>We need camera access to take photos of vehicle issues</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>We need photo library access to select images</string># Run on connected device or emulator
flutter run
# Run on specific device
flutter devices
flutter run -d <device-id>Android APK (single file):
flutter build apk --releaseAndroid APK (split by architecture - smaller size):
flutter build apk --release --split-per-abiAndroid App Bundle (Play Store - recommended):
flutter build appbundle --releaseiOS:
flutter build ios --release# Analyze code
flutter analyze
# Run tests
flutter test
# Check for outdated dependencies
flutter pub outdated
# Clean build cache
flutter clean && flutter pub get- Calculates service estimates based on vehicle type, issue description keywords, distance, and fixed charges
- Complexity detection: Low, Medium, High, Critical based on keywords
- Charges: Base service fee, Labour, Call-out/travel, Spare parts estimate, Platform fee, GST 18%
- Wraps the Razorpay Flutter SDK
- Handles payment success, failure, and external wallet events
- Test mode and live mode configuration
- CRUD operations on the
receiptsFirestore collection - Marks receipts as paid (digital via Razorpay or cash via mechanic confirmation)
- Real-time stream of user receipts
- Generates single-page A4 PDF receipts using the
pdfpackage - Includes MechResQ logo, itemised breakdown, payment info, GST note
- Share or save via system sheet using the
printingpackage
- Manages the
requestTrackingFirestore collection - Creates tracking documents on request submission
- Falls back to
requestscollection if tracking doc is missing (auto-creates) - Sends local notifications on status transitions
- Local notifications via
flutter_local_notifications - FCM integration via
firebase_messaging - Smart navigation on notification tap
- Typed convenience methods for each notification event
- Submit, update, and delete mechanic reviews
- Recalculates mechanic average rating on each submission
- Helpful/not-helpful vote system
- Phone number registration and login via SMS OTP
- OTP verification and session management
- Profile setup after first login
| Metric | Value |
|---|---|
| Screens | 35+ |
| Services | 15+ |
| Models | 7 |
| Localized Strings | 350+ per language |
| Supported Languages | 2 (English, Kannada) |
| Firebase Services | 4 (Auth, Firestore, Storage, Messaging) |
| Payment Gateway | Razorpay |
MechResQ uses a hazard-focused theme:
- Primary Color: High-visibility yellow (#FFD400)
- Accent Color: Orange (#FF8A00)
- Dark Theme: Full dark mode support with hazard palette
- Light Theme: Clean white background with yellow primary
- Material Design 3: Modern accessible UI components
- Dynamic Switching: Users can switch Light, Dark, or System in Settings
- Core service request and tracking features
- Real-time location tracking
- Bill screen with smart pricing engine
- Razorpay digital payments
- PDF receipt generation and download
- Multi-language support (English, Kannada)
- Push notifications with smart navigation
- User profile and vehicle management
- SOS emergency features
- Ratings and reviews system
- Request history with per-item delete
- Mechanic app (separate partner app)
- Cash payment confirmation by mechanic
- Open-source map migration (flutter_map + Geoapify) for live tracking
- Photo and video attachments uploaded to Cloudinary
- Auto-trigger review screen after service completion
- Real GPS distance passed to billing
- FCM token saved to Firestore for server-push notifications
- Chat with Firebase Realtime integration
- Add more languages (Hindi, Tamil, Telugu)
- AI-powered issue diagnosis
- Video call support
- Subscription plans for mechanics
- Referral and promo code system
- Advanced analytics dashboard
This project is proprietary software. All rights reserved.
For support, email [email protected] or open an issue in the repository.