# ahsan0110/udhaar-wheels architecture

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

- Interactive diagram: https://gitdiagram.com/ahsan0110/udhaar-wheels
- Repository: https://github.com/ahsan0110/udhaar-wheels

## Overview

Udhaar Wheels is a peer-to-peer car-rental marketplace. Guests browse listings, request and pay for bookings, sign agreements, complete trip handovers, and review; hosts list cars, manage bookings, and request payouts, while administrators moderate users/listings, disputes, and payouts. The Vue SPA calls a Laravel REST API, whose services coordinate booking, payment, and wallet operations backed by MySQL. Real-time chat and notifications use Pusher, and transactional email uses Brevo. Some branches are based on README capabilities because their implementation was not sampled; edges are limited to documented or indexed relationships.

Main entry points: [`Backend/app/Services/BookingService.php`](https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Services/BookingService.php) (Booking lifecycle), [`Frontend/src/Pages`](https://github.com/ahsan0110/udhaar-wheels/tree/main/Frontend/src/Pages) (Role dashboards), [`Backend/routes/api.php`](https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/routes/api.php) (Laravel REST API), [`Backend/app/Http/Controllers/Guest/BookingController.php`](https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Http/Controllers/Guest/BookingController.php) (Booking endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_spa["Vue application<br/>[main.js]"]
  node_screens["Role dashboards"]
  node_api_client["API client<br/>[apiClient.js]"]
  node_api["Laravel REST API<br/>[api.php]"]
end

subgraph group_market["Marketplace and trips"]
  node_cars[("Car listings<br/>[Car.php]")]
  node_booking_api["Booking endpoints"]
  node_host_bookings["Host booking actions"]
  node_booking_service["Booking lifecycle<br/>[BookingService.php]"]
  node_booking_data[("Bookings and agreements<br/>[Booking.php]")]
  node_handover["Trip handover"]
  node_reviews["Reviews"]
  node_review_data[("Review records<br/>[Review.php]")]
  node_admin_tools["Moderation and disputes"]
end

subgraph group_money["Payments and payouts"]
  node_stripe["Stripe payments<br/>[StripeService.php]"]
  node_stripe_service{{"Stripe"}}
  node_wallet["Wallet and payouts<br/>[WalletService.php]"]
  node_payout_admin["Payout administration"]
  node_wallet_data[("Wallet transactions")]
end

subgraph group_platform["Identity and communications"]
  node_auth["Authentication<br/>[AuthService.php]"]
  node_users[("User accounts<br/>[User.php]")]
  node_chat["Chat and messaging<br/>[ChatService.php]"]
  node_realtime{{"Pusher real-time"}}
  node_mail["Email notifications"]
  node_brevo{{"Brevo email"}}
end

node_guest(("Guest and host"))
node_admin(("Super admin"))
node_mysql[("MySQL")]

node_guest -->|"uses"| node_spa
node_admin -->|"uses"| node_spa
node_spa -->|"renders"| node_screens
node_screens -->|"requests"| node_api_client
node_api_client -->|"calls REST"| node_api
node_api -.->|"authenticates"| node_auth
node_auth -->|"uses"| node_users
node_api -.->|"routes requests"| node_booking_api
node_booking_api -->|"delegates booking"| node_booking_service
node_host_bookings -->|"delegates booking"| node_booking_service
node_booking_service -->|"updates lifecycle"| node_booking_data
node_booking_service -->|"uses payments"| node_stripe
node_booking_api -->|"verifies intent"| node_stripe
node_stripe -->|"charges and authorizes"| node_stripe_service
node_booking_service -->|"uses inspections"| node_handover
node_booking_service -->|"sends trip mail"| node_mail
node_reviews -->|"creates and queries"| node_review_data
node_reviews -->|"notifies reviewer"| node_users
node_screens -.->|"uses messaging"| node_chat
node_chat -->|"broadcasts"| node_realtime
node_mail -->|"dispatches email"| node_brevo
node_payout_admin -->|"recalculates balances"| node_wallet
node_payout_admin -->|"releases transactions"| node_wallet_data
node_wallet -->|"records earnings"| node_wallet_data
node_admin -->|"moderates"| node_admin_tools
node_admin -->|"reviews payouts"| node_payout_admin
node_booking_data -->|"persists"| node_mysql
node_cars -->|"persists"| node_mysql
node_users -->|"persists"| node_mysql
node_wallet_data -->|"persists"| node_mysql

click node_spa "https://github.com/ahsan0110/udhaar-wheels/blob/main/Frontend/src/main.js"
click node_screens "https://github.com/ahsan0110/udhaar-wheels/tree/main/Frontend/src/Pages"
click node_api_client "https://github.com/ahsan0110/udhaar-wheels/blob/main/Frontend/src/services/apiClient.js"
click node_api "https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/routes/api.php"
click node_auth "https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Services/AuthService.php"
click node_users "https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Models/User.php"
click node_cars "https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Models/Car.php"
click node_booking_api "https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Http/Controllers/Guest/BookingController.php"
click node_host_bookings "https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Http/Controllers/Host/HostBookingController.php"
click node_booking_service "https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Services/BookingService.php"
click node_booking_data "https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Models/Booking.php"
click node_handover "https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Services/HandoverInspectionService.php"
click node_reviews "https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Http/Controllers/ReviewController.php"
click node_review_data "https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Models/Review.php"
click node_stripe "https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Services/StripeService.php"
click node_wallet "https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Services/WalletService.php"
click node_payout_admin "https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Http/Controllers/Admin/AdminPayoutController.php"
click node_wallet_data "https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Models/WalletTransaction.php"
click node_chat "https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Services/ChatService.php"
click node_mail "https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Services/NotificationMailService.php"
click node_admin_tools "https://github.com/ahsan0110/udhaar-wheels/tree/main/Backend/app/Http/Controllers/Admin"

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_spa,node_screens,node_api_client,node_api toneBlue
class node_cars,node_booking_api,node_host_bookings,node_booking_service,node_booking_data,node_handover,node_reviews,node_review_data,node_admin_tools,node_mysql toneAmber
class node_stripe,node_stripe_service,node_wallet,node_payout_admin,node_wallet_data toneMint
class node_auth,node_users,node_chat,node_realtime,node_mail,node_brevo toneRose
class node_guest,node_admin toneIndigo
```

## Components

### Web experience

- [Vue application](https://github.com/ahsan0110/udhaar-wheels/blob/main/Frontend/src/main.js): `Frontend/src/main.js`
- [Role dashboards](https://github.com/ahsan0110/udhaar-wheels/tree/main/Frontend/src/Pages): `Frontend/src/Pages`
- [API client](https://github.com/ahsan0110/udhaar-wheels/blob/main/Frontend/src/services/apiClient.js): `Frontend/src/services/apiClient.js`
- [Laravel REST API](https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/routes/api.php): `Backend/routes/api.php`

### Marketplace and trips

- [Car listings](https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Models/Car.php): `Backend/app/Models/Car.php`
- [Booking endpoints](https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Http/Controllers/Guest/BookingController.php): `Backend/app/Http/Controllers/Guest/BookingController.php`
- [Host booking actions](https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Http/Controllers/Host/HostBookingController.php): `Backend/app/Http/Controllers/Host/HostBookingController.php`
- [Booking lifecycle](https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Services/BookingService.php): `Backend/app/Services/BookingService.php`
- [Bookings and agreements](https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Models/Booking.php): `Backend/app/Models/Booking.php`
- [Trip handover](https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Services/HandoverInspectionService.php): `Backend/app/Services/HandoverInspectionService.php`
- [Reviews](https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Http/Controllers/ReviewController.php): `Backend/app/Http/Controllers/ReviewController.php`
- [Review records](https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Models/Review.php): `Backend/app/Models/Review.php`
- [Moderation and disputes](https://github.com/ahsan0110/udhaar-wheels/tree/main/Backend/app/Http/Controllers/Admin): `Backend/app/Http/Controllers/Admin`

### Payments and payouts

- [Stripe payments](https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Services/StripeService.php): `Backend/app/Services/StripeService.php`
- **Stripe**
- [Wallet and payouts](https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Services/WalletService.php): `Backend/app/Services/WalletService.php`
- [Payout administration](https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Http/Controllers/Admin/AdminPayoutController.php): `Backend/app/Http/Controllers/Admin/AdminPayoutController.php`
- [Wallet transactions](https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Models/WalletTransaction.php): `Backend/app/Models/WalletTransaction.php`

### Identity and communications

- [Authentication](https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Services/AuthService.php): `Backend/app/Services/AuthService.php`
- [User accounts](https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Models/User.php): `Backend/app/Models/User.php`
- [Chat and messaging](https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Services/ChatService.php): `Backend/app/Services/ChatService.php`
- **Pusher real-time**
- [Email notifications](https://github.com/ahsan0110/udhaar-wheels/blob/main/Backend/app/Services/NotificationMailService.php): `Backend/app/Services/NotificationMailService.php`
- **Brevo email**

### Other components

- **Guest and host**
- **Super admin**
- **MySQL**

## Connections

- Guest and host → Vue application: uses (evidence: `README.md`)
- Super admin → Vue application: uses (evidence: `README.md`)
- Vue application → Role dashboards: renders (evidence: `Frontend/src/main.js`)
- Role dashboards → API client: requests (evidence: `Frontend/src/services/apiClient.js`)
- API client → Laravel REST API: calls REST (evidence: `README.md`)
- Laravel REST API → Authentication: authenticates
- Authentication → User accounts: uses (evidence: `Backend/app/Services/AuthService.php`)
- Laravel REST API → Booking endpoints: routes requests
- Booking endpoints → Booking lifecycle: delegates booking (evidence: `Backend/app/Http/Controllers/Guest/BookingController.php`)
- Host booking actions → Booking lifecycle: delegates booking (evidence: `Backend/app/Http/Controllers/Host/HostBookingController.php`)
- Booking lifecycle → Bookings and agreements: updates lifecycle (evidence: `Backend/app/Services/BookingService.php`)
- Booking lifecycle → Stripe payments: uses payments (evidence: `Backend/app/Services/BookingService.php`)
- Booking endpoints → Stripe payments: verifies intent (evidence: `Backend/app/Http/Controllers/Guest/BookingController.php`)
- Stripe payments → Stripe: charges and authorizes (evidence: `README.md`)
- Booking lifecycle → Trip handover: uses inspections (evidence: `Backend/app/Services/BookingService.php`)
- Booking lifecycle → Email notifications: sends trip mail (evidence: `Backend/app/Services/BookingService.php`)
- Reviews → Review records: creates and queries (evidence: `Backend/app/Http/Controllers/ReviewController.php`)
- Reviews → User accounts: notifies reviewer (evidence: `Backend/app/Http/Controllers/ReviewController.php`)
- Role dashboards → Chat and messaging: uses messaging
- Chat and messaging → Pusher real-time: broadcasts (evidence: `README.md`)
- Email notifications → Brevo email: dispatches email (evidence: `README.md`)
- Payout administration → Wallet and payouts: recalculates balances (evidence: `Backend/app/Http/Controllers/Admin/AdminPayoutController.php`)
- Payout administration → Wallet transactions: releases transactions (evidence: `Backend/app/Http/Controllers/Admin/AdminPayoutController.php`)
- Wallet and payouts → Wallet transactions: records earnings (evidence: `Backend/app/Services/WalletService.php`)
- Super admin → Moderation and disputes: moderates (evidence: `README.md`)
- Super admin → Payout administration: reviews payouts (evidence: `Backend/app/Http/Controllers/Admin/AdminPayoutController.php`)
- Bookings and agreements → MySQL: persists (evidence: `README.md`)
- Car listings → MySQL: persists (evidence: `README.md`)
- User accounts → MySQL: persists (evidence: `README.md`)
- Wallet transactions → MySQL: persists (evidence: `README.md`)
