Delivered remotely for a business based in Dublin, Ireland. Names withheld by agreement.
Project Overview
In quarry yards, construction depots, and haulage hubs, the physical transfer of diesel or AdBlue from a static tank or mobile bowser into machinery is where inventory accuracy is won or lost. Paper logbooks smudge in rain, illegible handwriting breaks fleet cost allocation, and cellular dead zones around steel storage tanks routinely stall naive cloud forms.
We built a mobile-first field operator application in Vue and TypeScript, paired with a Web & API backend, purpose-built for metered fuel dispensing. Running as an installable Progressive Web Application, the interface guides attendants through shift start, asset identification, opening and closing meter verification, and bulk tank dip logging—continuing seamlessly when connectivity drops and reconciling every litre cleanly once signals return.
Business Bottleneck
Site operations struggled with three compounding gaps before adopting structured field capture:
- Silent meter drift and transcription errors: Attendants writing down six-digit mechanical totalizer numbers at dusk frequently transposed digits, leaving finance teams chasing phantom stock losses at month-end.
- Disconnected mobile bowsers: Refuelling tankers travelling across remote civil engineering sites operated outside Wi-Fi range for entire shifts, forcing operators back onto paper until returning to the main depot.
- Delayed asset anomaly detection: Without on-screen access to a vehicle's prior odometer or engine-hour reading, pump operators had no immediate warning when an asset's meter stalled or consumption spiked abnormally.
Architectural Strategy
We chose a Vue 3 and TypeScript Progressive Web Application paired with a PostgreSQL-backed REST API so any ruggedized tablet or smartphone in the fleet could run identical validated workflows without app-store bottlenecks. Strict TypeScript interfaces model every pump event, totalizer boundary, and tank dip payload, catching unit mismatches and nullable edge cases at compile time rather than at the bowser.
Instead of holding live network locks during refuelling, the client treats IndexedDB as its active operational store. Operators sync reference catalogs—sites, tanks, nozzles, and fleet assets—into local storage before heading out, record dispenses as immutable local events with client-generated UUIDs, and rely on a background outbox worker to flush batches idempotently to the API.
Core Capabilities
- Guided Metered Dispense Flow: Operators pick a site and pump, confirm the pre-populated opening meter reading, scan or select the receiving vehicle or generator, enter odometer/hours, and record the closing totalizer with instant litre calculation.
- Offline Shift Continuity: Full catalog lookup, QR/barcode asset scanning, and multi-shift dispense queuing function with zero network availability, displaying clear sync-queue badges in the header.
- Bulk Tank Dip & Delivery Capture: Dedicated workflows let supervisors log ultrasonic or dipstick tank levels alongside supplier delivery dockets to keep theoretical and physical wet-stock aligned.
- Rollover & Anomaly Guardrails: Built-in validation warns attendants when a closing reading exceeds maximum tank capacity or jumps unexpectedly relative to an asset's previous odometer check.
- Web Reconciliation Console: Depot administrators inspect real-time shift queues, resolve flagged meter gaps, and export verified cost-centre allocations for downstream fleet accounting.
Technical Architecture
The frontend separates UI views from Pinia workflow stores and an isolated TypeScript synchronization engine. Every UI form operates against validated Pinia state persisted immediately to IndexedDB, ensuring a browser refresh or dead tablet battery never erases an un-synced fuel transfer.
Flow: Shift catalog sync into IndexedDB -> Operator scans fleet asset & confirms pump totalizer -> TypeScript validator checks bounds -> Dispense event saved to IndexedDB outbox -> Background sync POSTs with idempotency key -> REST API orders totalizers & updates PostgreSQL wet-stock ledger -> Web console reflects reconciled balances.
When a pump has multiple concurrent attendants using shared tablets, totalizer continuity checks on the backend reconstruct the exact physical sequence of dispenses, flagging missing intervals rather than blindly overwriting current pump totals.
Technology Stack
| Category | Technology detail |
|---|---|
| Frontend framework | Vue 3 using Composition API and modular single-file components |
| Type system | Strict TypeScript sharing request, ledger, and validation DTO contracts |
| State management | Pinia stores coordinating active pump sessions and operator shifts |
| Offline caching | Progressive Web App runtime powered by Workbox service workers |
| Local persistence | IndexedDB transactional outbox and locally cached fleet/tank catalogs |
| Asset scanning | Browser camera QR/barcode decoding with high-contrast manual search fallback |
| Backend API | RESTful JSON API with idempotency keys and optimistic concurrency checks |
| Database | PostgreSQL ledger storing immutable dispense events, meter totalizers, and dips |
| Reporting & export | Depot variance summaries and scheduled ERP-compatible accounting exports |
| Automated testing | Vitest unit tests for meter arithmetic and offline queue replay scenarios |
Engineering Trade-offs & Solutions
| Architectural Dilemma | Chosen Solution & Rationale |
|---|---|
| Native Android/iOS builds vs. Vue TypeScript PWA | Delivered an installable Vue PWA backed by Workbox and IndexedDB, eliminating native deployment delays across mixed yard tablets while keeping offline resilience intact. |
| Server-side balance decrement vs. totalizer-ordered event ledger | Recorded opening and closing pump totalizer readings on every event so the backend can sort out-of-order offline uploads and detect unmetered draws automatically. |
| Blocking network save vs. optimistic IndexedDB outbox | Committed every completed dispense locally first with a unique UUID key, letting operators move straight to the next vehicle in line even inside underground garages. |
| Free-text vehicle entry vs. cached catalog + QR scan | Paired camera QR decoding with fuzzy offline catalog search, stopping typo-driven orphan records that previously broke cost-centre reporting. |
Security & Reliability
Operators authenticate with scoped shift credentials backed by short-lived session tokens and configurable inactivity locks tailored for shared depot tablets. Every synced dispense transaction preserves the authenticated operator ID, device identifier, local capture timestamp, and server ingestion timestamp inside an append-only audit table—preventing silent post-hoc alterations while allowing authorized supervisors to attach documented correction entries.
Idempotency keys prevent double-billing or double-deducting litres when shaky yard Wi-Fi drops mid-POST. If an operator attempts to upload a conflicting meter adjustment or an asset flagged as decommissioned since the morning sync, the record enters an explicit supervisor review queue rather than failing silently or blocking valid subsequent dispenses.
Performance & Scale
Fuel yards demand large touch targets, high-contrast outdoor legibility, and zero interface lag while wearing gloves. The Vue component tree keeps bundle sizes compact through route-level code splitting, caching application shells in Workbox so cold launches take place locally without waiting on network round-trips.
Catalog synchronization uses incremental delta cursors rather than pulling the full enterprise fleet registry on every shift refresh. Even depots managing thousands of plant items and subcontractors sync changes rapidly over edge cellular connections, while PostgreSQL partitioned ledger tables keep multi-year wet-stock variance queries fast for finance audits.
Operational Outcomes
Moving fuel custody from clipboards into a validated Vue and TypeScript field workflow eliminated transcription guesswork at the pump and closed the gap between physical tank levels and fleet allocation reports. Operators complete refuelling handovers rapidly regardless of site connectivity, and depot managers gain timely visibility into meter continuity, bulk deliveries, and asset-level fuel efficiency from a single web ledger.