RideShare — Real-Time Ride-Hailing Platform
Real-time rider-driver matching via Redis geospatial index, WebSockets, and a 5-state ride lifecycle.
Built real-time rider-driver matching through a Redis geospatial index and WebSocket live location and ride-status updates in a full-stack Next.js platform with a server-validated 5-state ride lifecycle.
Operational Challenge
On-demand dispatch platforms require low-latency proximity matching, synchronized live location updates, and strict server-side state transitions so rides cannot be double-booked or skipped out of order.
Intended Audience & Use Case
Mobility startups and logistics teams evaluating real-time geospatial dispatch and live WebSocket state synchronization.
System Design & Data Flow
Next.js full-stack application integrating a Redis geospatial index (GEOADD/GEORADIUS) for nearby driver discovery, WebSocket channels for live coordinate and status broadcasts, Mapbox for geocoding/routing, and Stripe (test mode) for checkout.
Important Technical Decisions
- —Modelled the ride lifecycle as a server-validated 5-state machine (requested → accepted → in progress → completed → paid) to prevent invalid client-side state jumps.
- —Used Redis geospatial indexing instead of polling SQL tables for fast proximity lookups as driver coordinates update.
- —Secured rider/driver actions and role boundaries using JWT authentication.
Features Implemented
- Built real-time rider-driver matching through a Redis geospatial index and WebSocket live location and ride-status updates in a full-stack Next.js platform
- Designed a server-validated 5-state ride lifecycle (requested → accepted → in progress → completed → paid) using Mapbox for geocoding/routing and Stripe test-mode payments
Testing & Engineering Notes
- —Server-side transition guards validating actor role and current ride state before every mutation.
- —Stripe test-mode payment integration isolated from production billing.
- —Real-time WebSocket reconnection and status synchronization handling.