# vanh251/ride-hailing-microservices architecture

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

- Interactive diagram: https://gitdiagram.com/vanh251/ride-hailing-microservices
- Repository: https://github.com/vanh251/ride-hailing-microservices

## Overview

This repository appears to implement a ride-hailing platform as cooperating services: users authenticate, request rides, get matched with drivers, and complete trips with pricing, payment, and notifications. The tree identifies those service boundaries, but the supplied README describes GitHub workflows rather than runtime behavior, and runtime sources were not sampled. Only the pricing/payment load-test calls and its documented payment-event notification path are shown directly; other runtime relationships are therefore dashed and unverified.

Main entry points: [`src/trip-service`](https://github.com/vanh251/ride-hailing-microservices/tree/develop/src/trip-service) (Trip service), [`src/payment-service`](https://github.com/vanh251/ride-hailing-microservices/tree/develop/src/payment-service) (Payment service), [`src/api-gateway/src/main/java/com/example/apigateway`](https://github.com/vanh251/ride-hailing-microservices/tree/develop/src/api-gateway/src/main/java/com/example/apigateway) (API gateway), [`src/identity-service/src/main/java/com/example/identityservice`](https://github.com/vanh251/ride-hailing-microservices/tree/develop/src/identity-service/src/main/java/com/example/identityservice) (Identity service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Access and identity"]
  node_gateway["API gateway"]
  node_identity["Identity service"]
  node_identity_db[("Identity database")]
end

subgraph group_ride["Ride operations"]
  node_trip["Trip service"]
  node_matching["Matching service"]
  node_driver["Driver service"]
end

subgraph group_commerce["Fare and payment"]
  node_pricing["Pricing service"]
  node_payment["Payment service"]
  node_payment_db[("Payment database")]
end

subgraph group_messaging["Events and notifications"]
  node_kafka["Kafka"]
  node_notification["Notification service"]
end

node_rider(("Rider or driver"))

node_rider -.->|"sends requests"| node_gateway
node_gateway -.->|"routes auth"| node_identity
node_gateway -.->|"routes ride requests"| node_trip
node_identity -.->|"stores identities"| node_identity_db
node_trip -.->|"requests fare"| node_pricing
node_trip -.->|"requests matching"| node_matching
node_matching -.->|"reserves driver"| node_driver
node_trip -.->|"requests charge"| node_payment
node_payment -.->|"stores payments"| node_payment_db
node_rider -->|"requests quote"| node_pricing
node_rider -->|"charges trip"| node_payment
node_payment -.->|"publishes event"| node_kafka
node_kafka -.->|"delivers event"| node_notification

click node_gateway "https://github.com/vanh251/ride-hailing-microservices/tree/develop/src/api-gateway/src/main/java/com/example/apigateway"
click node_identity "https://github.com/vanh251/ride-hailing-microservices/tree/develop/src/identity-service/src/main/java/com/example/identityservice"
click node_trip "https://github.com/vanh251/ride-hailing-microservices/tree/develop/src/trip-service"
click node_matching "https://github.com/vanh251/ride-hailing-microservices/tree/develop/src/matching-service"
click node_driver "https://github.com/vanh251/ride-hailing-microservices/tree/develop/src/driver-service/src/main/java/com/example/driverservice"
click node_pricing "https://github.com/vanh251/ride-hailing-microservices/tree/develop/src/pricing-service"
click node_payment "https://github.com/vanh251/ride-hailing-microservices/tree/develop/src/payment-service"
click node_notification "https://github.com/vanh251/ride-hailing-microservices/tree/develop/src/notification-service"

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_gateway,node_identity,node_identity_db toneBlue
class node_trip,node_matching,node_driver toneAmber
class node_pricing,node_payment,node_payment_db toneMint
class node_kafka,node_notification toneRose
class node_rider toneIndigo
```

## Components

### Access and identity

- [API gateway](https://github.com/vanh251/ride-hailing-microservices/tree/develop/src/api-gateway/src/main/java/com/example/apigateway): `src/api-gateway/src/main/java/com/example/apigateway`
- [Identity service](https://github.com/vanh251/ride-hailing-microservices/tree/develop/src/identity-service/src/main/java/com/example/identityservice): `src/identity-service/src/main/java/com/example/identityservice`
- **Identity database**

### Ride operations

- [Trip service](https://github.com/vanh251/ride-hailing-microservices/tree/develop/src/trip-service): `src/trip-service`
- [Matching service](https://github.com/vanh251/ride-hailing-microservices/tree/develop/src/matching-service): `src/matching-service`
- [Driver service](https://github.com/vanh251/ride-hailing-microservices/tree/develop/src/driver-service/src/main/java/com/example/driverservice): `src/driver-service/src/main/java/com/example/driverservice`

### Fare and payment

- [Pricing service](https://github.com/vanh251/ride-hailing-microservices/tree/develop/src/pricing-service): `src/pricing-service`
- [Payment service](https://github.com/vanh251/ride-hailing-microservices/tree/develop/src/payment-service): `src/payment-service`
- **Payment database**

### Events and notifications

- **Kafka**
- [Notification service](https://github.com/vanh251/ride-hailing-microservices/tree/develop/src/notification-service): `src/notification-service`

### Other components

- **Rider or driver**

## Connections

- Rider or driver → API gateway: sends requests
- API gateway → Identity service: routes auth
- API gateway → Trip service: routes ride requests
- Identity service → Identity database: stores identities
- Trip service → Pricing service: requests fare
- Trip service → Matching service: requests matching
- Matching service → Driver service: reserves driver
- Trip service → Payment service: requests charge
- Payment service → Payment database: stores payments
- Rider or driver → Pricing service: requests quote
- Rider or driver → Payment service: charges trip
- Payment service → Kafka: publishes event
- Kafka → Notification service: delivers event
