# alamin200290/teaching-sadp-summer2025-2026-sec-ab architecture

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

- Interactive diagram: https://gitdiagram.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab
- Repository: https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab

## Overview

UniRide is a ride-booking backend: HTTP routes expose ride, driver, support, health, and metrics operations. The tree shows booking, driver matching, pricing, payment, notification, geocoding, audit, and support subsystems. Sampled source confirms route dispatch and matching’s repository lookup, but not the wiring between booking and those subsystems; those connections are therefore omitted. The graph uses the week-11 tree as its representative version.

Main entry points: [`week-11/uniride-backend/src/http/routes.ts`](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/http/routes.ts) (HTTP routes), [`week-11/uniride-backend/src/matching/MatchingEngine.ts`](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/matching/MatchingEngine.ts) (Driver matching), [`week-11/uniride-backend/src/http/controllers/RideController.ts`](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/http/controllers/RideController.ts) (Ride controller), [`week-11/uniride-backend/src/http/controllers/DriverController.ts`](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/http/controllers/DriverController.ts) (Driver controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP API"]
  node_routes["HTTP routes<br/>[routes.ts]"]
  node_ride_controller["Ride controller<br/>[RideController.ts]"]
  node_driver_controller["Driver controller"]
  node_support_controller["Support controller"]
  node_health_controller["Health controller"]
  node_metrics_controller["Metrics controller"]
end

subgraph group_booking["Booking Domain"]
  node_request_use_case["Ride request"]
  node_booking_facade["Booking facade"]
  node_booking_saga["Booking saga<br/>[BookingSaga.ts]"]
  node_matching["Driver matching<br/>[MatchingEngine.ts]"]
  node_driver_repository["Driver repository"]
  node_ride_service["Ride service<br/>[RideService.ts]"]
  node_ride_repository["Ride repository<br/>[RideRepository.ts]"]
  node_fare_policy["Fare policies<br/>[FarePolicy.ts]"]
end

subgraph group_integrations["Services"]
  node_payments["Payment service<br/>[PaymentService.ts]"]
  node_notifications["Notifications"]
  node_geocoding["Geocoding<br/>[GeocodingPort.ts]"]
  node_support_agent["Support agent<br/>[RagSupportAgent.ts]"]
  node_audit_ledger[("Ride audit ledger<br/>[RideAuditLedger.ts]")]
end

subgraph group_platform["Platform"]
  node_event_broker["Event broker<br/>[EventBroker.ts]"]
  node_iot_processor["IoT edge processor<br/>[EdgeProcessor.ts]"]
  node_http_server["HTTP server<br/>[HttpServer.ts]"]
  node_metrics_registry["Metrics registry<br/>[MetricsRegistry.ts]"]
end

node_caller(("API caller"))

node_caller -->|"HTTP request"| node_routes
node_routes -->|"dispatches rides"| node_ride_controller
node_routes -->|"dispatches drivers"| node_driver_controller
node_routes -->|"dispatches support"| node_support_controller
node_routes -->|"dispatches health"| node_health_controller
node_routes -->|"dispatches metrics"| node_metrics_controller
node_matching -->|"queries candidates"| node_driver_repository

click node_routes "https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/http/routes.ts"
click node_ride_controller "https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/http/controllers/RideController.ts"
click node_driver_controller "https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/http/controllers/DriverController.ts"
click node_support_controller "https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/http/controllers/SupportController.ts"
click node_health_controller "https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/http/controllers/HealthController.ts"
click node_metrics_controller "https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/http/controllers/MetricsController.ts"
click node_request_use_case "https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/app/RequestRideUseCase.ts"
click node_booking_facade "https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/app/RideBookingFacade.ts"
click node_booking_saga "https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/app/BookingSaga.ts"
click node_matching "https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/matching/MatchingEngine.ts"
click node_driver_repository "https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/drivers/DriverRepository.ts"
click node_ride_service "https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/rides/RideService.ts"
click node_ride_repository "https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/rides/RideRepository.ts"
click node_fare_policy "https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/rides/FarePolicy.ts"
click node_payments "https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/payments/PaymentService.ts"
click node_notifications "https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/notifications/NotificationDispatcher.ts"
click node_geocoding "https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/geocoding/GeocodingPort.ts"
click node_support_agent "https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/ai/RagSupportAgent.ts"
click node_audit_ledger "https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/blockchain/RideAuditLedger.ts"
click node_event_broker "https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/messaging/EventBroker.ts"
click node_iot_processor "https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/iot/EdgeProcessor.ts"
click node_http_server "https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/http/HttpServer.ts"
click node_metrics_registry "https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/observability/MetricsRegistry.ts"

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_routes,node_ride_controller,node_driver_controller,node_support_controller,node_health_controller,node_metrics_controller toneBlue
class node_request_use_case,node_booking_facade,node_booking_saga,node_matching,node_driver_repository,node_ride_service,node_ride_repository,node_fare_policy toneAmber
class node_payments,node_notifications,node_geocoding,node_support_agent,node_audit_ledger,node_caller toneMint
class node_event_broker,node_iot_processor,node_http_server,node_metrics_registry toneRose
```

## Components

### HTTP API

- [HTTP routes](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/http/routes.ts): `week-11/uniride-backend/src/http/routes.ts`
- [Ride controller](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/http/controllers/RideController.ts): `week-11/uniride-backend/src/http/controllers/RideController.ts`
- [Driver controller](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/http/controllers/DriverController.ts): `week-11/uniride-backend/src/http/controllers/DriverController.ts`
- [Support controller](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/http/controllers/SupportController.ts): `week-11/uniride-backend/src/http/controllers/SupportController.ts`
- [Health controller](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/http/controllers/HealthController.ts): `week-11/uniride-backend/src/http/controllers/HealthController.ts`
- [Metrics controller](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/http/controllers/MetricsController.ts): `week-11/uniride-backend/src/http/controllers/MetricsController.ts`

### Booking Domain

- [Ride request](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/app/RequestRideUseCase.ts): `week-11/uniride-backend/src/app/RequestRideUseCase.ts`
- [Booking facade](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/app/RideBookingFacade.ts): `week-11/uniride-backend/src/app/RideBookingFacade.ts`
- [Booking saga](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/app/BookingSaga.ts): `week-11/uniride-backend/src/app/BookingSaga.ts`
- [Driver matching](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/matching/MatchingEngine.ts): `week-11/uniride-backend/src/matching/MatchingEngine.ts`
- [Driver repository](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/drivers/DriverRepository.ts): `week-11/uniride-backend/src/drivers/DriverRepository.ts`
- [Ride service](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/rides/RideService.ts): `week-11/uniride-backend/src/rides/RideService.ts`
- [Ride repository](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/rides/RideRepository.ts): `week-11/uniride-backend/src/rides/RideRepository.ts`
- [Fare policies](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/rides/FarePolicy.ts): `week-11/uniride-backend/src/rides/FarePolicy.ts`

### Services

- [Payment service](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/payments/PaymentService.ts): `week-11/uniride-backend/src/payments/PaymentService.ts`
- [Notifications](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/notifications/NotificationDispatcher.ts): `week-11/uniride-backend/src/notifications/NotificationDispatcher.ts`
- [Geocoding](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/geocoding/GeocodingPort.ts): `week-11/uniride-backend/src/geocoding/GeocodingPort.ts`
- [Support agent](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/ai/RagSupportAgent.ts): `week-11/uniride-backend/src/ai/RagSupportAgent.ts`
- [Ride audit ledger](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/blockchain/RideAuditLedger.ts): `week-11/uniride-backend/src/blockchain/RideAuditLedger.ts`

### Platform

- [Event broker](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/messaging/EventBroker.ts): `week-11/uniride-backend/src/messaging/EventBroker.ts`
- [IoT edge processor](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/iot/EdgeProcessor.ts): `week-11/uniride-backend/src/iot/EdgeProcessor.ts`
- [HTTP server](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/http/HttpServer.ts): `week-11/uniride-backend/src/http/HttpServer.ts`
- [Metrics registry](https://github.com/alamin200290/teaching-sadp-summer2025-2026-sec-ab/blob/main/week-11/uniride-backend/src/observability/MetricsRegistry.ts): `week-11/uniride-backend/src/observability/MetricsRegistry.ts`

### Other components

- **API caller**

## Connections

- API caller → HTTP routes: HTTP request
- HTTP routes → Ride controller: dispatches rides
- HTTP routes → Driver controller: dispatches drivers
- HTTP routes → Support controller: dispatches support
- HTTP routes → Health controller: dispatches health
- HTTP routes → Metrics controller: dispatches metrics
- Driver matching → Driver repository: queries candidates
