# rayan-web790/car-rental architecture

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

- Interactive diagram: https://gitdiagram.com/rayan-web790/car-rental
- Repository: https://github.com/rayan-web790/car-rental

## Overview

VoitureSaada is a SQL Server-backed car-rental ecosystem with an ASP.NET Core customer portal and a WPF administration dashboard. The customer workflow covers account access, vehicle discovery, reservation confirmation, and a generated PDF receipt with a QR verification link; the admin app provides fleet, collection, user, and statistics management. The graph preserves documented reporting and payment/document areas, but sampled evidence does not establish all their runtime wiring. Edges are limited to visible calls or README statements.

Main entry points: [`src/VoitureSaada.Web/Services/DatabaseHelper.cs`](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Services/DatabaseHelper.cs) (Web database access), [`src/VoitureSaada.Web/Program.cs`](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Program.cs) (MVC application), [`src/VoitureSaada.Web/Controllers/ReservationController.cs`](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Controllers/ReservationController.cs) (Booking confirmation), [`src/VoitureSaada.Web/Controllers/AccountController.cs`](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Controllers/AccountController.cs) (Account access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Customer portal"]
  node_webapp["MVC application<br/>[Program.cs]"]
  node_accounts["Account access"]
  node_catalog["Vehicle catalog<br/>[HomeController.cs]"]
  node_collections["Collections"]
  node_collectionmodel["Collection model<br/>[Collection.cs]"]
end

subgraph group_rental["Rental operations"]
  node_reservation["Booking confirmation"]
  node_receipt["PDF and QR receipt"]
  node_receiptfiles["Receipt files<br/>[documents]"]
  node_myreservations["My reservations"]
  node_documents["Documents"]
  node_payments["Payments"]
  node_reservationmodel["Reservation model<br/>[Reservation.cs]"]
end

subgraph group_admin["Admin dashboard"]
  node_loginwindow["Admin sign-in"]
  node_fleet["Fleet management"]
  node_admincollections["Collection management"]
  node_dashboard["User dashboard"]
  node_statistics["Statistics reports"]
  node_settings["Admin settings"]
end

subgraph group_data["Persistence"]
  node_webdbhelper["Web database access<br/>[DatabaseHelper.cs]"]
  node_admindbhelper["Admin database access<br/>[DatabaseHelper.cs]"]
  node_sqlserver[("SQL Server<br/>[init_db.sql]")]
  node_passwordhash["Password hashing<br/>[PasswordHasher.cs]"]
end

node_customer(("Customer"))
node_adminuser(("Administrator"))

node_customer -->|"uses portal"| node_webapp
node_webapp -->|"routes requests"| node_accounts
node_webapp -->|"routes requests"| node_catalog
node_accounts -->|"queries users"| node_webdbhelper
node_accounts -->|"verifies passwords"| node_passwordhash
node_catalog -->|"queries vehicles"| node_webdbhelper
node_collections -->|"queries collections"| node_webdbhelper
node_collections -->|"creates models"| node_collectionmodel
node_reservation -->|"reads and writes"| node_webdbhelper
node_reservation -->|"verifies password"| node_passwordhash
node_reservation -->|"generates receipt"| node_receipt
node_receipt -->|"writes PDF"| node_receiptfiles
node_adminuser -->|"signs in"| node_loginwindow
node_dashboard -->|"loads dashboard data"| node_admindbhelper
node_admincollections -->|"manages collections"| node_admindbhelper
node_webapp -->|"registers service"| node_webdbhelper
node_webdbhelper -.->|"uses SQL database"| node_sqlserver
node_admindbhelper -.->|"uses SQL database"| node_sqlserver
node_customer -.->|"views bookings"| node_myreservations
node_customer -.->|"accesses documents"| node_documents
node_customer -.->|"uses payments"| node_payments

click node_webapp "https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Program.cs"
click node_accounts "https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Controllers/AccountController.cs"
click node_catalog "https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Controllers/HomeController.cs"
click node_collections "https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Controllers/CollectionsController.cs"
click node_reservation "https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Controllers/ReservationController.cs"
click node_receipt "https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Controllers/ReservationController.cs"
click node_receiptfiles "https://github.com/rayan-web790/car-rental/tree/main/src/VoitureSaada.Web/wwwroot/documents"
click node_myreservations "https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Controllers/MyReservationsController.cs"
click node_documents "https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Controllers/DocumentsController.cs"
click node_payments "https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Controllers/PaymentsController.cs"
click node_loginwindow "https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Monitoring/LoginWindow.xaml.cs"
click node_fleet "https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Monitoring/Views/VehicleManagementView.xaml.cs"
click node_admincollections "https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Monitoring/Views/CollectionsView.xaml.cs"
click node_dashboard "https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Monitoring/Views/UserDashboardView.xaml.cs"
click node_statistics "https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Monitoring/Views/StatisticsView.xaml.cs"
click node_settings "https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Monitoring/Views/SettingsView.xaml.cs"
click node_webdbhelper "https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Services/DatabaseHelper.cs"
click node_admindbhelper "https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Monitoring/Services/DatabaseHelper.cs"
click node_sqlserver "https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Database/init_db.sql"
click node_passwordhash "https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Services/PasswordHasher.cs"
click node_reservationmodel "https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Models/Reservation.cs"
click node_collectionmodel "https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Models/Collection.cs"

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_webapp,node_accounts,node_catalog,node_collections,node_collectionmodel toneBlue
class node_reservation,node_receipt,node_receiptfiles,node_myreservations,node_documents,node_payments,node_reservationmodel toneAmber
class node_loginwindow,node_fleet,node_admincollections,node_dashboard,node_statistics,node_settings toneMint
class node_webdbhelper,node_admindbhelper,node_sqlserver,node_passwordhash toneRose
class node_customer,node_adminuser toneIndigo
```

## Components

### Customer portal

- [MVC application](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Program.cs): `src/VoitureSaada.Web/Program.cs`
- [Account access](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Controllers/AccountController.cs): `src/VoitureSaada.Web/Controllers/AccountController.cs`
- [Vehicle catalog](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Controllers/HomeController.cs): `src/VoitureSaada.Web/Controllers/HomeController.cs`
- [Collections](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Controllers/CollectionsController.cs): `src/VoitureSaada.Web/Controllers/CollectionsController.cs`
- [Collection model](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Models/Collection.cs): `src/VoitureSaada.Web/Models/Collection.cs`

### Rental operations

- [Booking confirmation](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Controllers/ReservationController.cs): `src/VoitureSaada.Web/Controllers/ReservationController.cs`
- [PDF and QR receipt](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Controllers/ReservationController.cs): `src/VoitureSaada.Web/Controllers/ReservationController.cs`
- [Receipt files](https://github.com/rayan-web790/car-rental/tree/main/src/VoitureSaada.Web/wwwroot/documents): `src/VoitureSaada.Web/wwwroot/documents`
- [My reservations](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Controllers/MyReservationsController.cs): `src/VoitureSaada.Web/Controllers/MyReservationsController.cs`
- [Documents](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Controllers/DocumentsController.cs): `src/VoitureSaada.Web/Controllers/DocumentsController.cs`
- [Payments](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Controllers/PaymentsController.cs): `src/VoitureSaada.Web/Controllers/PaymentsController.cs`
- [Reservation model](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Models/Reservation.cs): `src/VoitureSaada.Web/Models/Reservation.cs`

### Admin dashboard

- [Admin sign-in](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Monitoring/LoginWindow.xaml.cs): `src/VoitureSaada.Monitoring/LoginWindow.xaml.cs`
- [Fleet management](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Monitoring/Views/VehicleManagementView.xaml.cs): `src/VoitureSaada.Monitoring/Views/VehicleManagementView.xaml.cs`
- [Collection management](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Monitoring/Views/CollectionsView.xaml.cs): `src/VoitureSaada.Monitoring/Views/CollectionsView.xaml.cs`
- [User dashboard](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Monitoring/Views/UserDashboardView.xaml.cs): `src/VoitureSaada.Monitoring/Views/UserDashboardView.xaml.cs`
- [Statistics reports](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Monitoring/Views/StatisticsView.xaml.cs): `src/VoitureSaada.Monitoring/Views/StatisticsView.xaml.cs`
- [Admin settings](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Monitoring/Views/SettingsView.xaml.cs): `src/VoitureSaada.Monitoring/Views/SettingsView.xaml.cs`

### Persistence

- [Web database access](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Services/DatabaseHelper.cs): `src/VoitureSaada.Web/Services/DatabaseHelper.cs`
- [Admin database access](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Monitoring/Services/DatabaseHelper.cs): `src/VoitureSaada.Monitoring/Services/DatabaseHelper.cs`
- [SQL Server](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Database/init_db.sql): `src/VoitureSaada.Database/init_db.sql`
- [Password hashing](https://github.com/rayan-web790/car-rental/blob/main/src/VoitureSaada.Web/Services/PasswordHasher.cs): `src/VoitureSaada.Web/Services/PasswordHasher.cs`

### Other components

- **Customer**
- **Administrator**

## Connections

- Customer → MVC application: uses portal (evidence: `README.md`)
- MVC application → Account access: routes requests (evidence: `src/VoitureSaada.Web/Program.cs`)
- MVC application → Vehicle catalog: routes requests (evidence: `src/VoitureSaada.Web/Program.cs`)
- Account access → Web database access: queries users (evidence: `src/VoitureSaada.Web/Controllers/AccountController.cs`)
- Account access → Password hashing: verifies passwords (evidence: `src/VoitureSaada.Web/Controllers/AccountController.cs`)
- Vehicle catalog → Web database access: queries vehicles (evidence: `src/VoitureSaada.Web/Controllers/HomeController.cs`)
- Collections → Web database access: queries collections (evidence: `src/VoitureSaada.Web/Controllers/CollectionsController.cs`)
- Collections → Collection model: creates models (evidence: `src/VoitureSaada.Web/Controllers/CollectionsController.cs`)
- Booking confirmation → Web database access: reads and writes (evidence: `src/VoitureSaada.Web/Controllers/ReservationController.cs`)
- Booking confirmation → Password hashing: verifies password (evidence: `src/VoitureSaada.Web/Controllers/ReservationController.cs`)
- Booking confirmation → PDF and QR receipt: generates receipt (evidence: `src/VoitureSaada.Web/Controllers/ReservationController.cs`)
- PDF and QR receipt → Receipt files: writes PDF (evidence: `src/VoitureSaada.Web/Controllers/ReservationController.cs`)
- Administrator → Admin sign-in: signs in
- User dashboard → Admin database access: loads dashboard data (evidence: `src/VoitureSaada.Monitoring/Views/UserDashboardView.xaml.cs`)
- Collection management → Admin database access: manages collections (evidence: `src/VoitureSaada.Monitoring/Views/CollectionsView.xaml.cs`)
- MVC application → Web database access: registers service (evidence: `src/VoitureSaada.Web/Program.cs`)
- Web database access → SQL Server: uses SQL database (evidence: `README.md`)
- Admin database access → SQL Server: uses SQL database (evidence: `README.md`)
- Customer → My reservations: views bookings (evidence: `README.md`)
- Customer → Documents: accesses documents (evidence: `README.md`)
- Customer → Payments: uses payments (evidence: `README.md`)
