# marcisebestyen/berauto architecture

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

- Interactive diagram: https://gitdiagram.com/marcisebestyen/berauto
- Repository: https://github.com/marcisebestyen/berauto

## Overview

Berauto is a car-rental application with a React frontend and ASP.NET backend. Renters browse cars, authenticate, book rentals and view receipts; staff handle rentals and vehicle handovers, while administrators manage cars and review dashboards. The backend includes rental, user, fleet, depot, receipt, FAQ and statistics capabilities, backed by a relational data model. The excerpts show frontend routing, authentication and some rental/staff operations; many connections between backend controllers and services, and frontend-to-backend HTTP wiring, are not shown, so those links are omitted or marked unverified.

Main entry points: [`FrontEnd/berauto/src/routing/Routes.tsx`](https://github.com/marcisebestyen/berauto/blob/main/FrontEnd/berauto/src/routing/Routes.tsx) (Role-based routes), [`Beruato/Database/Data/BerautoDbContext.cs`](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Database/Data/BerautoDbContext.cs) (Rental database context), [`FrontEnd/berauto/src/api/api.ts`](https://github.com/marcisebestyen/berauto/blob/main/FrontEnd/berauto/src/api/api.ts) (API client), [`Beruato/Database/Models/Rent.cs`](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Database/Models/Rent.cs) (Rental record)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["React app<br/>[App.tsx]"]
  node_routing["Role-based routes<br/>[Routes.tsx]"]
  node_auth["Auth state<br/>[useAuth.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_cars_ui["Car browsing<br/>[Cars.tsx]"]
  node_rentals_ui["Rental operations"]
  node_dashboard_ui["Renter dashboard<br/>[Dashboard.tsx]"]
  node_profile_ui["Profile<br/>[ProfilePage.tsx]"]
  node_booking_ui["Booking dialog<br/>[BookingModal.tsx]"]
end

subgraph group_api["Rental API"]
  node_car_api["Car endpoints<br/>[CarController.cs]"]
  node_rent_api["Rental endpoints<br/>[RentController.cs]"]
  node_user_api["User endpoints<br/>[UserController.cs]"]
  node_staff_api["Staff endpoints<br/>[StaffController.cs]"]
  node_receipt_api["Receipt endpoints"]
  node_statistics_api["Statistics endpoints"]
  node_faq_api["FAQ endpoints<br/>[FaqController.cs]"]
end

subgraph group_domain["Rental domain"]
  node_rent_service["Rental and queue logic<br/>[RentService.cs]"]
  node_staff_service["Staff handovers<br/>[StaffService.cs]"]
  node_user_service["User accounts<br/>[UserService.cs]"]
  node_car_service["Fleet management<br/>[CarService.cs]"]
  node_depot_service["Depot management<br/>[DepotService.cs]"]
  node_receipt_service["Receipt handling<br/>[ReceiptService.cs]"]
  node_invoice_pdf["Invoice PDF"]
  node_faq_service["FAQ assistant<br/>[FaqService.cs]"]
  node_statistics_service["Rental statistics"]
end

subgraph group_storage["Persistence"]
  node_repository["Repository access<br/>[Repository.cs]"]
  node_unit_of_work["Unit of work<br/>[UnitOfWork.cs]"]
  node_db_context[("Rental database context")]
  node_rent_model["Rental record<br/>[Rent.cs]"]
  node_car_model["Car record<br/>[Car.cs]"]
  node_user_model["User record<br/>[User.cs]"]
  node_receipt_model["Receipt record<br/>[Receipt.cs]"]
  node_waiting_model["Waiting list record<br/>[WaitingList.cs]"]
end

node_renter(("Renter or staff"))

node_renter -->|"uses"| node_app
node_app -->|"renders"| node_routing
node_routing -->|"routes to"| node_cars_ui
node_routing -->|"routes to"| node_rentals_ui
node_routing -->|"routes to"| node_dashboard_ui
node_routing -->|"routes to"| node_profile_ui
node_app -->|"provides"| node_auth
node_rentals_ui -->|"calls"| node_api_client
node_dashboard_ui -->|"calls"| node_api_client
node_rentals_ui -->|"uses"| node_auth
node_dashboard_ui -->|"uses"| node_auth
node_auth -.->|"sends login requests"| node_user_api
node_api_client -.->|"HTTP requests"| node_car_api
node_api_client -.->|"HTTP requests"| node_rent_api
node_api_client -.->|"HTTP requests"| node_statistics_api
node_rent_service -->|"uses"| node_unit_of_work
node_staff_service -->|"uses"| node_unit_of_work
node_staff_service -->|"creates receipts"| node_receipt_service
node_rent_service -.->|"uses"| node_user_service
node_rent_service -->|"updates queue"| node_waiting_model
node_repository -->|"uses"| node_db_context
node_db_context -->|"maps"| node_rent_model
node_db_context -->|"maps"| node_car_model
node_db_context -->|"maps"| node_user_model
node_db_context -->|"maps"| node_receipt_model
node_rent_model -->|"references"| node_car_model
node_rent_model -->|"references"| node_user_model
node_rent_model -->|"references"| node_receipt_model
node_car_model -->|"tracks"| node_waiting_model

click node_app "https://github.com/marcisebestyen/berauto/blob/main/FrontEnd/berauto/src/App.tsx"
click node_routing "https://github.com/marcisebestyen/berauto/blob/main/FrontEnd/berauto/src/routing/Routes.tsx"
click node_auth "https://github.com/marcisebestyen/berauto/blob/main/FrontEnd/berauto/src/hooks/useAuth.tsx"
click node_api_client "https://github.com/marcisebestyen/berauto/blob/main/FrontEnd/berauto/src/api/api.ts"
click node_cars_ui "https://github.com/marcisebestyen/berauto/blob/main/FrontEnd/berauto/src/pages/Cars.tsx"
click node_rentals_ui "https://github.com/marcisebestyen/berauto/blob/main/FrontEnd/berauto/src/pages/AdminRentalsPage.tsx"
click node_dashboard_ui "https://github.com/marcisebestyen/berauto/blob/main/FrontEnd/berauto/src/pages/Dashboard.tsx"
click node_profile_ui "https://github.com/marcisebestyen/berauto/blob/main/FrontEnd/berauto/src/pages/ProfilePage.tsx"
click node_booking_ui "https://github.com/marcisebestyen/berauto/blob/main/FrontEnd/berauto/src/modals/BookingModal.tsx"
click node_car_api "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Controllers/CarController.cs"
click node_rent_api "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Controllers/RentController.cs"
click node_user_api "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Controllers/UserController.cs"
click node_staff_api "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Controllers/StaffController.cs"
click node_receipt_api "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Controllers/ReceiptController.cs"
click node_statistics_api "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Controllers/StatisticsController.cs"
click node_faq_api "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Controllers/FaqController.cs"
click node_rent_service "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Services/RentService.cs"
click node_staff_service "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Services/StaffService.cs"
click node_user_service "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Services/UserService.cs"
click node_car_service "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Services/CarService.cs"
click node_depot_service "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Services/DepotService.cs"
click node_receipt_service "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Services/ReceiptService.cs"
click node_invoice_pdf "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Services/InvoicePdfService.cs"
click node_faq_service "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Services/FaqService.cs"
click node_statistics_service "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Services/StatisticService.cs"
click node_repository "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Repositories/Repository.cs"
click node_unit_of_work "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Repositories/UnitOfWork.cs"
click node_db_context "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Database/Data/BerautoDbContext.cs"
click node_rent_model "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Database/Models/Rent.cs"
click node_car_model "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Database/Models/Car.cs"
click node_user_model "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Database/Models/User.cs"
click node_receipt_model "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Database/Models/Receipt.cs"
click node_waiting_model "https://github.com/marcisebestyen/berauto/blob/main/Beruato/Database/Models/WaitingList.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_app,node_routing,node_auth,node_api_client,node_cars_ui,node_rentals_ui,node_dashboard_ui,node_profile_ui,node_booking_ui toneBlue
class node_car_api,node_rent_api,node_user_api,node_staff_api,node_receipt_api,node_statistics_api,node_faq_api toneAmber
class node_rent_service,node_staff_service,node_user_service,node_car_service,node_depot_service,node_receipt_service,node_invoice_pdf,node_faq_service,node_statistics_service toneMint
class node_repository,node_unit_of_work,node_db_context,node_rent_model,node_car_model,node_user_model,node_receipt_model,node_waiting_model toneRose
class node_renter toneIndigo
```

## Components

### Web application

- [React app](https://github.com/marcisebestyen/berauto/blob/main/FrontEnd/berauto/src/App.tsx): `FrontEnd/berauto/src/App.tsx`
- [Role-based routes](https://github.com/marcisebestyen/berauto/blob/main/FrontEnd/berauto/src/routing/Routes.tsx): `FrontEnd/berauto/src/routing/Routes.tsx`
- [Auth state](https://github.com/marcisebestyen/berauto/blob/main/FrontEnd/berauto/src/hooks/useAuth.tsx): `FrontEnd/berauto/src/hooks/useAuth.tsx`
- [API client](https://github.com/marcisebestyen/berauto/blob/main/FrontEnd/berauto/src/api/api.ts): `FrontEnd/berauto/src/api/api.ts`
- [Car browsing](https://github.com/marcisebestyen/berauto/blob/main/FrontEnd/berauto/src/pages/Cars.tsx): `FrontEnd/berauto/src/pages/Cars.tsx`
- [Rental operations](https://github.com/marcisebestyen/berauto/blob/main/FrontEnd/berauto/src/pages/AdminRentalsPage.tsx): `FrontEnd/berauto/src/pages/AdminRentalsPage.tsx`
- [Renter dashboard](https://github.com/marcisebestyen/berauto/blob/main/FrontEnd/berauto/src/pages/Dashboard.tsx): `FrontEnd/berauto/src/pages/Dashboard.tsx`
- [Profile](https://github.com/marcisebestyen/berauto/blob/main/FrontEnd/berauto/src/pages/ProfilePage.tsx): `FrontEnd/berauto/src/pages/ProfilePage.tsx`
- [Booking dialog](https://github.com/marcisebestyen/berauto/blob/main/FrontEnd/berauto/src/modals/BookingModal.tsx): `FrontEnd/berauto/src/modals/BookingModal.tsx`

### Rental API

- [Car endpoints](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Controllers/CarController.cs): `Beruato/Services/Controllers/CarController.cs`
- [Rental endpoints](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Controllers/RentController.cs): `Beruato/Services/Controllers/RentController.cs`
- [User endpoints](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Controllers/UserController.cs): `Beruato/Services/Controllers/UserController.cs`
- [Staff endpoints](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Controllers/StaffController.cs): `Beruato/Services/Controllers/StaffController.cs`
- [Receipt endpoints](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Controllers/ReceiptController.cs): `Beruato/Services/Controllers/ReceiptController.cs`
- [Statistics endpoints](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Controllers/StatisticsController.cs): `Beruato/Services/Controllers/StatisticsController.cs`
- [FAQ endpoints](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Controllers/FaqController.cs): `Beruato/Services/Controllers/FaqController.cs`

### Rental domain

- [Rental and queue logic](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Services/RentService.cs): `Beruato/Services/Services/RentService.cs`
- [Staff handovers](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Services/StaffService.cs): `Beruato/Services/Services/StaffService.cs`
- [User accounts](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Services/UserService.cs): `Beruato/Services/Services/UserService.cs`
- [Fleet management](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Services/CarService.cs): `Beruato/Services/Services/CarService.cs`
- [Depot management](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Services/DepotService.cs): `Beruato/Services/Services/DepotService.cs`
- [Receipt handling](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Services/ReceiptService.cs): `Beruato/Services/Services/ReceiptService.cs`
- [Invoice PDF](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Services/InvoicePdfService.cs): `Beruato/Services/Services/InvoicePdfService.cs`
- [FAQ assistant](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Services/FaqService.cs): `Beruato/Services/Services/FaqService.cs`
- [Rental statistics](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Services/StatisticService.cs): `Beruato/Services/Services/StatisticService.cs`

### Persistence

- [Repository access](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Repositories/Repository.cs): `Beruato/Services/Repositories/Repository.cs`
- [Unit of work](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Services/Repositories/UnitOfWork.cs): `Beruato/Services/Repositories/UnitOfWork.cs`
- [Rental database context](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Database/Data/BerautoDbContext.cs): `Beruato/Database/Data/BerautoDbContext.cs`
- [Rental record](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Database/Models/Rent.cs): `Beruato/Database/Models/Rent.cs`
- [Car record](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Database/Models/Car.cs): `Beruato/Database/Models/Car.cs`
- [User record](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Database/Models/User.cs): `Beruato/Database/Models/User.cs`
- [Receipt record](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Database/Models/Receipt.cs): `Beruato/Database/Models/Receipt.cs`
- [Waiting list record](https://github.com/marcisebestyen/berauto/blob/main/Beruato/Database/Models/WaitingList.cs): `Beruato/Database/Models/WaitingList.cs`

### Other components

- **Renter or staff**

## Connections

- Renter or staff → React app: uses (evidence: `FrontEnd/berauto/src/App.tsx`)
- React app → Role-based routes: renders (evidence: `FrontEnd/berauto/src/App.tsx`)
- Role-based routes → Car browsing: routes to (evidence: `FrontEnd/berauto/src/routing/Routes.tsx`)
- Role-based routes → Rental operations: routes to (evidence: `FrontEnd/berauto/src/routing/Routes.tsx`)
- Role-based routes → Renter dashboard: routes to (evidence: `FrontEnd/berauto/src/routing/Routes.tsx`)
- Role-based routes → Profile: routes to (evidence: `FrontEnd/berauto/src/routing/Routes.tsx`)
- React app → Auth state: provides (evidence: `FrontEnd/berauto/src/App.tsx`)
- Rental operations → API client: calls (evidence: `FrontEnd/berauto/src/pages/AdminRentalsPage.tsx`)
- Renter dashboard → API client: calls (evidence: `FrontEnd/berauto/src/pages/Dashboard.tsx`)
- Rental operations → Auth state: uses (evidence: `FrontEnd/berauto/src/pages/AdminRentalsPage.tsx`)
- Renter dashboard → Auth state: uses (evidence: `FrontEnd/berauto/src/pages/Dashboard.tsx`)
- Auth state → User endpoints: sends login requests
- API client → Car endpoints: HTTP requests
- API client → Rental endpoints: HTTP requests
- API client → Statistics endpoints: HTTP requests
- Rental and queue logic → Unit of work: uses (evidence: `Beruato/Services/Services/RentService.cs`)
- Staff handovers → Unit of work: uses (evidence: `Beruato/Services/Services/StaffService.cs`)
- Staff handovers → Receipt handling: creates receipts (evidence: `Beruato/Services/Services/StaffService.cs`)
- Rental and queue logic → User accounts: uses
- Rental and queue logic → Waiting list record: updates queue (evidence: `Beruato/Services/Services/RentService.cs`)
- Repository access → Rental database context: uses (evidence: `Beruato/Services/Repositories/Repository.cs`)
- Rental database context → Rental record: maps (evidence: `Beruato/Database/Data/BerautoDbContext.cs`)
- Rental database context → Car record: maps (evidence: `Beruato/Database/Data/BerautoDbContext.cs`)
- Rental database context → User record: maps (evidence: `Beruato/Database/Data/BerautoDbContext.cs`)
- Rental database context → Receipt record: maps (evidence: `Beruato/Database/Data/BerautoDbContext.cs`)
- Rental record → Car record: references (evidence: `Beruato/Database/Models/Rent.cs`)
- Rental record → User record: references (evidence: `Beruato/Database/Models/Rent.cs`)
- Rental record → Receipt record: references (evidence: `Beruato/Database/Models/Rent.cs`)
- Car record → Waiting list record: tracks (evidence: `Beruato/Database/Models/Car.cs`)
