🚗 Inspiration The idea for Refuel came from a common daily struggle — waiting in long queues at petrol, CNG, or EV stations without knowing how busy they are in advance. Google Maps can show where the stations are, but it can’t tell you how crowded they are. That frustration inspired us to build an app that not only shows the nearest station but also helps you choose the smartest one — based on real-time crowd data.

⚙️ What It Does Refuel is a smart fuel companion app that: Shows nearby fuel stations (Petrol, Diesel, CNG, EV) within a 3km radius Uses real-time and historical data to estimate crowd levels Calculates wait time at the station (not just travel time) Lets users filter stations by crowd, distance, rating, or use the Best filter Offers detailed station info: fuel prices, amenities, ratings, and bookmark option It’s built to save time, reduce stress, and help users make faster fueling decisions.

🛠️ How We Built It Frontend: Flutter (for cross-platform UI) Backend: Node.js + Express.js Database: MongoDB Authentication: Bcrypt (for password hashing) + JWT (for secure sessions) APIs Used: Google Maps Places API Google Maps Directions API Google Maps Routes API Google Maps SDK for Flutter Popular Times data (scraped where applicable)

🧱 Challenges We Ran Into Estimating real-time crowd levels using data not directly exposed by Google APIs Designing logic to analyze multi-directional traffic delays Keeping the UI responsive while asynchronously loading live traffic and station data Dealing with inconsistencies or gaps in Popular Times data

🏆 Accomplishments That We're Proud Of Built a fully working crowd-aware fuel station finder from scratch Designed a clean, responsive UI with real-time updates Successfully implemented crowd scoring logic combining live traffic and historical data Secured backend with password encryption and token-based auth

📚 What We Learned How to combine multiple Google Maps APIs to create a meaningful real-time experience Techniques to model non-standard data like crowd levels Efficient Flutter state management and UI responsiveness Best practices for backend API structure and security

🚀 What's Next for Refuel 🔍 Integrate Google Roads API to track congestion around pump entry/exit points 📷 Use camera + AI to estimate live queue length (where available) 🚨 Add fuel availability alerts for stations temporarily out of service 🚗 Add filters by vehicle type — for 2-wheelers, EVs, commercial vehicles, etc. 📈 Expand crowd detection to include road segment density analysis

Basic code example how I fetched crowd : -

  static Future<String> getCrowdLevelMultiDirection({
    required double lat,
    required double lng,
    required String apiKey,
  }) async {
    final offsets = [
      [0.0009, 0.0],   // ~ North
      [-0.0009, 0.0],  // ~South
      [0.0, 0.0009],   // ~East
      [0.0, -0.0009],  // ~ West

    ];

    int totalDelay = 0;
    int validRoutes = 0;

    for (final offset in offsets) {
      final originLat = lat + offset[0];
      final originLng = lng + offset[1];

      final url = Uri.parse(
        'https://maps.googleapis.com/maps/api/distancematrix/json'
            '?origins=$originLat,$originLng'
            '&destinations=$lat,$lng'
            '&departure_time=now'
            '&traffic_model=best_guess'
            '&mode=driving'
            '&key=$apiKey',
      );

      try {
        final response = await http.get(url);

        if (response.statusCode == 200) {
          final data = jsonDecode(response.body);
          final elements = data['rows']?[0]?['elements']?[0];

          if (elements != null &&
              elements['status'] == 'OK' &&
              elements['duration'] != null) {
            final int duration = elements['duration']['value'];
            final int durationInTraffic = elements['duration_in_traffic']?['value'] ?? duration;

            final int delay = durationInTraffic - duration;
            totalDelay += delay;
            validRoutes++;
          } else {
            print("❗ No valid element for $originLat,$originLng → $lat,$lng");
          }
        } else {
          print("❌ API error ${response.statusCode} for $originLat,$originLng");
        }
      } catch (e) {
        print("❌ Exception during Distance Matrix call: $e");
      }
    }

    if (validRoutes == 0) {
      print("❌ No valid routes. Returning 'unknown'.");
      return 'unknown';
    }

    final int avgDelay = totalDelay ~/ validRoutes;
    print("✅ Avg delay from $validRoutes routes: $avgDelay sec");

    if (avgDelay < 30) return 'green';
    if (avgDelay < 90) return 'yellow';
    if (avgDelay < 180) return 'orange';
    return 'red';
  }

Built With

Share this project:

Updates