# glavyanov/carhire architecture

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

- Interactive diagram: https://gitdiagram.com/glavyanov/carhire
- Repository: https://github.com/glavyanov/carhire

## Overview

CarHire is an ASP.NET vehicle-rental application: users register, browse vehicles by category or collection, inspect vehicle details and renter comments, submit rental details, and later return rented vehicles. Separate management and administration areas support catalog updates, comments, discounts, and role assignment. The graph follows the documented workflows and the sampled service/repository code; several controller and service implementations are listed in the tree but were not excerpted, so those links rely on README statements or are omitted where ownership is unclear.

Main entry points: [`CarHire.Infrastructure/Data/Common/Repository.cs`](https://github.com/glavyanov/carhire/blob/main/CarHire.Infrastructure/Data/Common/Repository.cs) (Repository access), [`CarHire.Core/Services/VehicleService.cs`](https://github.com/glavyanov/carhire/blob/main/CarHire.Core/Services/VehicleService.cs) (Vehicle service), [`CarHire/Controllers/VehiclesController.cs`](https://github.com/glavyanov/carhire/blob/main/CarHire/Controllers/VehiclesController.cs) (Public web), [`CarHire/Controllers/CommentController.cs`](https://github.com/glavyanov/carhire/blob/main/CarHire/Controllers/CommentController.cs) (Renter comments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_rental["Rental experience"]
  node_public_web["Public web"]
  node_vehicle_catalog["Vehicle catalog<br/>[VehicleService.cs]"]
  node_vehicle_detail["Vehicle details"]
  node_comments["Renter comments"]
  node_rent_workflow["Rental and return<br/>[RentController.cs]"]
end

subgraph group_catalog["Catalog management"]
  node_manager_area["Manager area<br/>[HomeController.cs]"]
  node_category_admin["Category management"]
  node_discount_admin["Discount management"]
end

subgraph group_access["Identity and access"]
  node_user_account["User accounts<br/>[UserController.cs]"]
  node_admin_roles["Role administration<br/>[RoleController.cs]"]
end

subgraph group_services["Domain services"]
  node_category_service["Category service<br/>[CategoryService.cs]"]
  node_vehicle_service["Vehicle service<br/>[VehicleService.cs]"]
  node_rent_service["Rent service<br/>[RentService.cs]"]
  node_comment_service["Comment service<br/>[CommentService.cs]"]
  node_discount_service["Discount service<br/>[DiscountService.cs]"]
  node_user_service["User service<br/>[UserService.cs]"]
end

subgraph group_persistence["Persistence"]
  node_repository["Repository access<br/>[Repository.cs]"]
  node_db_context["EF data context"]
  node_sql_database[("Application database")]
end

node_renter(("Renter"))

node_renter -->|"browses"| node_public_web
node_public_web -->|"lists vehicles"| node_vehicle_catalog
node_renter -->|"views details"| node_vehicle_detail
node_renter -->|"views comments"| node_comments
node_renter -->|"rents and returns"| node_rent_workflow
node_renter -->|"registers"| node_user_account
node_admin_roles -->|"manages roles"| node_user_service
node_manager_area -->|"edits vehicles"| node_vehicle_service
node_category_admin -->|"manages categories"| node_category_service
node_discount_admin -->|"manages discounts"| node_discount_service
node_vehicle_detail -->|"loads details"| node_vehicle_service
node_comments -->|"loads comments"| node_comment_service
node_rent_workflow -->|"processes rental"| node_rent_service
node_vehicle_service -->|"queries and saves"| node_repository
node_rent_service -->|"queries and saves"| node_repository
node_discount_service -->|"queries and saves"| node_repository
node_repository -->|"uses context"| node_db_context
node_db_context -.->|"persists entities"| node_sql_database

click node_public_web "https://github.com/glavyanov/carhire/blob/main/CarHire/Controllers/VehiclesController.cs"
click node_vehicle_catalog "https://github.com/glavyanov/carhire/blob/main/CarHire.Core/Services/VehicleService.cs"
click node_vehicle_detail "https://github.com/glavyanov/carhire/blob/main/CarHire/Controllers/VehiclesController.cs"
click node_comments "https://github.com/glavyanov/carhire/blob/main/CarHire/Controllers/CommentController.cs"
click node_rent_workflow "https://github.com/glavyanov/carhire/blob/main/CarHire/Controllers/RentController.cs"
click node_user_account "https://github.com/glavyanov/carhire/blob/main/CarHire/Controllers/UserController.cs"
click node_admin_roles "https://github.com/glavyanov/carhire/blob/main/CarHire/Areas/Administration/Controllers/RoleController.cs"
click node_manager_area "https://github.com/glavyanov/carhire/blob/main/CarHire/Areas/Management/Controllers/HomeController.cs"
click node_category_admin "https://github.com/glavyanov/carhire/blob/main/CarHire/Areas/Management/Controllers/CategoryController.cs"
click node_discount_admin "https://github.com/glavyanov/carhire/blob/main/CarHire/Areas/Management/Controllers/DiscountController.cs"
click node_category_service "https://github.com/glavyanov/carhire/blob/main/CarHire.Core/Services/CategoryService.cs"
click node_vehicle_service "https://github.com/glavyanov/carhire/blob/main/CarHire.Core/Services/VehicleService.cs"
click node_rent_service "https://github.com/glavyanov/carhire/blob/main/CarHire.Core/Services/RentService.cs"
click node_comment_service "https://github.com/glavyanov/carhire/blob/main/CarHire.Core/Services/CommentService.cs"
click node_discount_service "https://github.com/glavyanov/carhire/blob/main/CarHire.Core/Services/DiscountService.cs"
click node_user_service "https://github.com/glavyanov/carhire/blob/main/CarHire.Core/Services/UserService.cs"
click node_repository "https://github.com/glavyanov/carhire/blob/main/CarHire.Infrastructure/Data/Common/Repository.cs"
click node_db_context "https://github.com/glavyanov/carhire/blob/main/CarHire.Infrastructure/Data/ApplicationDbContext.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_public_web,node_vehicle_catalog,node_vehicle_detail,node_comments,node_rent_workflow toneBlue
class node_manager_area,node_category_admin,node_discount_admin toneAmber
class node_user_account,node_admin_roles toneMint
class node_category_service,node_vehicle_service,node_rent_service,node_comment_service,node_discount_service,node_user_service toneRose
class node_repository,node_db_context,node_sql_database,node_renter toneIndigo
```

## Components

### Rental experience

- [Public web](https://github.com/glavyanov/carhire/blob/main/CarHire/Controllers/VehiclesController.cs): `CarHire/Controllers/VehiclesController.cs`
- [Vehicle catalog](https://github.com/glavyanov/carhire/blob/main/CarHire.Core/Services/VehicleService.cs): `CarHire.Core/Services/VehicleService.cs`
- [Vehicle details](https://github.com/glavyanov/carhire/blob/main/CarHire/Controllers/VehiclesController.cs): `CarHire/Controllers/VehiclesController.cs`
- [Renter comments](https://github.com/glavyanov/carhire/blob/main/CarHire/Controllers/CommentController.cs): `CarHire/Controllers/CommentController.cs`
- [Rental and return](https://github.com/glavyanov/carhire/blob/main/CarHire/Controllers/RentController.cs): `CarHire/Controllers/RentController.cs`

### Catalog management

- [Manager area](https://github.com/glavyanov/carhire/blob/main/CarHire/Areas/Management/Controllers/HomeController.cs): `CarHire/Areas/Management/Controllers/HomeController.cs`
- [Category management](https://github.com/glavyanov/carhire/blob/main/CarHire/Areas/Management/Controllers/CategoryController.cs): `CarHire/Areas/Management/Controllers/CategoryController.cs`
- [Discount management](https://github.com/glavyanov/carhire/blob/main/CarHire/Areas/Management/Controllers/DiscountController.cs): `CarHire/Areas/Management/Controllers/DiscountController.cs`

### Identity and access

- [User accounts](https://github.com/glavyanov/carhire/blob/main/CarHire/Controllers/UserController.cs): `CarHire/Controllers/UserController.cs`
- [Role administration](https://github.com/glavyanov/carhire/blob/main/CarHire/Areas/Administration/Controllers/RoleController.cs): `CarHire/Areas/Administration/Controllers/RoleController.cs`

### Domain services

- [Category service](https://github.com/glavyanov/carhire/blob/main/CarHire.Core/Services/CategoryService.cs): `CarHire.Core/Services/CategoryService.cs`
- [Vehicle service](https://github.com/glavyanov/carhire/blob/main/CarHire.Core/Services/VehicleService.cs): `CarHire.Core/Services/VehicleService.cs`
- [Rent service](https://github.com/glavyanov/carhire/blob/main/CarHire.Core/Services/RentService.cs): `CarHire.Core/Services/RentService.cs`
- [Comment service](https://github.com/glavyanov/carhire/blob/main/CarHire.Core/Services/CommentService.cs): `CarHire.Core/Services/CommentService.cs`
- [Discount service](https://github.com/glavyanov/carhire/blob/main/CarHire.Core/Services/DiscountService.cs): `CarHire.Core/Services/DiscountService.cs`
- [User service](https://github.com/glavyanov/carhire/blob/main/CarHire.Core/Services/UserService.cs): `CarHire.Core/Services/UserService.cs`

### Persistence

- [Repository access](https://github.com/glavyanov/carhire/blob/main/CarHire.Infrastructure/Data/Common/Repository.cs): `CarHire.Infrastructure/Data/Common/Repository.cs`
- [EF data context](https://github.com/glavyanov/carhire/blob/main/CarHire.Infrastructure/Data/ApplicationDbContext.cs): `CarHire.Infrastructure/Data/ApplicationDbContext.cs`
- **Application database**

### Other components

- **Renter**

## Connections

- Renter → Public web: browses (evidence: `README.md`)
- Public web → Vehicle catalog: lists vehicles (evidence: `CarHire/Controllers/VehiclesController.cs`)
- Renter → Vehicle details: views details (evidence: `README.md`)
- Renter → Renter comments: views comments (evidence: `README.md`)
- Renter → Rental and return: rents and returns (evidence: `README.md`)
- Renter → User accounts: registers (evidence: `README.md`)
- Role administration → User service: manages roles (evidence: `CarHire/Areas/Administration/Controllers/RoleController.cs`)
- Manager area → Vehicle service: edits vehicles (evidence: `CarHire/Areas/Management/Controllers/HomeController.cs`)
- Category management → Category service: manages categories (evidence: `CarHire/Areas/Management/Controllers/CategoryController.cs`)
- Discount management → Discount service: manages discounts (evidence: `CarHire/Areas/Management/Controllers/DiscountController.cs`)
- Vehicle details → Vehicle service: loads details (evidence: `CarHire/Controllers/VehiclesController.cs`)
- Renter comments → Comment service: loads comments (evidence: `CarHire/Controllers/CommentController.cs`)
- Rental and return → Rent service: processes rental (evidence: `CarHire/Controllers/RentController.cs`)
- Vehicle service → Repository access: queries and saves (evidence: `CarHire.Core/Services/VehicleService.cs`)
- Rent service → Repository access: queries and saves (evidence: `CarHire.Core/Services/RentService.cs`)
- Discount service → Repository access: queries and saves (evidence: `CarHire.Core/Services/DiscountService.cs`)
- Repository access → EF data context: uses context (evidence: `CarHire.Infrastructure/Data/Common/Repository.cs`)
- EF data context → Application database: persists entities
