# shekh-dalim/smartride architecture

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

- Interactive diagram: https://gitdiagram.com/shekh-dalim/smartride
- Repository: https://github.com/shekh-dalim/smartride

## Overview

This repository contains three Spring Boot services, but the sampled implementation exposes meaningful behavior only for location management and ride-domain data. The principal evidenced workflow is driver GPS updates into Redis GEO, followed by nearby-driver lookup for matching; drivers can also be removed when offline. Ride requests and lifecycle states are represented, but no ride or matching handlers were shown. Edges reflect sampled calls or explicit controller comments; unsampled service interactions are omitted.

Main entry points: [`location-service/src/main/java/com/rideshare/locationservice/controller/LocationController.java`](https://github.com/shekh-dalim/smartride/blob/main/location-service/src/main/java/com/rideshare/locationservice/controller/LocationController.java) (Location API), [`location-service/src/main/java/com/rideshare/locationservice/service/LocationService.java`](https://github.com/shekh-dalim/smartride/blob/main/location-service/src/main/java/com/rideshare/locationservice/service/LocationService.java) (Location operations), [`location-service/src/main/java/com/rideshare/locationservice/dto/DriverLocationRequest.java`](https://github.com/shekh-dalim/smartride/blob/main/location-service/src/main/java/com/rideshare/locationservice/dto/DriverLocationRequest.java) (Location request), [`location-service/src/main/java/com/rideshare/locationservice/dto/NearByDriverResponse.java`](https://github.com/shekh-dalim/smartride/blob/main/location-service/src/main/java/com/rideshare/locationservice/dto/NearByDriverResponse.java) (Nearby response)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_location["Location service"]
  node_location_app["Location runtime"]
  node_location_api["Location API"]
  node_location_service["Location operations"]
  node_location_request["Location request"]
  node_nearby_response["Nearby response"]
  node_redis_config["Redis setup<br/>[RedisConfig.java]"]
end

subgraph group_ride["Ride domain"]
  node_ride_app["Ride runtime"]
  node_ride_request["Ride request<br/>[RideRequest.java]"]
  node_ride_record[("Ride record<br/>[Ride.java]")]
  node_ride_status["Ride lifecycle<br/>[RideStatus.java]"]
  node_ride_response["Ride response<br/>[RideResponse.java]"]
end

subgraph group_matching["Matching service"]
  node_matching_app["Matching runtime"]
end

node_driver(("Driver app"))
node_driver_ops(("Driver service"))
node_redis[("Redis GEO")]

node_driver -->|"updates GPS"| node_location_api
node_driver_ops -->|"removes offline"| node_location_api
node_matching_app -->|"requests nearby"| node_location_api
node_location_api -->|"invokes operations"| node_location_service
node_location_api -->|"accepts request"| node_location_request
node_location_api -->|"returns results"| node_nearby_response
node_location_service -->|"reads coordinates"| node_location_request
node_location_service -->|"builds results"| node_nearby_response
node_location_service -->|"reads and writes GEO"| node_redis
node_redis_config -->|"configures access"| node_redis
node_ride_record -->|"tracks status"| node_ride_status

click node_location_app "https://github.com/shekh-dalim/smartride/blob/main/location-service/src/main/java/com/rideshare/locationservice/LocationServiceApplication.java"
click node_location_api "https://github.com/shekh-dalim/smartride/blob/main/location-service/src/main/java/com/rideshare/locationservice/controller/LocationController.java"
click node_location_service "https://github.com/shekh-dalim/smartride/blob/main/location-service/src/main/java/com/rideshare/locationservice/service/LocationService.java"
click node_location_request "https://github.com/shekh-dalim/smartride/blob/main/location-service/src/main/java/com/rideshare/locationservice/dto/DriverLocationRequest.java"
click node_nearby_response "https://github.com/shekh-dalim/smartride/blob/main/location-service/src/main/java/com/rideshare/locationservice/dto/NearByDriverResponse.java"
click node_redis_config "https://github.com/shekh-dalim/smartride/blob/main/location-service/src/main/java/com/rideshare/locationservice/config/RedisConfig.java"
click node_matching_app "https://github.com/shekh-dalim/smartride/blob/main/matching-service/src/main/java/com/rideshare/matchingservice/MatchingServiceApplication.java"
click node_ride_app "https://github.com/shekh-dalim/smartride/blob/main/ride-service/src/main/java/com/rideshare/rideservice/RideServiceApplication.java"
click node_ride_request "https://github.com/shekh-dalim/smartride/blob/main/ride-service/src/main/java/com/rideshare/rideservice/dto/RideRequest.java"
click node_ride_record "https://github.com/shekh-dalim/smartride/blob/main/ride-service/src/main/java/com/rideshare/rideservice/model/Ride.java"
click node_ride_status "https://github.com/shekh-dalim/smartride/blob/main/ride-service/src/main/java/com/rideshare/rideservice/model/RideStatus.java"
click node_ride_response "https://github.com/shekh-dalim/smartride/blob/main/ride-service/src/main/java/com/rideshare/rideservice/dto/RideResponse.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_location_app,node_location_api,node_location_service,node_location_request,node_nearby_response,node_redis_config toneBlue
class node_ride_app,node_ride_request,node_ride_record,node_ride_status,node_ride_response,node_redis toneAmber
class node_matching_app toneMint
class node_driver,node_driver_ops toneIndigo
```

## Components

### Location service

- [Location runtime](https://github.com/shekh-dalim/smartride/blob/main/location-service/src/main/java/com/rideshare/locationservice/LocationServiceApplication.java): `location-service/src/main/java/com/rideshare/locationservice/LocationServiceApplication.java`
- [Location API](https://github.com/shekh-dalim/smartride/blob/main/location-service/src/main/java/com/rideshare/locationservice/controller/LocationController.java): `location-service/src/main/java/com/rideshare/locationservice/controller/LocationController.java`
- [Location operations](https://github.com/shekh-dalim/smartride/blob/main/location-service/src/main/java/com/rideshare/locationservice/service/LocationService.java): `location-service/src/main/java/com/rideshare/locationservice/service/LocationService.java`
- [Location request](https://github.com/shekh-dalim/smartride/blob/main/location-service/src/main/java/com/rideshare/locationservice/dto/DriverLocationRequest.java): `location-service/src/main/java/com/rideshare/locationservice/dto/DriverLocationRequest.java`
- [Nearby response](https://github.com/shekh-dalim/smartride/blob/main/location-service/src/main/java/com/rideshare/locationservice/dto/NearByDriverResponse.java): `location-service/src/main/java/com/rideshare/locationservice/dto/NearByDriverResponse.java`
- [Redis setup](https://github.com/shekh-dalim/smartride/blob/main/location-service/src/main/java/com/rideshare/locationservice/config/RedisConfig.java): `location-service/src/main/java/com/rideshare/locationservice/config/RedisConfig.java`

### Ride domain

- [Ride runtime](https://github.com/shekh-dalim/smartride/blob/main/ride-service/src/main/java/com/rideshare/rideservice/RideServiceApplication.java): `ride-service/src/main/java/com/rideshare/rideservice/RideServiceApplication.java`
- [Ride request](https://github.com/shekh-dalim/smartride/blob/main/ride-service/src/main/java/com/rideshare/rideservice/dto/RideRequest.java): `ride-service/src/main/java/com/rideshare/rideservice/dto/RideRequest.java`
- [Ride record](https://github.com/shekh-dalim/smartride/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 lifecycle](https://github.com/shekh-dalim/smartride/blob/main/ride-service/src/main/java/com/rideshare/rideservice/model/RideStatus.java): `ride-service/src/main/java/com/rideshare/rideservice/model/RideStatus.java`
- [Ride response](https://github.com/shekh-dalim/smartride/blob/main/ride-service/src/main/java/com/rideshare/rideservice/dto/RideResponse.java): `ride-service/src/main/java/com/rideshare/rideservice/dto/RideResponse.java`

### Matching service

- [Matching runtime](https://github.com/shekh-dalim/smartride/blob/main/matching-service/src/main/java/com/rideshare/matchingservice/MatchingServiceApplication.java): `matching-service/src/main/java/com/rideshare/matchingservice/MatchingServiceApplication.java`

### Other components

- **Driver app**
- **Driver service**
- **Redis GEO**

## Connections

- Driver app → Location API: updates GPS (evidence: `location-service/src/main/java/com/rideshare/locationservice/controller/LocationController.java`)
- Driver service → Location API: removes offline (evidence: `location-service/src/main/java/com/rideshare/locationservice/controller/LocationController.java`)
- Matching runtime → Location API: requests nearby (evidence: `location-service/src/main/java/com/rideshare/locationservice/controller/LocationController.java`)
- Location API → Location operations: invokes operations (evidence: `location-service/src/main/java/com/rideshare/locationservice/controller/LocationController.java`)
- Location API → Location request: accepts request (evidence: `location-service/src/main/java/com/rideshare/locationservice/controller/LocationController.java`)
- Location API → Nearby response: returns results (evidence: `location-service/src/main/java/com/rideshare/locationservice/controller/LocationController.java`)
- Location operations → Location request: reads coordinates (evidence: `location-service/src/main/java/com/rideshare/locationservice/service/LocationService.java`)
- Location operations → Nearby response: builds results (evidence: `location-service/src/main/java/com/rideshare/locationservice/service/LocationService.java`)
- Location operations → Redis GEO: reads and writes GEO (evidence: `location-service/src/main/java/com/rideshare/locationservice/service/LocationService.java`)
- Redis setup → Redis GEO: configures access (evidence: `location-service/src/main/java/com/rideshare/locationservice/config/RedisConfig.java`)
- Ride record → Ride lifecycle: tracks status (evidence: `ride-service/src/main/java/com/rideshare/rideservice/model/Ride.java`)
