Ride Sharing

October 10, 2026 (2w ago)

Stack: Go, gRPC, RabbitMQ, MongoDB, Stripe, OpenTelemetry, Jaeger, Next.js, Kubernetes, Tilt · Repo: Axeloooo/Ride-Sharing

Problem

A rider previews a route and fares, requests a trip, a driver has to be found and accept in real time, and a payment session has to follow. This project builds that flow as four Go services plus a web client, using synchronous calls where a caller needs an answer and events where services only need to react.

Architecture diagram

  Next.js web --HTTP preview/start--> API gateway <--WebSocket-- web
                                      |      |   (/ws/riders, /ws/drivers)
                       gRPC           |      | gRPC
              +-----------------------+      +------------------+
              v                                                 v
        Trip service ---HTTP---> OSRM routing API         Driver service
        MongoDB (trips)                                   in-memory drivers
              |                                                 ^
              | trip.event.created                              |
              v                                                 |
  ================ RabbitMQ topic exchange "trip" ================
   | find drivers -------------------------------------------->  |
   | <-- driver.cmd.trip_request / no_drivers_found ------------+
   | notify queues --> gateway --> rider / driver WebSocket
   | driver accept / decline (via gateway) --> trip service
   | driver_assigned + create payment session --> Payment service
   |                                                    |
   |                                         Stripe Checkout Session
   | <-- payment.event.session_created ----------------+
   +-- failed after retries --> dlx --> dead_letter_queue
 
  OpenTelemetry spans from gateway, trip, driver, payment --> Jaeger

The gateway exposes /trip/preview, /trip/start and two WebSocket endpoints. The trip service (domain / service / infrastructure layout) gets routes from an external OSRM HTTP API, computes fares for sedan, SUV, van and luxury, and stores trips in MongoDB. The driver service keeps an in-memory registry, assigns each new driver a location and geohash, and matches by package type. The payment service turns a driver-assigned event into a Stripe Checkout session that the gateway pushes to the rider.

Key decisions

Challenges

Results

Links