# abdelilaherretby/projet_location_voiture architecture

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

- Interactive diagram: https://gitdiagram.com/abdelilaherretby/projet_location_voiture
- Repository: https://github.com/abdelilaherretby/projet_location_voiture

## Overview

This is a car-rental marketplace with client and agency accounts, vehicle listings, booking, reservation management, billing, and reservation history. The main workflow runs from browsing cars through booking and agency confirmation/return handling, with client and agency profile areas for managing activity. The graph preserves the documented frontend and backend domains; some frontend-to-API wiring and unsampled feature internals are not shown in the available evidence, so those connections are omitted.

Main entry points: [`Frontend/src/App.tsx`](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Frontend/src/App.tsx) (Web app routes), [`Backend/config/db.js`](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/config/db.js) (MySQL connection), [`Backend/Controllers/reservationcontroller.js`](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Controllers/reservationcontroller.js) (Reservation lifecycle), [`Backend/routes/reservationRoutes.js`](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/routes/reservationRoutes.js) (Reservation routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_web_app["Web app routes<br/>[App.tsx]"]
  node_discovery["Car discovery"]
  node_home_experience["Home experience<br/>[Home.tsx]"]
  node_booking_ui["Booking flow<br/>[booking_page.tsx]"]
  node_client_portal["Client portal<br/>[Client_profile.tsx]"]
  node_agency_portal["Agency portal<br/>[Agence_profile.tsx]"]
end

subgraph group_identity["Accounts and access"]
  node_client_login["Client login<br/>[Login_client.tsx]"]
  node_agency_login["Agency login<br/>[Login_agence.tsx]"]
  node_api_server["API server<br/>[server.js]"]
  node_auth["JWT authentication<br/>[authMidleware.js]"]
  node_client_accounts["Client accounts"]
  node_agency_accounts["Agency accounts"]
end

subgraph group_rental["Rental operations"]
  node_vehicle_management["Vehicle management"]
  node_announcements["Car announcements"]
  node_reservations["Reservation lifecycle"]
  node_reservation_routes["Reservation routes"]
end

subgraph group_records["Rental records"]
  node_reservation_history["Reservation history"]
  node_invoicing["Invoicing"]
  node_mysql[("MySQL connection<br/>[db.js]")]
  node_client_store["Client data model<br/>[clientmodel.js]"]
  node_agency_store["Agency data model<br/>[agencemodel.js]"]
  node_reservation_store["Reservation data model"]
  node_history_store["History data model"]
  node_invoice_store["Invoice data model<br/>[facturemodel.js]"]
  node_vehicle_store["Vehicle data model<br/>[voituremodel.js]"]
end

node_renter(("Renter"))
node_agency_user(("Agency user"))

node_renter -->|"opens"| node_web_app
node_agency_user -->|"opens"| node_web_app
node_web_app -->|"routes to"| node_home_experience
node_web_app -->|"routes to"| node_discovery
node_web_app -->|"routes to"| node_booking_ui
node_web_app -->|"routes to"| node_client_login
node_web_app -->|"routes to"| node_agency_login
node_web_app -->|"routes to"| node_client_portal
node_web_app -->|"routes to"| node_agency_portal
node_client_portal -.-> node_client_accounts
node_agency_portal -.-> node_agency_accounts
node_api_server -->|"mounts"| node_reservation_routes
node_reservation_routes -->|"dispatches"| node_reservations
node_reservation_routes -->|"protects routes"| node_auth
node_reservations -->|"calls"| node_reservation_store
node_client_accounts -->|"calls"| node_client_store
node_agency_accounts -->|"calls"| node_agency_store
node_vehicle_management -->|"calls"| node_vehicle_store
node_reservations -.->|"uses"| node_vehicle_store
node_reservation_history -->|"calls"| node_history_store
node_invoicing -->|"calls"| node_invoice_store
node_client_store -->|"queries"| node_mysql
node_agency_store -->|"queries"| node_mysql
node_reservation_store -->|"queries"| node_mysql
node_history_store -->|"queries"| node_mysql
node_invoice_store -->|"queries"| node_mysql
node_vehicle_store -->|"queries"| node_mysql

click node_web_app "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Frontend/src/App.tsx"
click node_discovery "https://github.com/abdelilaherretby/projet_location_voiture/tree/main/Frontend/src/components/About"
click node_home_experience "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Frontend/src/pages/Home.tsx"
click node_booking_ui "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Frontend/src/pages/booking_page.tsx"
click node_client_portal "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Frontend/src/pages/Client_profile.tsx"
click node_agency_portal "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Frontend/src/pages/Agence_profile.tsx"
click node_client_login "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Frontend/src/pages/Login_client.tsx"
click node_agency_login "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Frontend/src/pages/Login_agence.tsx"
click node_api_server "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/server.js"
click node_auth "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Middlewares/authMidleware.js"
click node_client_accounts "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Controllers/clientcontroller.js"
click node_agency_accounts "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Controllers/agencecontroller.js"
click node_vehicle_management "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Controllers/voiturecontroller.js"
click node_announcements "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Controllers/annoncecontroller.js"
click node_reservations "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Controllers/reservationcontroller.js"
click node_reservation_routes "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/routes/reservationRoutes.js"
click node_reservation_history "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Controllers/reservationhistorycontroller.js"
click node_invoicing "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Controllers/facturecontroller.js"
click node_mysql "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/config/db.js"
click node_client_store "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Models/clientmodel.js"
click node_agency_store "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Models/agencemodel.js"
click node_reservation_store "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Models/reservationmodel.js"
click node_history_store "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Models/reservationhistorymodel.js"
click node_invoice_store "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Models/facturemodel.js"
click node_vehicle_store "https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Models/voituremodel.js"

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_web_app,node_discovery,node_home_experience,node_booking_ui,node_client_portal,node_agency_portal,node_agency_user toneBlue
class node_client_login,node_agency_login,node_api_server,node_auth,node_client_accounts,node_agency_accounts toneAmber
class node_vehicle_management,node_announcements,node_reservations,node_reservation_routes toneMint
class node_reservation_history,node_invoicing,node_mysql,node_client_store,node_agency_store,node_reservation_store,node_history_store,node_invoice_store,node_vehicle_store toneRose
class node_renter toneIndigo
```

## Components

### Frontend experience

- [Web app routes](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Frontend/src/App.tsx): `Frontend/src/App.tsx`
- [Car discovery](https://github.com/abdelilaherretby/projet_location_voiture/tree/main/Frontend/src/components/About): `Frontend/src/components/About`
- [Home experience](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Frontend/src/pages/Home.tsx): `Frontend/src/pages/Home.tsx`
- [Booking flow](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Frontend/src/pages/booking_page.tsx): `Frontend/src/pages/booking_page.tsx`
- [Client portal](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Frontend/src/pages/Client_profile.tsx): `Frontend/src/pages/Client_profile.tsx`
- [Agency portal](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Frontend/src/pages/Agence_profile.tsx): `Frontend/src/pages/Agence_profile.tsx`

### Accounts and access

- [Client login](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Frontend/src/pages/Login_client.tsx): `Frontend/src/pages/Login_client.tsx`
- [Agency login](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Frontend/src/pages/Login_agence.tsx): `Frontend/src/pages/Login_agence.tsx`
- [API server](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/server.js): `Backend/server.js`
- [JWT authentication](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Middlewares/authMidleware.js): `Backend/Middlewares/authMidleware.js`
- [Client accounts](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Controllers/clientcontroller.js): `Backend/Controllers/clientcontroller.js`
- [Agency accounts](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Controllers/agencecontroller.js): `Backend/Controllers/agencecontroller.js`

### Rental operations

- [Vehicle management](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Controllers/voiturecontroller.js): `Backend/Controllers/voiturecontroller.js`
- [Car announcements](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Controllers/annoncecontroller.js): `Backend/Controllers/annoncecontroller.js`
- [Reservation lifecycle](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Controllers/reservationcontroller.js): `Backend/Controllers/reservationcontroller.js`
- [Reservation routes](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/routes/reservationRoutes.js): `Backend/routes/reservationRoutes.js`

### Rental records

- [Reservation history](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Controllers/reservationhistorycontroller.js): `Backend/Controllers/reservationhistorycontroller.js`
- [Invoicing](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Controllers/facturecontroller.js): `Backend/Controllers/facturecontroller.js`
- [MySQL connection](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/config/db.js): `Backend/config/db.js`
- [Client data model](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Models/clientmodel.js): `Backend/Models/clientmodel.js`
- [Agency data model](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Models/agencemodel.js): `Backend/Models/agencemodel.js`
- [Reservation data model](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Models/reservationmodel.js): `Backend/Models/reservationmodel.js`
- [History data model](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Models/reservationhistorymodel.js): `Backend/Models/reservationhistorymodel.js`
- [Invoice data model](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Models/facturemodel.js): `Backend/Models/facturemodel.js`
- [Vehicle data model](https://github.com/abdelilaherretby/projet_location_voiture/blob/main/Backend/Models/voituremodel.js): `Backend/Models/voituremodel.js`

### Other components

- **Renter**
- **Agency user**

## Connections

- Renter → Web app routes: opens (evidence: `Frontend/src/App.tsx`)
- Agency user → Web app routes: opens (evidence: `Frontend/src/App.tsx`)
- Web app routes → Home experience: routes to (evidence: `Frontend/src/App.tsx`)
- Web app routes → Car discovery: routes to (evidence: `Frontend/src/App.tsx`)
- Web app routes → Booking flow: routes to (evidence: `Frontend/src/App.tsx`)
- Web app routes → Client login: routes to (evidence: `Frontend/src/App.tsx`)
- Web app routes → Agency login: routes to (evidence: `Frontend/src/App.tsx`)
- Web app routes → Client portal: routes to (evidence: `Frontend/src/App.tsx`)
- Web app routes → Agency portal: routes to (evidence: `Frontend/src/App.tsx`)
- Client portal → Client accounts
- Agency portal → Agency accounts
- API server → Reservation routes: mounts (evidence: `Backend/server.js`)
- Reservation routes → Reservation lifecycle: dispatches (evidence: `Backend/routes/reservationRoutes.js`)
- Reservation routes → JWT authentication: protects routes (evidence: `Backend/routes/reservationRoutes.js`)
- Reservation lifecycle → Reservation data model: calls (evidence: `Backend/Controllers/reservationcontroller.js`)
- Client accounts → Client data model: calls (evidence: `Backend/Controllers/clientcontroller.js`)
- Agency accounts → Agency data model: calls (evidence: `Backend/Controllers/agencecontroller.js`)
- Vehicle management → Vehicle data model: calls (evidence: `Backend/Controllers/voiturecontroller.js`)
- Reservation lifecycle → Vehicle data model: uses
- Reservation history → History data model: calls (evidence: `Backend/Controllers/reservationhistorycontroller.js`)
- Invoicing → Invoice data model: calls (evidence: `Backend/Controllers/facturecontroller.js`)
- Client data model → MySQL connection: queries (evidence: `Backend/Models/clientmodel.js`)
- Agency data model → MySQL connection: queries (evidence: `Backend/Models/agencemodel.js`)
- Reservation data model → MySQL connection: queries (evidence: `Backend/Models/reservationmodel.js`)
- History data model → MySQL connection: queries (evidence: `Backend/Models/reservationhistorymodel.js`)
- Invoice data model → MySQL connection: queries (evidence: `Backend/Models/facturemodel.js`)
- Vehicle data model → MySQL connection: queries (evidence: `Backend/Models/voituremodel.js`)
