Ride-Hailing Driver App — Mobile API
Driver Availability, Trip Dispatch, Navigation Events & Earnings

Driver-side API for the same ride-hailing platform. Drivers go online, stream their location, receive trip offers with a short response window, move the trip through pickup and drop-off, and track their earnings and ratings for the day and week.
Architecture & System Design
Built with Node.js and Express. Location updates arrive over Socket.IO, are written to Redis and relayed to the rider's trip room during active trips. Trip offers are sent to one driver at a time with a timeout; if a driver declines or doesn't answer, a delayed BullMQ job offers the trip to the next nearest driver.
- Sequential trip offers with timeouts handled by delayed BullMQ jobs
- Location updates throttled and batched to save battery and bandwidth
- Earnings recorded as ledger entries per trip for accurate daily and weekly summaries
- Driver ratings and acceptance rate computed from trip history
Engineering Challenges
Offer Timeouts
A trip offer needs to move to the next driver if the first one doesn't respond within seconds, without blocking any request.
Dispatched each offer with a delayed job that re-checks the offer state when the window expires and escalates to the next candidate if it's still pending.
Riders are not left waiting on unresponsive drivers, and the API stays non-blocking.
Accurate Earnings
Earnings had to reflect fares, platform commission, cancellations and adjustments in a way drivers could trust.
Recorded every money movement as an immutable ledger entry tied to a trip, and derived summaries from the ledger.
Drivers see a clear breakdown, and totals can always be traced back to individual trips.
Core Features
Online / Offline
Drivers control availability; only online drivers receive offers.
Clean Code
1// BullMQ worker: offer a trip to the "color:#ffcb6b">next driver, re-check after 15s2"color:#c792ea">const worker = "color:#c792ea">new Worker("trip-offers", "color:#c792ea">async (job) => {3 "color:#c792ea">const trip = "color:#c792ea">await trips.findById(job.data.tripId);4 "color:#c792ea">if (trip.status !== "requested") "color:#c792ea">return; // accepted or cancelled56 "color:#c792ea">const driver = "color:#c792ea">await locator.nextCandidate(trip);7 "color:#c792ea">if (!driver) {8 "color:#c792ea">await trips.update(trip.id, { status: "no_drivers" });9 "color:#c792ea">return;10 }1112 "color:#c792ea">await offers.create({ tripId: trip.id, driverId: driver.id });13 io.to(`driver:${driver.id}`).emit("trip:offer", serializeTrip(trip));1415 "color:#c792ea">await offerQueue.add("offer", { tripId: trip.id }, { delay: 15_000 });16}, { connection: redis });Want something like this for your business?
I design and build full stack products end to end. Tell me about your idea and I'll get back to you with a plan.