# mohamedaliglaa/taxi-booking-api architecture

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

- Interactive diagram: https://gitdiagram.com/mohamedaliglaa/taxi-booking-api
- Repository: https://github.com/mohamedaliglaa/taxi-booking-api

## Overview

This repository is a Laravel backend for a ride-hailing service. Passengers or guests enter through API routes to request and manage rides; drivers receive ride opportunities and update status or location, while payments and notifications support the trip lifecycle. Admin APIs manage rides, drivers, promotions, users, and dashboard data. The graph includes the visible controller-to-model/job/event flow and documented route/event wiring; several listed capabilities have unsampled implementations, so their internal links are omitted where evidence is unavailable.

Main entry points: [`app/Http/Controllers/Api/PaymentController.php`](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Http/Controllers/Api/PaymentController.php) (Payment management), [`routes/api.php`](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/routes/api.php) (API routes), [`app/Http/Controllers/Api/RideController.php`](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Http/Controllers/Api/RideController.php) (Ride management), [`app/Jobs/SendRideNotification.php`](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Jobs/SendRideNotification.php) (Ride notifications)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and administration"]
  node_routes["API routes<br/>[api.php]"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_admin["Admin APIs"]
  node_user[("User profiles<br/>[User.php]")]
end

subgraph group_ride["Ride operations"]
  node_ride_api["Ride management<br/>[RideController.php]"]
  node_ride_record[("Ride records<br/>[Ride.php]")]
  node_driver_record[("Driver profiles<br/>[Driver.php]")]
  node_location_api["Location tracking"]
  node_location_record[("Location records<br/>[Location.php]")]
  node_vehicle[("Vehicles<br/>[Vehicle.php]")]
  node_ride_event["Ride status event"]
  node_nearby_event["Ride requested event<br/>[RideRequested.php]"]
  node_nearby_listener["Nearby driver dispatch"]
end

subgraph group_pay["Payments"]
  node_payment_api["Payment management"]
  node_payment_record[("Payment records<br/>[Payment.php]")]
  node_payment_status["Payment status"]
end

subgraph group_notify["Notifications"]
  node_ride_notify["Ride notifications"]
  node_email_job["Email job"]
  node_email_service["Email delivery"]
  node_sms_job["SMS job<br/>[SendSmsJob.php]"]
  node_sms_service["SMS delivery"]
end

node_passenger(("Passenger or guest"))
node_driver_actor(("Driver"))
node_stripe["Stripe"]
node_brevo["Brevo service"]

node_passenger -->|"requests API"| node_routes
node_driver_actor -->|"uses API"| node_routes
node_routes -->|"routes to"| node_auth
node_routes -->|"routes to"| node_ride_api
node_routes -->|"routes to"| node_location_api
node_routes -->|"routes to"| node_payment_api
node_routes -->|"routes to"| node_admin
node_auth -->|"uses"| node_user
node_ride_api -->|"reads and updates"| node_ride_record
node_ride_api -->|"queries drivers"| node_driver_record
node_ride_api -->|"broadcasts"| node_ride_event
node_ride_api -->|"dispatches"| node_ride_notify
node_ride_api -->|"dispatches"| node_email_job
node_location_api -->|"updates"| node_location_record
node_location_api -->|"queries drivers"| node_driver_record
node_location_api -->|"broadcasts location"| node_nearby_event
node_nearby_event -->|"handled by"| node_nearby_listener
node_nearby_listener -.->|"dispatches"| node_ride_notify
node_ride_notify -->|"notifies"| node_user
node_ride_notify -.->|"dispatches"| node_email_job
node_payment_api -->|"creates and reads"| node_payment_record
node_payment_api -->|"reads and updates"| node_ride_record
node_payment_api -->|"uses"| node_payment_status
node_payment_api -->|"dispatches"| node_email_job
node_payment_api -->|"dispatches"| node_sms_job
node_payment_api -->|"creates checkout"| node_stripe
node_email_job -->|"invokes"| node_email_service
node_email_service -->|"sends email"| node_brevo
node_sms_job -->|"invokes"| node_sms_service
node_sms_service -.->|"sends SMS"| node_brevo
node_admin -->|"manages rides"| node_ride_record
node_admin -->|"dispatches notifications"| node_ride_notify
node_admin -->|"dispatches email"| node_email_job

click node_routes "https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/routes/api.php"
click node_auth "https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Http/Controllers/Api/AuthController.php"
click node_admin "https://github.com/mohamedaliglaa/taxi-booking-api/tree/main/app/Http/Controllers/Api/Admin"
click node_user "https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Models/User.php"
click node_ride_api "https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Http/Controllers/Api/RideController.php"
click node_ride_record "https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Models/Ride.php"
click node_driver_record "https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Models/Driver.php"
click node_location_api "https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Http/Controllers/Api/LocationController.php"
click node_location_record "https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Models/Location.php"
click node_vehicle "https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Models/Vehicle.php"
click node_ride_event "https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Events/RideStatusUpdated.php"
click node_nearby_event "https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Events/RideRequested.php"
click node_nearby_listener "https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Listeners/NotifyNearbyDrivers.php"
click node_payment_api "https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Http/Controllers/Api/PaymentController.php"
click node_payment_record "https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Models/Payment.php"
click node_payment_status "https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Services/PaymentStatusService.php"
click node_ride_notify "https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Jobs/SendRideNotification.php"
click node_email_job "https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Jobs/SendBrevoEmailJob.php"
click node_email_service "https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Services/BrevoEmailService.php"
click node_sms_job "https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Jobs/SendSmsJob.php"
click node_sms_service "https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Services/Sms/BrevoSmsService.php"

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_auth,node_admin,node_user toneBlue
class node_ride_api,node_ride_record,node_driver_record,node_location_api,node_location_record,node_vehicle,node_ride_event,node_nearby_event,node_nearby_listener toneAmber
class node_payment_api,node_payment_record,node_payment_status toneMint
class node_ride_notify,node_email_job,node_email_service,node_sms_job,node_sms_service toneRose
class node_passenger,node_driver_actor,node_stripe,node_brevo toneIndigo
```

## Components

### API and administration

- [API routes](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/routes/api.php): `routes/api.php`
- [Authentication](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Http/Controllers/Api/AuthController.php): `app/Http/Controllers/Api/AuthController.php`
- [Admin APIs](https://github.com/mohamedaliglaa/taxi-booking-api/tree/main/app/Http/Controllers/Api/Admin): `app/Http/Controllers/Api/Admin`
- [User profiles](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Models/User.php): `app/Models/User.php`

### Ride operations

- [Ride management](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Http/Controllers/Api/RideController.php): `app/Http/Controllers/Api/RideController.php`
- [Ride records](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Models/Ride.php): `app/Models/Ride.php`
- [Driver profiles](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Models/Driver.php): `app/Models/Driver.php`
- [Location tracking](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Http/Controllers/Api/LocationController.php): `app/Http/Controllers/Api/LocationController.php`
- [Location records](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Models/Location.php): `app/Models/Location.php`
- [Vehicles](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Models/Vehicle.php): `app/Models/Vehicle.php`
- [Ride status event](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Events/RideStatusUpdated.php): `app/Events/RideStatusUpdated.php`
- [Ride requested event](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Events/RideRequested.php): `app/Events/RideRequested.php`
- [Nearby driver dispatch](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Listeners/NotifyNearbyDrivers.php): `app/Listeners/NotifyNearbyDrivers.php`

### Payments

- [Payment management](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Http/Controllers/Api/PaymentController.php): `app/Http/Controllers/Api/PaymentController.php`
- [Payment records](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Models/Payment.php): `app/Models/Payment.php`
- [Payment status](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Services/PaymentStatusService.php): `app/Services/PaymentStatusService.php`

### Notifications

- [Ride notifications](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Jobs/SendRideNotification.php): `app/Jobs/SendRideNotification.php`
- [Email job](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Jobs/SendBrevoEmailJob.php): `app/Jobs/SendBrevoEmailJob.php`
- [Email delivery](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Services/BrevoEmailService.php): `app/Services/BrevoEmailService.php`
- [SMS job](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Jobs/SendSmsJob.php): `app/Jobs/SendSmsJob.php`
- [SMS delivery](https://github.com/mohamedaliglaa/taxi-booking-api/blob/main/app/Services/Sms/BrevoSmsService.php): `app/Services/Sms/BrevoSmsService.php`

### Other components

- **Passenger or guest**
- **Driver**
- **Stripe**
- **Brevo service**

## Connections

- Passenger or guest → API routes: requests API (evidence: `routes/api.php`)
- Driver → API routes: uses API (evidence: `routes/api.php`)
- API routes → Authentication: routes to (evidence: `routes/api.php`)
- API routes → Ride management: routes to (evidence: `routes/api.php`)
- API routes → Location tracking: routes to (evidence: `routes/api.php`)
- API routes → Payment management: routes to (evidence: `routes/api.php`)
- API routes → Admin APIs: routes to (evidence: `routes/api.php`)
- Authentication → User profiles: uses (evidence: `app/Http/Controllers/Api/AuthController.php`)
- Ride management → Ride records: reads and updates (evidence: `app/Http/Controllers/Api/RideController.php`)
- Ride management → Driver profiles: queries drivers (evidence: `app/Http/Controllers/Api/RideController.php`)
- Ride management → Ride status event: broadcasts (evidence: `app/Http/Controllers/Api/RideController.php`)
- Ride management → Ride notifications: dispatches (evidence: `app/Http/Controllers/Api/RideController.php`)
- Ride management → Email job: dispatches (evidence: `app/Http/Controllers/Api/RideController.php`)
- Location tracking → Location records: updates (evidence: `app/Http/Controllers/Api/LocationController.php`)
- Location tracking → Driver profiles: queries drivers (evidence: `app/Http/Controllers/Api/LocationController.php`)
- Location tracking → Ride requested event: broadcasts location (evidence: `app/Http/Controllers/Api/LocationController.php`)
- Ride requested event → Nearby driver dispatch: handled by (evidence: `app/Providers/EventServiceProvider.php`)
- Nearby driver dispatch → Ride notifications: dispatches
- Ride notifications → User profiles: notifies (evidence: `app/Jobs/SendRideNotification.php`)
- Ride notifications → Email job: dispatches
- Payment management → Payment records: creates and reads (evidence: `app/Http/Controllers/Api/PaymentController.php`)
- Payment management → Ride records: reads and updates (evidence: `app/Http/Controllers/Api/PaymentController.php`)
- Payment management → Payment status: uses (evidence: `app/Http/Controllers/Api/PaymentController.php`)
- Payment management → Email job: dispatches (evidence: `app/Http/Controllers/Api/PaymentController.php`)
- Payment management → SMS job: dispatches (evidence: `app/Http/Controllers/Api/PaymentController.php`)
- Payment management → Stripe: creates checkout (evidence: `app/Http/Controllers/Api/PaymentController.php`)
- Email job → Email delivery: invokes (evidence: `app/Jobs/SendBrevoEmailJob.php`)
- Email delivery → Brevo service: sends email (evidence: `app/Services/BrevoEmailService.php`)
- SMS job → SMS delivery: invokes (evidence: `app/Jobs/SendSmsJob.php`)
- SMS delivery → Brevo service: sends SMS
- Admin APIs → Ride records: manages rides (evidence: `app/Http/Controllers/Api/Admin/RideController.php`)
- Admin APIs → Ride notifications: dispatches notifications (evidence: `app/Http/Controllers/Api/Admin/RideController.php`)
- Admin APIs → Email job: dispatches email (evidence: `app/Http/Controllers/Api/Admin/RideController.php`)
