HomeCase studiesOn-Demand Fuel Service & Station Attendant Dispatch...

Case study · Copenhagen, Denmark

On-Demand Fuel Service & Station Attendant Dispatch Platform

Fuel retail and on-demand mobility services

Motorists and commercial fleet drivers lose valuable time queuing at busy forecourts or managing routine vehicle care, while fuel retailers struggle to coordinate station attendants efficiently across pump bays and mobile service zones. We engineered a three-sided on-demand fueling and station attendant platform featuring native Android (Kotlin) and iOS (Swift and SwiftUI) customer and attendant apps, backed by a Laravel and MySQL dispatch engine, Blade station administration tools, and Firebase real-time location and status streams. Drivers request pump-side assistance or scheduled refueling, attendants follow guided safety checklists, and operators reconcile metered volumes transparently.

Industry
Fuel retail and on-demand mobility services
Solution
An on-demand fueling and station attendant dispatch platform built with Kotlin, Swift, SwiftUI, Laravel, Blade, MySQL, and Firebase.
Platforms
Android · iOS · Web & API
Stack
Laravel · PHP · Blade · MySQL · Kotlin · Swift
Location
Copenhagen, Denmark · delivered remotely
Role
Engineering, with the team behind for mobile and QA

Delivered remotely for a business based in Copenhagen, Denmark. Names withheld by agreement.

Project Overview

Fuel retail is evolving beyond self-service pumps toward high-convenience concierge care—both on station forecourts and for parked commuter or fleet vehicles in designated service zones. Yet orchestrating physical fuel handling requires far tighter discipline than parcel delivery: an attendant cannot risk pumping petrol into a diesel tank, losing GPS lock inside a parking structure, or miscalculating metered liters against pre-authorized card holds.

We built an on-demand fuel service and station attendant platform tailored for Danish urban mobility operations. Native Swift and SwiftUI apps on iOS alongside Kotlin apps on Android serve both motorists and station attendants, connected to a Laravel and MySQL transactional core, Blade station-management consoles, and Firebase real-time dispatch telemetry.

Forecourt Dispatch & Pump-Side Constraints

Digitizing attended fueling and add-on vehicle care introduces stringent physical and operational constraints:

  • Misfuel liability: Verbal bay instructions or hurried manual entry risk mismatching fuel grades against customer vehicle tanks.
  • Variable settlement amounts: Tank capacity limits mean the final dispensed liter volume rarely matches the driver's initial order estimate, requiring clean pre-authorization and partial-capture flows.
  • Outdoor and gloved usability: Station attendants operating in rain, cold wind, and busy forecourts need high-contrast, single-handed controls rather than cluttered web views.
  • Race conditions in job claiming: Dispatching urgent requests to multiple nearby attendants without strict locking produces awkward double-arrivals and confused drivers.

Architectural Strategy

We anchored the system around a strict server-enforced state machine in Laravel and MySQL paired with Firebase as a low-latency dispatch signal bus. Every order advances sequentially through validated states—requested, assigned, arrived, safety-verified, fueling, completed—with database transactions guarding ownership claims and financial capture.

On mobile, native SwiftUI and Kotlin interfaces optimize for speed and clarity: drivers pin their vehicle location, pick fuel grade and optional services (such as washer fluid top-ups or tire checks), and watch arrival progress live; attendants receive audible Firebase job alerts, scan vehicle/pump tags, record exact metered liters, and issue itemized receipts. Station supervisors oversee pricing, shift rosters, and safety audits through Blade administrative consoles.

Core Capabilities

  • Vehicle-Profile Grade Locking: Motorists register license plates and required fuel types once; attendants verify the physical cap or bay code before unlocking the fueling step.
  • Real-Time Attendant Dispatch & Routing: Geofenced matching routes requests to available forecourt or mobile attendants with live ETA updates streamed via Firebase.
  • Metered Finalization & Dynamic Pricing: Station managers adjust per-grade pricing by zone or site in Blade, while orders settle automatically against exact metered liters delivered.
  • Safety & Environmental Checklists: Mandatory pre-dispense confirmations—grounding, ignition off, no leaks, spill-kit ready—attach timestamped audit records to every job.
  • Shift & Fleet Reconciliation: Daily summaries reconcile dispensed volumes by fuel grade, attendant shift, and station bay against payment gateway settlements.

Technical Architecture

Motorists submit fuel requests from SwiftUI or Kotlin clients to Laravel APIs, which validate station coverage, lock current unit pricing, and authorize payment holds inside MySQL. Laravel pushes dispatch payloads through Firebase Cloud Messaging and Realtime Database to eligible online attendants. When an attendant taps Accept, Laravel acquires a pessimistic MySQL lock to finalize assignment, while the attendant's native device streams adaptive GPS coordinates back to Firebase for the customer map. Upon delivery completion, metered volume triggers exact capture and asynchronous PDF/email receipt jobs.

Flow: Motorist Request (SwiftUI / Kotlin) → Laravel Pre-Auth & Pricing Lock (MySQL) → Firebase Attendant Broadcast → Atomic Claim Lock → Native Safety Check & Metered Settlement → Blade Shift Reconciliation

Separating live map telemetry (Firebase) from monetary and safety state transitions (Laravel + MySQL) keeps dispatch fluid while preserving auditable financial accuracy.

Technology Stack

Category Technology detail
Dispatch & Billing API Laravel (PHP 8.x order state machine, dynamic fuel pricing, payment capture)
iOS Customer & Attendant Apps Swift & SwiftUI native interfaces for one-tap requests, live tracking, and pump workflows
Android Native Apps Kotlin applications with background foreground-service GPS and NFC/QR bay scanning
Operations & Station Portal Laravel Blade dashboards for forecourt shift control, price boards, and reconciliation
Transactional Database MySQL for orders, vehicle profiles, fuel grades, attendant shifts, and settlement ledgers
Real-Time Telemetry Firebase Realtime Database & FCM for live attendant coordinates and instant job offers
Safety & Audit Logging Immutable MySQL event logs capturing pre-fueling safety checks and metered receipts
Background Job Queues Laravel Queues for receipt generation, station payout batches, and SLA escalation alerts

Engineering Trade-offs & Solutions

Engineering Challenge Solution & Trade-off
Maintaining responsive live tracking without excessive mobile battery drain Tuned native Kotlin foreground services and Swift CoreLocation policies to throttle GPS intervals by order stage, trading continuous idle tracking for full-shift battery endurance.
Handling partial tank fills gracefully during payment settlement Replaced fixed-amount charges with payment pre-authorization followed by server-side exact capture in Laravel, adding mild gateway complexity to eliminate manual refund workflows.
Delivering clear attendant UIs across bright sunlight and winter conditions Designed high-contrast SwiftUI and Kotlin Jetpack screens with oversized primary actions and offline retry buffers for underground parking bays, trading extra native UI maintenance for superior field ergonomics.
Preventing stale fuel prices between browse and checkout Bound every checkout quote to a short-lived server price snapshot ID in MySQL, ensuring transparent user confirmation if a station updates pump prices mid-session.

Security & Reliability

Handling fuel and unattended vehicle access demands rigorous accountability. Attendant onboarding validates safety certifications and station assignments in Laravel before issuing device-bound credentials. Firebase security rules restrict live coordinate streams solely to the assigned motorist and operations supervisors for the duration of an active order, expiring read access automatically once fueling finishes.

Every API transition enforces idempotency keys so flaky forecourt Wi-Fi or garage dead zones never trigger duplicate charges when an attendant taps Complete twice. Critical exceptions—such as prolonged orders stuck in fueling status or mismatched meter tolerances—raise immediate alerts in the Blade operations console.

Performance & Scale

Commuter rush hours and weekend travel peaks create concentrated regional demand spikes around major stations and parking hubs. Stateless Laravel containers scale behind load balancers, while MySQL handles high-concurrency order claims using narrow indexed queries rather than long-running table locks.

Background queue workers offload receipt rendering, fleet invoicing exports, and nightly fuel-volume reconciliations, keeping customer checkout and attendant state transitions consistently snappy. Firebase pushes delta updates rather than full order objects, keeping mobile bandwidth minimal even inside congested urban cells.

Operational Outcomes

Unifying customer requests, native attendant safety workflows, and station accounting under one architecture elevated service reliability across every forecourt touchpoint:

  • Eliminated misfuel guesswork: Mandatory vehicle-profile matching and QR/bay verification guard every dispense before fuel flows.
  • Transparent metered billing: Automated pre-authorization and exact-liter capture keep pricing fair for drivers while simplifying station accounting.
  • Coordinated attendant utilization: Real-time Firebase dispatch and atomic MySQL job locking eliminate idle overlap across pump bays and mobile service zones.
  • Complete regulatory auditability: Timestamped safety checklists, attendant identities, and reconciled fuel-grade logs remain immediately accessible inside Blade operational reports.

01 — Questions

asked about this kind of project

How do you prevent two station attendants from claiming the same fuel request simultaneously?

Although Firebase broadcasts incoming job alerts immediately to nearby attendants, claim requests hit a Laravel endpoint protected by a MySQL row-level transaction lock. Only the first committed state transition assigns the order and updates Firebase to withdraw the offer from other devices.

Why build separate native apps in Kotlin and Swift/SwiftUI instead of a shared wrapper?

Fuel attendants work outdoors in gloves and inclement weather while relying on background GPS services, reliable foreground notifications, and instant QR or NFC vehicle identification. Native Kotlin and SwiftUI deliver rock-solid hardware integration, crisp ergonomics, and predictable battery efficiency.

How is payment handled when final fuel volume differs slightly from the driver's pre-order estimate?

Laravel places a pre-authorization hold for the requested ceiling before dispatch. Once the attendant enters or captures the metered liters delivered, an atomic settlement step captures the exact final amount and immediately releases any unused authorization.

How do you enforce fuel-grade accuracy and forecourt safety compliance before dispensing starts?

The attendant app locks the dispensing step until the attendant scans the vehicle or bay marker, confirms the matching fuel grade (e.g., E10 petrol, diesel, or AdBlue) against the customer's stored vehicle profile, and completes a mandatory safety checklist.

How does Firebase location tracking avoid draining attendant device batteries during long shifts?

Kotlin and Swift location managers adapt sampling frequency dynamically based on shift state—throttling GPS pings while idle at the station and increasing accuracy only when actively navigating to a parked vehicle or approaching a customer bay.

03 — Similar project?

describe what is different about yours

Build yours.

Tell me what exists, what you need and the deadline. Fixed price for a defined scope, or $55/day (8–9 hours work) with a written plan first.

Solitaire Corporate Park, Makarba, Ahmedabad, Gujarat 380015, India · IST (UTC+5:30) · --:-- IST · Mon–Fri 09:00–18:00 IST · US & EU overlap daily

No newsletter, no CRM. Just a reply.