
Case Study
A full-stack ride-hailing platform with real-time driver matching, live GPS tracking, Stripe payments, and an admin dashboard — built end to end across mobile, backend, and web.
Ride-hailing platforms need to solve three hard problems simultaneously: matching riders to the nearest available driver in real time, tracking GPS location continuously in the background without draining battery, and handling payments that split correctly between rider, platform, and driver. On top of that, the system needs an admin layer for operations — monitoring trips, managing drivers, and auditing financial flows. Building this end to end across mobile, backend, and web requires coordinating real-time sockets, state machines, payment webhooks, and multi-role interfaces into one cohesive product.
Drivo is a complete ride-hailing platform I built from the ground up, covering the full rider and driver experience alongside a real-time admin dashboard. Riders pick a destination, see nearby drivers on a live map, request a ride, and get matched through a nearest-driver dispatch system with automatic escalation. Drivers sign up, get approved, go online, and stream their GPS location in the background. The backend handles real-time matching, throttled location broadcasts, ride state management, and Stripe payment processing. An admin panel provides live KPIs, alerts, a ride queue, and full CRUD for trips, drivers, users, payments, and audit logs. The entire system supports English and Arabic with RTL layouts. The backend is containerized with Docker and deployed on Railway, and the admin dashboard is hosted on Vercel.
Organized as a monorepo with three clients sharing one Express API. The mobile app uses Expo Router with feature-first modules for auth, rides, drivers, history, and profile. The backend runs Express + Prisma + Socket.io with a ride state machine, throttled driver broadcasts, and Stripe webhooks. The admin panel is a React 19 Vite SPA that receives live map data and KPI updates through Socket.io. The backend is containerized with Docker (multi-stage build) and deployed on Railway, while the admin dashboard is deployed on Vercel.
When a rider requests a ride, the backend queries nearby online drivers sorted by distance, then sends offers one at a time with a 20-second timeout. If the first driver rejects or times out, the system atomically expires that offer and escalates to the next nearest candidate — all within a single transaction to prevent double-booking.
Drivers broadcast their GPS location every 5 seconds via Socket.io while the app is in the background. A heartbeat monitor tracks each driver's last-seen timestamp; if a driver goes stale (no update in 30s), the system marks them offline and removes them from the nearby pool. A connectivity-aware fallback queues location updates when the network is poor and flushes them when connectivity returns.
Every ride follows a strict state machine: PENDING → ACCEPTED → ARRIVED → IN_PROGRESS → TRIP_ENDED → COMPLETED, with CANCELLED and EXPIRED as terminal states. Transitions are enforced server-side with database constraints, preventing invalid state changes. Cancellation during different stages triggers different payment logic — pre-trip cancels have no charge, mid-trip cancels prorate the fare.
Payments use Stripe PaymentSheet on the rider side and Stripe Connect for driver payouts. The backend listens for webhook events (payment_intent.succeeded, charge.succeeded, transfer.paid) to update payment records asynchronously. A retry mechanism handles failed transfers with exponential backoff, and the admin dashboard surfaces transfer failures in real time.