A comprehensive Flutter mobile application for comparing cab fares across multiple ride-sharing services. FareFinder helps users make informed decisions by providing real-time fare estimates from various cab providers including Uber, Ola, Rapido, and BluSmart.
- Google Places Autocomplete: Smart location search with real-time suggestions
- Multi-Service Fare Comparison: Compare fares across Uber, Ola, Rapido, and BluSmart
- Clean, Intuitive UI: Modern Material Design interface
- State Management: Efficient state management using Provider pattern
- Responsive Design: Optimized for various screen sizes
- Booking Management: Create and track booking history
- RESTful API: Clean API endpoints for fare estimation and booking management
- Multi-Provider Integration: Mock implementations for major cab services
- CORS Support: Cross-origin resource sharing enabled
- Scalable Architecture: Modular backend structure for easy expansion
- Health Check Endpoint: Monitor backend service status
- Flutter (Dart)
- Provider - State management
- HTTP - API communication
- Google Places API - Location autocomplete
- Material Design - UI components
- Node.js - Runtime environment
- Express.js - Web framework
- CORS - Cross-origin requests
- Firebase Admin (Ready for integration)
FareFinder/
βββ lib/ # Flutter source code
β βββ models/ # Data models
β β βββ booking.dart
β β βββ cab_service.dart
β β βββ place_prediction.dart
β βββ providers/ # State management
β β βββ fare_provider.dart
β βββ screens/ # UI screens
β β βββ booking_history_screen.dart
β β βββ home_screen.dart
β β βββ results_screen.dart
β βββ services/ # API and external services
β β βββ api_service.dart
β β βββ places_service.dart
β βββ widgets/ # Reusable UI components
β β βββ location_autocomplete.dart
β βββ main.dart # App entry point
βββ backend/ # Node.js backend
β βββ server.js # Main server file
β βββ package.json # Dependencies
βββ README.md # Project documentation
- Flutter SDK (latest version)
- Node.js and npm
- Google Cloud Platform account (for Places API)
- Android Studio or VS Code with Flutter extensions
-
Navigate to backend directory:
cd backend -
Install dependencies:
npm install
-
Start the server:
npm start
The backend will run on
http://localhost:3000
-
Install Flutter dependencies:
flutter pub get
-
Configure Google Places API:
- Create a Google Cloud Platform project
- Enable the Places API
- Generate an API key
- Update the API key in
lib/services/places_service.dart:final String apiKey = 'YOUR_GOOGLE_PLACES_API_KEY';
-
Run the app:
flutter run
- GET
/health- Health check endpoint - POST
/api/fare-estimate- Get fare estimates{"pickup": "Location Name", "destination": "Location Name"} - POST
/api/bookings- Create a new booking - GET
/api/bookings/:userId- Get user's booking history
The app integrates with Google Places API for:
- Autocomplete: Real-time location suggestions
- Place Details: Detailed information about selected locations
- Geocoding: Convert addresses to coordinates
The LocationAutocomplete widget provides:
- Debounced Search: Optimized API calls with 500ms delay
- Real-time Suggestions: Dynamic list of location predictions
- Error Handling: Graceful handling of API failures
- Custom Styling: Consistent with app theme
// Usage in HomeScreen
LocationAutocomplete(
hintText: 'Enter pickup location',
onPlaceSelected: (prediction) {
// Handle place selection
},
)The app compares fares across multiple services:
- Uber: Various ride types (UberGo, UberPremium, etc.)
- Ola: Multiple categories (Mini, Prime, etc.)
- Rapido: Bike and auto options
- BluSmart: Electric cab service
Using Provider pattern for:
- Fare Data: Managing fare estimates and loading states
- Location State: Tracking pickup and destination selections
- Booking History: Managing user's booking records
-
Enable APIs:
- Places API
- Geocoding API (optional, for coordinate conversion)
-
API Key Restrictions (Recommended):
- Application restrictions: Android apps
- API restrictions: Places API
-
Billing: Ensure billing is enabled for your GCP project
The backend includes mock data for cab services. To integrate with real APIs:
- Add API keys for each service in environment variables
- Implement actual API calls in respective service modules
- Handle authentication and rate limiting
- Use proper state management with Provider
- Implement error handling for all API calls
- Follow Material Design guidelines
- Use const constructors where possible
- Implement proper loading states
- Use proper HTTP status codes
- Implement input validation
- Add proper error handling middleware
- Use environment variables for configuration
- Implement logging for debugging
-
Google Places API not working:
- Check API key validity
- Ensure Places API is enabled
- Verify billing is set up
- Check API quotas and limits
-
Backend connection issues:
- Ensure backend is running on correct port
- Check CORS configuration
- Verify API endpoints are correct
-
Flutter build issues:
- Run
flutter clean - Delete
pubspec.lockand runflutter pub get - Check Flutter and Dart SDK versions
- Run
- Use Flutter Inspector for UI debugging
- Check browser developer tools for API calls
- Monitor backend logs for API errors
- Use
print()statements for debugging state changes
- Firebase Integration: User authentication and data persistence
- Real-time Tracking: Live tracking of booked rides
- Payment Integration: In-app payment processing
- Push Notifications: Ride status updates
- Favorites: Save frequently used locations
- Price Alerts: Notify users of fare changes
- Route Optimization: Suggest optimal routes
- Multi-city Support: Expand to multiple cities
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you have any questions or run into issues, please:
- Check the troubleshooting section above
- Open an issue on GitHub
- Review the Flutter and Node.js documentation
Happy Coding! π