# yeshendradhaker/uber-app architecture

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

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

## Overview

This repository implements a three-service ride-hailing workflow. Drivers submit location updates to the location service, which stores geospatial positions in Redis. Riders request rides through the ride service; it persists the ride, estimates fare, and publishes a request event. The matching service consumes that event, queries nearby drivers over REST, scores candidates, and publishes a match event; the ride service consumes it and updates the ride. Ride lifecycle operations and rider history remain in the ride service. Some cross-service event wiring is documented in the README; unsampled implementation details are not inferred.

Main entry points: [`ride-service/src/main/java/com/rideshare/rideservice/service/RideService.java`](https://github.com/yeshendradhaker/uber-app/blob/main/ride-service/src/main/java/com/rideshare/rideservice/service/RideService.java) (Ride lifecycle), [`matching-service/src/main/java/com/rideshare/matchingservice/service/MatchingService.java`](https://github.com/yeshendradhaker/uber-app/blob/main/matching-service/src/main/java/com/rideshare/matchingservice/service/MatchingService.java) (Driver scoring), [`location-service/src/main/java/com/rideshare/locationservice/controller/LocationController.java`](https://github.com/yeshendradhaker/uber-app/blob/main/location-service/src/main/java/com/rideshare/locationservice/controller/LocationController.java) (Location API), [`ride-service/src/main/java/com/rideshare/rideservice/controller/RideController.java`](https://github.com/yeshendradhaker/uber-app/blob/main/ride-service/src/main/java/com/rideshare/rideservice/controller/RideController.java) (Ride API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ride["Ride lifecycle"]
  node_ride_api["Ride API"]
  node_ride_logic["Ride lifecycle<br/>[RideService.java]"]
  node_ride_model["Ride state<br/>[Ride.java]"]
  node_ride_store[("Ride repository")]
  node_ride_consumer["Match event consumer"]
end

subgraph group_location["Driver location"]
  node_location_api["Location API"]
  node_location_logic["Geospatial lookup"]
  node_redis[("Redis geospatial")]
end

subgraph group_matching["Driver matching"]
  node_matching_consumer["Ride event consumer"]
  node_matching_logic["Driver scoring"]
  node_location_client["Location REST client"]
end

subgraph group_infra["Runtime infrastructure"]
  node_kafka["Kafka topics"]
end

node_rider(("Rider"))
node_driver(("Driver phone"))

node_rider -->|"requests ride"| node_ride_api
node_ride_api -->|"delegates"| node_ride_logic
node_ride_logic -->|"persists ride"| node_ride_store
node_ride_logic -->|"publishes request"| node_kafka
node_ride_logic -->|"updates lifecycle"| node_ride_model
node_kafka -->|"delivers request"| node_matching_consumer
node_matching_consumer -->|"invokes matching"| node_matching_logic
node_matching_logic -->|"queries nearby"| node_location_client
node_location_client -->|"calls REST"| node_location_api
node_driver -->|"updates position"| node_location_api
node_location_api -->|"delegates"| node_location_logic
node_location_logic -->|"reads and writes"| node_redis
node_matching_logic -->|"publishes match"| node_kafka
node_kafka -->|"delivers match"| node_ride_consumer
node_ride_consumer -->|"updates assignment"| node_ride_logic

click node_ride_api "https://github.com/yeshendradhaker/uber-app/blob/main/ride-service/src/main/java/com/rideshare/rideservice/controller/RideController.java"
click node_ride_logic "https://github.com/yeshendradhaker/uber-app/blob/main/ride-service/src/main/java/com/rideshare/rideservice/service/RideService.java"
click node_ride_model "https://github.com/yeshendradhaker/uber-app/blob/main/ride-service/src/main/java/com/rideshare/rideservice/model/Ride.java"
click node_ride_store "https://github.com/yeshendradhaker/uber-app/blob/main/ride-service/src/main/java/com/rideshare/rideservice/repository/RideRepository.java"
click node_ride_consumer "https://github.com/yeshendradhaker/uber-app/blob/main/ride-service/src/main/java/com/rideshare/rideservice/service/RideEventConsumer.java"
click node_location_api "https://github.com/yeshendradhaker/uber-app/blob/main/location-service/src/main/java/com/rideshare/locationservice/controller/LocationController.java"
click node_location_logic "https://github.com/yeshendradhaker/uber-app/blob/main/location-service/src/main/java/com/rideshare/locationservice/service/LocationService.java"
click node_matching_consumer "https://github.com/yeshendradhaker/uber-app/blob/main/matching-service/src/main/java/com/rideshare/matchingservice/service/RideEventConsumer.java"
click node_matching_logic "https://github.com/yeshendradhaker/uber-app/blob/main/matching-service/src/main/java/com/rideshare/matchingservice/service/MatchingService.java"
click node_location_client "https://github.com/yeshendradhaker/uber-app/blob/main/matching-service/src/main/java/com/rideshare/matchingservice/client/LocationServiceClient.java"

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_ride_api,node_ride_logic,node_ride_model,node_ride_store,node_ride_consumer toneBlue
class node_location_api,node_location_logic,node_redis toneAmber
class node_matching_consumer,node_matching_logic,node_location_client toneMint
class node_kafka toneRose
class node_rider,node_driver toneIndigo
```

## Components

### Ride lifecycle

- [Ride API](https://github.com/yeshendradhaker/uber-app/blob/main/ride-service/src/main/java/com/rideshare/rideservice/controller/RideController.java): `ride-service/src/main/java/com/rideshare/rideservice/controller/RideController.java`
- [Ride lifecycle](https://github.com/yeshendradhaker/uber-app/blob/main/ride-service/src/main/java/com/rideshare/rideservice/service/RideService.java): `ride-service/src/main/java/com/rideshare/rideservice/service/RideService.java`
- [Ride state](https://github.com/yeshendradhaker/uber-app/blob/main/ride-service/src/main/java/com/rideshare/rideservice/model/Ride.java): `ride-service/src/main/java/com/rideshare/rideservice/model/Ride.java`
- [Ride repository](https://github.com/yeshendradhaker/uber-app/blob/main/ride-service/src/main/java/com/rideshare/rideservice/repository/RideRepository.java): `ride-service/src/main/java/com/rideshare/rideservice/repository/RideRepository.java`
- [Match event consumer](https://github.com/yeshendradhaker/uber-app/blob/main/ride-service/src/main/java/com/rideshare/rideservice/service/RideEventConsumer.java): `ride-service/src/main/java/com/rideshare/rideservice/service/RideEventConsumer.java`

### Driver location

- [Location API](https://github.com/yeshendradhaker/uber-app/blob/main/location-service/src/main/java/com/rideshare/locationservice/controller/LocationController.java): `location-service/src/main/java/com/rideshare/locationservice/controller/LocationController.java`
- [Geospatial lookup](https://github.com/yeshendradhaker/uber-app/blob/main/location-service/src/main/java/com/rideshare/locationservice/service/LocationService.java): `location-service/src/main/java/com/rideshare/locationservice/service/LocationService.java`
- **Redis geospatial**

### Driver matching

- [Ride event consumer](https://github.com/yeshendradhaker/uber-app/blob/main/matching-service/src/main/java/com/rideshare/matchingservice/service/RideEventConsumer.java): `matching-service/src/main/java/com/rideshare/matchingservice/service/RideEventConsumer.java`
- [Driver scoring](https://github.com/yeshendradhaker/uber-app/blob/main/matching-service/src/main/java/com/rideshare/matchingservice/service/MatchingService.java): `matching-service/src/main/java/com/rideshare/matchingservice/service/MatchingService.java`
- [Location REST client](https://github.com/yeshendradhaker/uber-app/blob/main/matching-service/src/main/java/com/rideshare/matchingservice/client/LocationServiceClient.java): `matching-service/src/main/java/com/rideshare/matchingservice/client/LocationServiceClient.java`

### Runtime infrastructure

- **Kafka topics**

### Other components

- **Rider**
- **Driver phone**

## Connections

- Rider → Ride API: requests ride (evidence: `README.md`)
- Ride API → Ride lifecycle: delegates (evidence: `ride-service/src/main/java/com/rideshare/rideservice/controller/RideController.java`)
- Ride lifecycle → Ride repository: persists ride (evidence: `ride-service/src/main/java/com/rideshare/rideservice/service/RideService.java`)
- Ride lifecycle → Kafka topics: publishes request (evidence: `ride-service/src/main/java/com/rideshare/rideservice/service/RideService.java`)
- Ride lifecycle → Ride state: updates lifecycle (evidence: `ride-service/src/main/java/com/rideshare/rideservice/service/RideService.java`)
- Kafka topics → Ride event consumer: delivers request (evidence: `README.md`)
- Ride event consumer → Driver scoring: invokes matching (evidence: `matching-service/src/main/java/com/rideshare/matchingservice/service/RideEventConsumer.java`)
- Driver scoring → Location REST client: queries nearby (evidence: `matching-service/src/main/java/com/rideshare/matchingservice/service/MatchingService.java`)
- Location REST client → Location API: calls REST (evidence: `matching-service/src/main/java/com/rideshare/matchingservice/client/LocationServiceClient.java`)
- Driver phone → Location API: updates position (evidence: `README.md`)
- Location API → Geospatial lookup: delegates (evidence: `location-service/src/main/java/com/rideshare/locationservice/controller/LocationController.java`)
- Geospatial lookup → Redis geospatial: reads and writes (evidence: `location-service/src/main/java/com/rideshare/locationservice/service/LocationService.java`)
- Driver scoring → Kafka topics: publishes match (evidence: `matching-service/src/main/java/com/rideshare/matchingservice/service/MatchingService.java`)
- Kafka topics → Match event consumer: delivers match (evidence: `README.md`)
- Match event consumer → Ride lifecycle: updates assignment (evidence: `ride-service/src/main/java/com/rideshare/rideservice/service/RideEventConsumer.java`)
