# medkhmk/autoloc-backend architecture

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

- Interactive diagram: https://gitdiagram.com/medkhmk/autoloc-backend
- Repository: https://github.com/medkhmk/autoloc-backend

## Overview

AutoLoc is a Spring-based vehicle-rental application with both a client-facing web flow and a reservation API. In the web flow, clients browse vehicles, optionally filter by category, and submit a rental; the application finds or creates the client, saves a reservation, and marks the vehicle rented. The API also supports creating, cancelling, and completing reservations. The graph reflects the sampled controller, service, repository, and entity relationships; dashboard, security, and other controller capabilities are included, but unsampled implementation details are not inferred.

Main entry points: [`src/main/java/fr/ece/autoloc_api/repository`](https://github.com/medkhmk/autoloc-backend/tree/master/src/main/java/fr/ece/autoloc_api/repository) (JPA repositories), [`src/main/java/fr/ece/autoloc_api/web/controller/VehiculeController.java`](https://github.com/medkhmk/autoloc-backend/blob/master/src/main/java/fr/ece/autoloc_api/web/controller/VehiculeController.java) (Web rental controller), [`src/main/java/fr/ece/autoloc_api/service/VehiculeService.java`](https://github.com/medkhmk/autoloc-backend/blob/master/src/main/java/fr/ece/autoloc_api/service/VehiculeService.java) (Vehicle service), [`src/main/java/fr/ece/autoloc_api/web/controller/ReservationApiController.java`](https://github.com/medkhmk/autoloc-backend/blob/master/src/main/java/fr/ece/autoloc_api/web/controller/ReservationApiController.java) (Reservation API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client_flow["Client rental"]
  node_web_rental["Web rental controller"]
  node_vehicle_service["Vehicle service"]
end

subgraph group_reservation_api["Reservation API"]
  node_reservation_client["Reservation API"]
end

subgraph group_domain_data["Rental domain"]
  node_repositories["JPA repositories"]
  node_rental_entities["Rental entities"]
  node_initializer["Vehicle data initializer"]
end

subgraph group_application_views["Application views"]
  node_dashboard["Dashboard"]
  node_stats["Statistics"]
  node_security["Security configuration"]
  node_other_controllers["Other controllers"]
end

node_client(("Client"))

node_client -->|"browses and rents"| node_web_rental
node_web_rental -->|"queries and saves"| node_vehicle_service
node_web_rental -->|"reads and writes"| node_repositories
node_vehicle_service -->|"queries and saves"| node_repositories
node_reservation_client -->|"reads and writes"| node_repositories
node_initializer -->|"seeds vehicles"| node_repositories
node_dashboard -->|"reads rental data"| node_repositories

click node_web_rental "https://github.com/medkhmk/autoloc-backend/blob/master/src/main/java/fr/ece/autoloc_api/web/controller/VehiculeController.java"
click node_vehicle_service "https://github.com/medkhmk/autoloc-backend/blob/master/src/main/java/fr/ece/autoloc_api/service/VehiculeService.java"
click node_reservation_client "https://github.com/medkhmk/autoloc-backend/blob/master/src/main/java/fr/ece/autoloc_api/web/controller/ReservationApiController.java"
click node_repositories "https://github.com/medkhmk/autoloc-backend/tree/master/src/main/java/fr/ece/autoloc_api/repository"
click node_rental_entities "https://github.com/medkhmk/autoloc-backend/tree/master/src/main/java/fr/ece/autoloc_api/domain"
click node_dashboard "https://github.com/medkhmk/autoloc-backend/blob/master/src/main/java/fr/ece/autoloc_api/web/controller/DashboardController.java"
click node_stats "https://github.com/medkhmk/autoloc-backend/blob/master/src/main/java/fr/ece/autoloc_api/web/controller/StatsController.java"
click node_security "https://github.com/medkhmk/autoloc-backend/blob/master/src/main/java/fr/ece/autoloc_api/config/SecurityConfig.java"
click node_other_controllers "https://github.com/medkhmk/autoloc-backend/tree/master/src/main/java/fr/ece/autoloc_api/web/controller"
click node_initializer "https://github.com/medkhmk/autoloc-backend/blob/master/src/main/java/fr/ece/autoloc_api/DataInitializer.java"

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_rental,node_vehicle_service,node_client toneBlue
class node_reservation_client toneAmber
class node_repositories,node_rental_entities,node_initializer toneMint
class node_dashboard,node_stats,node_security,node_other_controllers toneRose
```

## Components

### Client rental

- [Web rental controller](https://github.com/medkhmk/autoloc-backend/blob/master/src/main/java/fr/ece/autoloc_api/web/controller/VehiculeController.java): `src/main/java/fr/ece/autoloc_api/web/controller/VehiculeController.java`
- [Vehicle service](https://github.com/medkhmk/autoloc-backend/blob/master/src/main/java/fr/ece/autoloc_api/service/VehiculeService.java): `src/main/java/fr/ece/autoloc_api/service/VehiculeService.java`

### Reservation API

- [Reservation API](https://github.com/medkhmk/autoloc-backend/blob/master/src/main/java/fr/ece/autoloc_api/web/controller/ReservationApiController.java): `src/main/java/fr/ece/autoloc_api/web/controller/ReservationApiController.java`

### Rental domain

- [JPA repositories](https://github.com/medkhmk/autoloc-backend/tree/master/src/main/java/fr/ece/autoloc_api/repository): `src/main/java/fr/ece/autoloc_api/repository`
- [Rental entities](https://github.com/medkhmk/autoloc-backend/tree/master/src/main/java/fr/ece/autoloc_api/domain): `src/main/java/fr/ece/autoloc_api/domain`
- [Vehicle data initializer](https://github.com/medkhmk/autoloc-backend/blob/master/src/main/java/fr/ece/autoloc_api/DataInitializer.java): `src/main/java/fr/ece/autoloc_api/DataInitializer.java`

### Application views

- [Dashboard](https://github.com/medkhmk/autoloc-backend/blob/master/src/main/java/fr/ece/autoloc_api/web/controller/DashboardController.java): `src/main/java/fr/ece/autoloc_api/web/controller/DashboardController.java`
- [Statistics](https://github.com/medkhmk/autoloc-backend/blob/master/src/main/java/fr/ece/autoloc_api/web/controller/StatsController.java): `src/main/java/fr/ece/autoloc_api/web/controller/StatsController.java`
- [Security configuration](https://github.com/medkhmk/autoloc-backend/blob/master/src/main/java/fr/ece/autoloc_api/config/SecurityConfig.java): `src/main/java/fr/ece/autoloc_api/config/SecurityConfig.java`
- [Other controllers](https://github.com/medkhmk/autoloc-backend/tree/master/src/main/java/fr/ece/autoloc_api/web/controller): `src/main/java/fr/ece/autoloc_api/web/controller`

### Other components

- **Client**

## Connections

- Client → Web rental controller: browses and rents (evidence: `src/main/java/fr/ece/autoloc_api/web/controller/VehiculeController.java`)
- Web rental controller → Vehicle service: queries and saves (evidence: `src/main/java/fr/ece/autoloc_api/web/controller/VehiculeController.java`)
- Web rental controller → JPA repositories: reads and writes (evidence: `src/main/java/fr/ece/autoloc_api/web/controller/VehiculeController.java`)
- Vehicle service → JPA repositories: queries and saves (evidence: `src/main/java/fr/ece/autoloc_api/service/VehiculeService.java`)
- Reservation API → JPA repositories: reads and writes (evidence: `src/main/java/fr/ece/autoloc_api/web/controller/ReservationApiController.java`)
- Vehicle data initializer → JPA repositories: seeds vehicles (evidence: `src/main/java/fr/ece/autoloc_api/DataInitializer.java`)
- Dashboard → JPA repositories: reads rental data (evidence: `src/main/java/fr/ece/autoloc_api/web/controller/DashboardController.java`)
