Delivered remotely for a business based in Hamburg, Germany. Names withheld by agreement.
Project Overview
Organizations operating private bulk fuel depots—logistics carriers, municipal depots, construction yards, and port fleets—often lose visibility the moment fuel leaves a supplier's tanker and enters their own storage tanks. Paper clipboards at the pump, disconnected automatic tank gauges (ATGs), and manual spreadsheet reconciliations leave fleet managers unable to tie physical tank drops to specific vehicles, detect slow leaks or unauthorized draws, or close monthly cost-center accounting without days of detective work.
We built a connected fuel management and tank telemetry platform that links on-site dispensing hardware and bulk tank sensors directly to fleet accounting. Driven by a Java telemetry and control backend, MySQL immutable ledgers, Redis live-state coordination, a Vue web management console, and a React Native TypeScript mobile app, the platform gives operators real-time visibility from bulk delivery down to the individual vehicle fill-up.
Business Bottleneck
Unmonitored private fueling introduces two distinct operational leaks: physical inventory variance and administrative friction. Without electronic authorization at the nozzle, drivers skip odometer entries, select incorrect vehicle codes, or top off unlogged equipment. Meanwhile, tank gauge alarms sit trapped on local yard panels where nobody notices a sudden overnight drop or water-intrusion alert until a truck runs dry or a compliance audit flags missing volume.
Reconciling bulk tanker deliveries against pump totalizers across dozens of depots is equally painful when meter readings and gauge logs sit in separate silos. Engineering a reliable solution meant bridging industrial field gateways with modern web and mobile interfaces while keeping financial ledger consistency intact even when remote yard networks stutter.
Architectural Strategy
The platform separates real-time hardware coordination, immutable financial ledgering, and role-tailored user interfaces:
- Deterministic Java control & ingestion core: A dedicated Java backend processes continuous tank gauge polls, enforces pump state transitions, and executes variance calculations inside strongly typed, concurrency-safe services.
- Hot-state vs. ledger split: Redis holds ephemeral operational state—current tank fill levels, active pump leases, and alert cooldowns—while MySQL acts as the authoritative double-entry-style ledger for deliveries, dispense events, and cost allocations.
- Purpose-built client surfaces: Depot managers use a high-density Vue web console for multi-site analytics and accounting exports, while drivers use a streamlined React Native (React + TypeScript) mobile app at the dispenser.
Core Capabilities
- Mobile & Cardless Pump Authorization: Drivers scan a pump QR code or select a site nozzle in the React Native app, enter or verify the vehicle and odometer reading, and trigger remote pump authorization without physical fleet cards.
- Continuous Tank Telemetry & Strapping Conversion: Ingests liquid level, temperature, and water-bottom readings from bulk tank gauges, applying per-tank calibration strapping tables to display accurate net volume, ullage, and days-to-empty forecasts.
- Automated Variance & Leak Alerting: Compares idle tank level changes against recorded dispensing events to surface suspected leaks, water ingress, or unrecorded draws via Vue dashboard banners and Firebase push alerts.
- Delivery Reconciliation & Reorder Thresholds: Logs incoming bulk fuel tanker bills of lading alongside pre- and post-delivery gauge snapshots, flagging short deliveries and notifying dispatchers when sites cross reorder points.
- Cost-Center & Fleet Allocation Exports: Tags every liter dispensed with vehicle, driver, project, and unit cost metadata, generating clean accounting extracts for enterprise finance teams.
Technical Architecture
Flow: Tank gauges & pump controllers -> Site IoT gateway -> Java ingestion & control services -> Redis live cache / MySQL ledger -> Vue operations console & React Native TypeScript mobile app (Firebase).
Field gateways transmit tank telemetry packets and pump meter events over TLS to the Java backend. Upon arrival, Java normalizes raw sensor frames, converts millimeter depth to calibrated liters using cached strapping curves, updates current tank state in Redis, and appends telemetry snapshots to MySQL. When a driver taps to fuel in the React Native app, the Java authorization service checks driver/vehicle eligibility and site credit/limit rules, claims an exclusive Redis lock for that nozzle with a strict TTL, and dispatches the unlock command to the site controller.
Once the nozzle hangs up and the final pulse count arrives, Java releases the Redis lease, writes an immutable dispense transaction in MySQL linked to the active delivery cost layer, and pushes updated tank totals to active Vue dashboard sessions and mobile notification channels via Firebase.
Technology Stack
| Category | Technology detail |
|---|---|
| Core backend & telemetry | Java services for ATG gauge ingestion, pump control, and reconciliation |
| Web operations portal | Vue single-page application for depot oversight, alerts, and cost exports |
| Mobile driver application | React Native (React + TypeScript) for pump unlock and offline fill logging |
| Transactional ledger | MySQL storing bulk deliveries, dispense events, tanks, vehicles, and cost centers |
| Live state & locking | Redis for active pump leases, tank snapshots, and alert deduplication |
| Mobile push & diagnostics | Firebase Cloud Messaging and Crashlytics for real-time depot alerts |
| Hardware integration | Gateway protocols bridging automatic tank gauges (ATG) and dispenser controllers |
| Reporting & exports | Scheduled CSV/accounting feeds for ERP cost-center allocation |
Engineering Trade-offs & Solutions
| Architectural Dilemma | Chosen Solution & Rationale |
|---|---|
| Storing high-frequency pump lock states in MySQL vs. Redis | Managed active pump authorization leases in Redis with automatic TTL expiration so stuck client connections self-recover cleanly without row-lock contention on MySQL transaction tables. |
| Single web-responsive UI for all users vs. dedicated Vue + React Native clients | Built Vue for desktop fleet managers analyzing multi-tank tables and exports, and React Native with TypeScript for drivers operating gloved or one-handed in outdoor fueling lanes. |
| Trusting driver-entered volumes vs. hardware meter totalizers | Anchored final accounting strictly to hardware dispenser pulse counts when online, keeping manual mobile volume inputs clearly flagged as attendant-verified entries during offline fallback. |
| Alerting on every raw gauge jitter vs. hysteresis-based anomaly rules | Buffered ATG readings through Redis time windows inside Java so thermal expansion or delivery sloshing does not trigger false leak notifications via Firebase. |
Security & Reconciliation Integrity
Controlling physical fuel pumps over an API requires defense against replay attacks, unauthorized unlocks, and ledger tampering. Site gateways authenticate to the Java backend using mutually verified credentials and signed command envelopes, while mobile and web clients authenticate via short-lived scoped tokens tied to organization and site permissions.
Every dispense authorization checks vehicle-to-fuel-grade compatibility—preventing accidental diesel-into-gasoline or restricted-tank unlocks—and validates monotonic odometer sanity bounds against the vehicle's previous fill. In MySQL, finalized dispense records are append-only; corrections require explicit adjustment entries with operator attribution so financial audit trails remain intact.
Telemetry Throughput & Offline Resilience
Multi-depot fleets generate steady telemetry streams across dozens of tanks and pumps, interspersed with sudden bursts when shifts turn over and queues form at yard dispensers. Java worker pools process incoming gauge frames asynchronously from interactive pump-unlock endpoints so heavy background ingestion never delays a driver waiting at the nozzle.
On the React Native client, TypeScript interfaces enforce strict payload contracts with local persistence queues. If a yard loses mobile data mid-shift, drivers can log offline fills or attendant overrides seamlessly; the queue replays idempotently once signal returns, guaranteeing zero lost allocation records.
Operational Outcomes
Fleet operators gained a single operational picture uniting physical tank inventory, live pump activity, and vehicle-level fuel consumption across distributed yards. Automated variance checks surface gauge anomalies and unlogged draws early, while pre-validated cost-center tagging turns end-of-month fuel reconciliation from manual spreadsheet cross-checking into an auditable export workflow. Drivers move through fueling lanes faster with mobile authorization, and dispatchers schedule bulk tanker replenishments from live calibrated ullage data rather than guesswork.