# saikrishnamulukutla/uber architecture

> Architecture diagram of the GitHub repository saikrishnamulukutla/uber, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/saikrishnamulukutla/uber
- Repository: https://github.com/saikrishnamulukutla/uber

## Overview

RideGo is a Go ride-hailing backend: riders and drivers use HTTP APIs to register, request and complete trips, and pay; matching and service updates are coordinated through Kafka. The main workflow runs from trip request through driver offer/assignment, OTP-verified trip completion, and payment. The graph also preserves authentication, notifications, GPS tracking, and earnings. The README documents the broad event flow; source excerpts confirm selected wiring and calls, so unsampled service internals are represented at their known module paths without inferred call edges.

Main entry points: [`shared/pkg/kafka/client.go`](https://github.com/saikrishnamulukutla/uber/blob/master/shared/pkg/kafka/client.go) (Kafka events), [`services/trip-service/internal/service/service.go`](https://github.com/saikrishnamulukutla/uber/blob/master/services/trip-service/internal/service/service.go) (Trip lifecycle), [`services/payment-service/internal/service/service.go`](https://github.com/saikrishnamulukutla/uber/blob/master/services/payment-service/internal/service/service.go) (Payment processing), [`services/driver-service/internal/service/service.go`](https://github.com/saikrishnamulukutla/uber/blob/master/services/driver-service/internal/service/service.go) (Driver operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and profiles"]
  node_user_api["User API<br/>[handler.go]"]
  node_user_logic["User accounts<br/>[service.go]"]
end

subgraph group_trip["Trip lifecycle"]
  node_trip_api["Trip API<br/>[handler.go]"]
  node_trip_logic["Trip lifecycle<br/>[service.go]"]
  node_tracking["Live tracking<br/>[hub.go]"]
end

subgraph group_dispatch["Driver dispatch"]
  node_driver_api["Driver API<br/>[handler.go]"]
  node_driver_logic["Driver operations<br/>[service.go]"]
  node_matching["Driver matching<br/>[matcher.go]"]
end

subgraph group_payment["Payments"]
  node_payment_api["Payment API<br/>[handler.go]"]
  node_checkout["Checkout page<br/>[checkout.go]"]
  node_payment_logic["Payment processing<br/>[service.go]"]
  node_payment_provider["Payment providers<br/>[provider.go]"]
  node_razorpay["Razorpay integration<br/>[razorpay.go]"]
  node_payment_hub["Checkout updates<br/>[hub.go]"]
end

subgraph group_platform["Events and notifications"]
  node_notifications["Notifications<br/>[main.go]"]
  node_notification_api["Notification API<br/>[handler.go]"]
  node_postgres[("PostgreSQL<br/>[postgres.go]")]
  node_redis[("Redis state<br/>[client.go]")]
  node_kafka["Kafka events<br/>[client.go]"]
  node_mailer["Email delivery<br/>[mailer.go]"]
end

node_client(("Rider and driver"))
node_gateway["API gateway"]
node_email_service["Email provider"]

node_client -->|"calls HTTP/WS"| node_gateway
node_gateway -->|"routes requests"| node_user_api
node_gateway -->|"routes requests"| node_driver_api
node_gateway -->|"routes requests"| node_trip_api
node_gateway -->|"routes requests"| node_payment_api
node_gateway -->|"routes requests"| node_notification_api
node_user_api -->|"delegates"| node_user_logic
node_driver_api -->|"delegates"| node_driver_logic
node_trip_api -->|"delegates"| node_trip_logic
node_payment_api -->|"delegates"| node_payment_logic
node_payment_api -.->|"serves checkout"| node_checkout
node_trip_logic -->|"publishes request"| node_kafka
node_kafka -->|"delivers request"| node_matching
node_matching -->|"searches drivers"| node_redis
node_matching -->|"publishes offer"| node_kafka
node_kafka -->|"delivers offer"| node_notifications
node_driver_api -->|"responds to offer"| node_driver_logic
node_driver_logic -->|"publishes assignment"| node_kafka
node_kafka -->|"delivers assignment"| node_trip_logic
node_trip_api -->|"upgrades WebSocket"| node_tracking
node_trip_logic -->|"stores ride OTP"| node_redis
node_trip_logic -->|"publishes completion"| node_kafka
node_kafka -->|"delivers completion"| node_payment_logic
node_payment_logic -->|"persists payment"| node_postgres
node_payment_logic -->|"requests payment"| node_payment_provider
node_payment_provider -.->|"selects integration"| node_razorpay
node_payment_logic -.->|"pushes updates"| node_payment_hub
node_payment_logic -->|"publishes completion"| node_kafka
node_kafka -->|"delivers lifecycle events"| node_notifications
node_notifications -->|"stores notices"| node_postgres
node_notifications -->|"sends email"| node_mailer
node_mailer -.->|"delivers email"| node_email_service
node_user_logic -.->|"persists accounts"| node_postgres
node_driver_logic -.->|"persists drivers"| node_postgres
node_driver_logic -->|"tracks availability"| node_redis
node_trip_logic -.->|"persists trips"| node_postgres

click node_user_api "https://github.com/saikrishnamulukutla/uber/blob/master/services/user-service/internal/controllers/handler.go"
click node_user_logic "https://github.com/saikrishnamulukutla/uber/blob/master/services/user-service/internal/service/service.go"
click node_driver_api "https://github.com/saikrishnamulukutla/uber/blob/master/services/driver-service/internal/controllers/handler.go"
click node_driver_logic "https://github.com/saikrishnamulukutla/uber/blob/master/services/driver-service/internal/service/service.go"
click node_matching "https://github.com/saikrishnamulukutla/uber/blob/master/services/matching-service/internal/service/matcher.go"
click node_trip_api "https://github.com/saikrishnamulukutla/uber/blob/master/services/trip-service/internal/controllers/handler.go"
click node_trip_logic "https://github.com/saikrishnamulukutla/uber/blob/master/services/trip-service/internal/service/service.go"
click node_tracking "https://github.com/saikrishnamulukutla/uber/blob/master/services/trip-service/internal/tracking/hub.go"
click node_payment_api "https://github.com/saikrishnamulukutla/uber/blob/master/services/payment-service/internal/controllers/handler.go"
click node_checkout "https://github.com/saikrishnamulukutla/uber/blob/master/services/payment-service/internal/controllers/checkout.go"
click node_payment_logic "https://github.com/saikrishnamulukutla/uber/blob/master/services/payment-service/internal/service/service.go"
click node_payment_provider "https://github.com/saikrishnamulukutla/uber/blob/master/services/payment-service/internal/provider/provider.go"
click node_razorpay "https://github.com/saikrishnamulukutla/uber/blob/master/services/payment-service/internal/provider/razorpay/razorpay.go"
click node_payment_hub "https://github.com/saikrishnamulukutla/uber/blob/master/services/payment-service/internal/hub/hub.go"
click node_notifications "https://github.com/saikrishnamulukutla/uber/blob/master/services/notification-service/cmd/main.go"
click node_notification_api "https://github.com/saikrishnamulukutla/uber/blob/master/services/notification-service/internal/controllers/handler.go"
click node_postgres "https://github.com/saikrishnamulukutla/uber/blob/master/shared/pkg/db/postgres.go"
click node_redis "https://github.com/saikrishnamulukutla/uber/blob/master/shared/pkg/redis/client.go"
click node_kafka "https://github.com/saikrishnamulukutla/uber/blob/master/shared/pkg/kafka/client.go"
click node_mailer "https://github.com/saikrishnamulukutla/uber/blob/master/shared/pkg/mailer/mailer.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_user_api,node_user_logic toneBlue
class node_trip_api,node_trip_logic,node_tracking toneAmber
class node_driver_api,node_driver_logic,node_matching,node_gateway toneMint
class node_payment_api,node_checkout,node_payment_logic,node_payment_provider,node_razorpay,node_payment_hub toneRose
class node_notifications,node_notification_api,node_postgres,node_redis,node_kafka,node_mailer,node_client,node_email_service toneIndigo
```

## Components

### Identity and profiles

- [User API](https://github.com/saikrishnamulukutla/uber/blob/master/services/user-service/internal/controllers/handler.go): `services/user-service/internal/controllers/handler.go`
- [User accounts](https://github.com/saikrishnamulukutla/uber/blob/master/services/user-service/internal/service/service.go): `services/user-service/internal/service/service.go`

### Trip lifecycle

- [Trip API](https://github.com/saikrishnamulukutla/uber/blob/master/services/trip-service/internal/controllers/handler.go): `services/trip-service/internal/controllers/handler.go`
- [Trip lifecycle](https://github.com/saikrishnamulukutla/uber/blob/master/services/trip-service/internal/service/service.go): `services/trip-service/internal/service/service.go`
- [Live tracking](https://github.com/saikrishnamulukutla/uber/blob/master/services/trip-service/internal/tracking/hub.go): `services/trip-service/internal/tracking/hub.go`

### Driver dispatch

- [Driver API](https://github.com/saikrishnamulukutla/uber/blob/master/services/driver-service/internal/controllers/handler.go): `services/driver-service/internal/controllers/handler.go`
- [Driver operations](https://github.com/saikrishnamulukutla/uber/blob/master/services/driver-service/internal/service/service.go): `services/driver-service/internal/service/service.go`
- [Driver matching](https://github.com/saikrishnamulukutla/uber/blob/master/services/matching-service/internal/service/matcher.go): `services/matching-service/internal/service/matcher.go`

### Payments

- [Payment API](https://github.com/saikrishnamulukutla/uber/blob/master/services/payment-service/internal/controllers/handler.go): `services/payment-service/internal/controllers/handler.go`
- [Checkout page](https://github.com/saikrishnamulukutla/uber/blob/master/services/payment-service/internal/controllers/checkout.go): `services/payment-service/internal/controllers/checkout.go`
- [Payment processing](https://github.com/saikrishnamulukutla/uber/blob/master/services/payment-service/internal/service/service.go): `services/payment-service/internal/service/service.go`
- [Payment providers](https://github.com/saikrishnamulukutla/uber/blob/master/services/payment-service/internal/provider/provider.go): `services/payment-service/internal/provider/provider.go`
- [Razorpay integration](https://github.com/saikrishnamulukutla/uber/blob/master/services/payment-service/internal/provider/razorpay/razorpay.go): `services/payment-service/internal/provider/razorpay/razorpay.go`
- [Checkout updates](https://github.com/saikrishnamulukutla/uber/blob/master/services/payment-service/internal/hub/hub.go): `services/payment-service/internal/hub/hub.go`

### Events and notifications

- [Notifications](https://github.com/saikrishnamulukutla/uber/blob/master/services/notification-service/cmd/main.go): `services/notification-service/cmd/main.go`
- [Notification API](https://github.com/saikrishnamulukutla/uber/blob/master/services/notification-service/internal/controllers/handler.go): `services/notification-service/internal/controllers/handler.go`
- [PostgreSQL](https://github.com/saikrishnamulukutla/uber/blob/master/shared/pkg/db/postgres.go): `shared/pkg/db/postgres.go`
- [Redis state](https://github.com/saikrishnamulukutla/uber/blob/master/shared/pkg/redis/client.go): `shared/pkg/redis/client.go`
- [Kafka events](https://github.com/saikrishnamulukutla/uber/blob/master/shared/pkg/kafka/client.go): `shared/pkg/kafka/client.go`
- [Email delivery](https://github.com/saikrishnamulukutla/uber/blob/master/shared/pkg/mailer/mailer.go): `shared/pkg/mailer/mailer.go`

### Other components

- **Rider and driver**
- **API gateway**
- **Email provider**

## Connections

- Rider and driver → API gateway: calls HTTP/WS
- API gateway → User API: routes requests
- API gateway → Driver API: routes requests
- API gateway → Trip API: routes requests
- API gateway → Payment API: routes requests
- API gateway → Notification API: routes requests
- User API → User accounts: delegates (evidence: `services/user-service/internal/controllers/handler.go`)
- Driver API → Driver operations: delegates (evidence: `services/driver-service/internal/controllers/handler.go`)
- Trip API → Trip lifecycle: delegates (evidence: `services/trip-service/internal/controllers/handler.go`)
- Payment API → Payment processing: delegates
- Payment API → Checkout page: serves checkout
- Trip lifecycle → Kafka events: publishes request
- Kafka events → Driver matching: delivers request
- Driver matching → Redis state: searches drivers (evidence: `services/matching-service/internal/service/matcher.go`)
- Driver matching → Kafka events: publishes offer
- Kafka events → Notifications: delivers offer
- Driver API → Driver operations: responds to offer (evidence: `services/driver-service/internal/controllers/handler.go`)
- Driver operations → Kafka events: publishes assignment
- Kafka events → Trip lifecycle: delivers assignment
- Trip API → Live tracking: upgrades WebSocket
- Trip lifecycle → Redis state: stores ride OTP
- Trip lifecycle → Kafka events: publishes completion
- Kafka events → Payment processing: delivers completion
- Payment processing → PostgreSQL: persists payment (evidence: `services/payment-service/internal/service/service.go`)
- Payment processing → Payment providers: requests payment (evidence: `services/payment-service/internal/service/service.go`)
- Payment providers → Razorpay integration: selects integration
- Payment processing → Checkout updates: pushes updates
- Payment processing → Kafka events: publishes completion (evidence: `services/payment-service/internal/service/service.go`)
- Kafka events → Notifications: delivers lifecycle events
- Notifications → PostgreSQL: stores notices (evidence: `services/notification-service/cmd/main.go`)
- Notifications → Email delivery: sends email (evidence: `services/notification-service/cmd/main.go`)
- Email delivery → Email provider: delivers email
- User accounts → PostgreSQL: persists accounts
- Driver operations → PostgreSQL: persists drivers
- Driver operations → Redis state: tracks availability
- Trip lifecycle → PostgreSQL: persists trips
