HomeCase studiesThree-Role Collection & Delivery Dispatch Management Platform

Case study · Tampere, Finland

Three-Role Collection & Delivery Dispatch Management Platform

Logistics and transportation services — on-demand collection and delivery dispatch

On-demand collection and delivery networks stall when phone-call dispatching, opaque courier availability, and missing handoff proof leave customers guessing and ops teams firefighting. We built a three-role dispatch platform unifying customer booking, an iOS-capable React Native driver app, and a React dispatch board on top of Laravel, PHP, MySQL, Laravel Passport, Firebase, and Google Cloud. Role-scoped OAuth2 tokens, transactional job claiming, and live GPS telemetry synchronize pickups from request through verified proof of delivery.

Industry
Logistics and transportation services — on-demand collection and delivery dispatch
Solution
A three-role logistics platform comprising React Native mobile apps (including iOS), a React dispatch web console, and a Laravel Passport API hosted on Google Cloud with MySQL and Firebase.
Platforms
iOS · Cross-platform · Web & API
Stack
Laravel · PHP · React Native · React · MySQL · Firebase
Location
Tampere, Finland · delivered remotely
Role
Engineering, with the team behind for mobile and QA

Delivered remotely for a business based in Tampere, Finland. Names withheld by agreement.

Project Overview

On-demand collection and delivery operations live or die on coordination across three distinct participants: customers expecting predictable pickup windows, mobile drivers navigating dense urban stops, and central dispatchers resolving delays before SLA commitments slip. When those groups rely on disconnected spreadsheets, messaging threads, and manual phone updates, dispatchers lose visibility into fleet capacity while customers receive vague arrival estimates.

We engineered a unified three-role dispatch management platform connecting a React web operations board with React Native mobile experiences across iOS and cross-platform devices. Powered by a Laravel and PHP API secured through Laravel Passport, the backend coordinates transactional order lifecycles in MySQL, live courier telemetry in Firebase, and mapping and media infrastructure on Google Cloud.

Business Bottleneck

Growing courier and collection fleets hit predictable operational ceilings when dispatching remains manual:

  • Invisible courier capacity: Dispatchers cannot tell who is finishing a drop nearby versus stuck in traffic, forcing conservative buffer times and underutilized routes.
  • Race conditions on open pickup offers: Broadcasting urgent collection requests via chat groups creates double bookings, wasted deadhead miles, and awkward driver standoffs.
  • Unverified handoffs and lost paperwork: Paper collection slips get damaged or delayed, slowing invoicing and leaving disputes over package condition unresolved.
  • Cross-role security risks: Exposing a single flat API without granular role boundaries risks leaking customer addresses, driver earnings, or dispatcher overrides across user tiers.

Architectural Strategy

We structured the platform around role-isolated OAuth2 boundaries and split hot/cold data paths. Laravel Passport issues narrowly scoped tokens tailored to each persona—customer booking, driver execution, and dispatcher orchestration—ensuring the React web console and React Native apps share a single authoritative backend without overlapping privileges.

To keep operational costs and database contention low, we separated durable business state from ephemeral movement data. Order states, chain-of-custody milestones, and billing records live transactionally in Cloud SQL MySQL, whereas continuous driver GPS coordinates and instant dispatch offers stream through Firebase, paired with Google Cloud Storage for heavy proof-of-collection media.

Core Capabilities

  • Customer Booking & Live Tracking: Validated address entry via Google Maps geocoding, dynamic collection window selection, live courier approach tracking, and instant digital receipts.
  • Courier Mobile Workflow (React Native / iOS): Shift availability toggles, turn-by-turn stop manifests, barcode/QR verification, offline-tolerant signature capture, and multi-photo proof of collection.
  • React Dispatch Command Board: Real-time fleet map filtering couriers by vehicle type and status, drag-and-drop leg reassignment, SLA breach warnings, and automated nearest-driver matching.
  • Immutable Chain of Custody: Every status shift—Requested, Assigned, En Route, Collected, In Transit, Delivered, or Exception—records actor identity, coordinates, and timestamps.
  • Direct-to-Cloud Media Uploads: Couriers upload inspection photos straight to Google Cloud Storage via signed URLs, keeping Laravel API workers free of binary payload overhead.

Technical Architecture

React dispatch boards and React Native mobile clients authenticate through Laravel Passport endpoints before subscribing to real-time updates. Customers and dispatchers interact primarily with Laravel REST routes backed by MySQL, while active courier apps stream lightweight location heartbeats into Firebase Realtime Database that both the React map and customer tracking view observe directly.

Flow: Customer & Driver Apps (React Native / iOS) + React Dispatch Board → Laravel API (Passport OAuth2) → Google Cloud SQL (MySQL) + Firebase (Live GPS & FCM) + Google Cloud (Maps & Storage)

When a collection request enters the matching queue, Laravel queries recent courier zones, invokes Google Maps Distance Matrix to score realistic travel times across candidate drivers, and dispatches priority job offers via Firebase Cloud Messaging. Accepting a job executes an atomic MySQL state transition, locks the leg to the winning driver, and updates the React dispatch board immediately.

Technology Stack

Category Technology detail
Core Backend API Laravel (PHP) with strict order state-machine transitions
OAuth2 Role Security Laravel Passport issuing scoped tokens for customer, driver, and dispatcher roles
Courier & Customer Mobile React Native (iOS and cross-platform builds with native geolocation)
Dispatch Operations Board React SPA with live fleet map, route queues, and exception triage
Relational Data Store MySQL (Cloud SQL) for orders, manifests, custody logs, and billing records
Live Telemetry & Alerts Firebase Realtime Database for courier pings and FCM for job offers
Cloud Hosting & Storage Google Cloud Run / Compute Engine and Cloud Storage for POD media
Routing & Geocoding Google Maps Platform (Distance Matrix, Geocoding, and ETA APIs)
Async Job Processing Laravel Queue workers on Google Cloud handling notifications and invoicing

Engineering Trade-offs & Solutions

Engineering Challenge Solution & Trade-off
Continuous courier GPS pings saturating relational database writes Routed high-frequency location updates to Firebase Realtime Database while writing only milestone snapshots to MySQL; accepted two-store synchronization for flat SQL latency.
Large proof-of-delivery photos blocking PHP-FPM workers Issued short-lived Google Cloud Storage signed URLs from Laravel so React Native clients upload images directly to object storage before finalizing the stop.
Multiple drivers tapping the same high-priority job notification Wrapped assignment acceptance in a pessimistic MySQL transaction checking status = dispatched, rejecting runner-up claims cleanly at the database boundary.
Rising Google Maps API expenses from frequent ETA recalculations Cached normalized geocode coordinates per address and triggered Distance Matrix refreshes strictly at dispatch scoring and route-deviation thresholds.

Security & Reliability

Logistics platforms handle sensitive pickup locations, recipient identities, and high-value cargo custody. Laravel Passport enforces distinct OAuth2 scopes per role alongside token revocation when a courier device is lost or shifted off duty. Customer tracking links expose only the assigned courier's approximate live marker once an order is actively en route, hiding unrelated fleet activity.

Google Cloud Storage buckets remain private by default; dispatchers and customers view proof-of-collection photos only through time-limited signed URLs generated after Laravel policy verification. On the courier app, offline custody records queue locally with cryptographic checksums so connectivity drops in loading bays never lose signed handoff evidence.

Performance & Scale

The React dispatch board uses virtualized manifest tables and clustered map markers so coordinators monitoring busy regional hubs can filter hundreds of active legs without browser frame drops. Memoized state selectors update individual marker positions from Firebase listeners without re-rendering surrounding job drawers.

On Google Cloud, stateless Laravel containers scale automatically during morning pickup surges, backed by queued workers handling webhook dispatches, automated customer SMS/email alerts, and billing exports asynchronously. MySQL composite indexes on (tenant_id, status, scheduled_window) keep dispatcher queue filters responsive as historical order volume grows.

Operational Outcomes

Bringing customers, drivers, and dispatchers onto one Passport-secured platform replaced fragmented phone coordination with transparent operational execution:

  • Faster exception recovery: Dispatchers spot stalled pickups early on the React map and reassign legs in seconds with full custody continuity.
  • Frictionless field handoffs: Couriers follow clear React Native manifests across iOS and cross-platform devices and capture verifiable photos and signatures even in weak-signal loading zones.
  • Reduced customer support inquiries: Live tracking views and automated milestone alerts answer arrival questions before customers call the desk.
  • Protected backend throughput: Offloading GPS streams to Firebase and media uploads to Google Cloud Storage keeps core Laravel order APIs predictable during peak collection windows.

01 — Questions

asked about this kind of project

How does Laravel Passport enforce strict separation between customers, drivers, and dispatchers?

Every Passport access token carries explicit role scopes—such as customer:book, driver:execute, and dispatcher:override—verified by Laravel route middleware and model policies. Even if a mobile binary inspects an endpoint path, driver tokens cannot query unassigned fleet rosters or alter global pricing rules.

How do you prevent two couriers from claiming the same urgent pickup simultaneously?

Accepting an open collection request triggers a MySQL transaction with row-level locking on the order status column. Only the first courier whose transaction transitions the order from Dispatched to Accepted succeeds; concurrent requests immediately receive a clean conflict response and remove the offer.

Why pair MySQL with Firebase instead of writing every courier GPS ping to Cloud SQL?

Writing frequent latitude/longitude updates from an active fleet directly into MySQL creates heavy row churn and lock contention. Streaming high-frequency telemetry into Firebase Realtime Database keeps the live React dispatch map smooth while MySQL stores only milestone timestamps, route polylines, and custody events.

How does the React Native driver app capture reliable proof of collection in basement garages or rural stops?

Signatures, timestamps, barcode scans, and compressed photos save first to local encrypted storage on the iOS or cross-platform device. When signal returns, the app uploads media directly to Google Cloud Storage via short-lived signed URLs and commits the milestone to Laravel.

How does Google Cloud integration support dynamic ETAs without excessive API billing?

Dispatchers rely on Google Maps Geocoding at booking creation to validate addresses once, and Distance Matrix calls run selectively during dispatch matching or when a courier deviates materially from a planned leg, rather than recalculating every active order on each GPS tick.

Can dispatchers override automated assignments when a vehicle breaks down mid-route?

Yes. From the React operations board, dispatchers can pause a courier shift, split remaining stops off a manifest, and reassign legs to nearby available drivers. Every handoff writes an immutable custody entry in MySQL and pushes updated route stops via Firebase.

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.