# skander101/autoloc_api architecture

> Architecture diagram of the GitHub repository skander101/autoloc_api, 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/skander101/autoloc_api
- Repository: https://github.com/skander101/autoloc_api

## Overview

AutoLoc is a Spring Boot REST API for car rental management. Clients call resource controllers, which delegate CRUD operations to business services; services use Spring Data repositories backed by JPA domain entities. The model covers clients, vehicles and branches, reservations, contracts and payments, plus equipment, employees and maintenance. The README identifies MySQL as the database. The graph reflects the documented and indexed layers; unsampled controller and service implementations are represented at their exact enclosing directories.

Main entry points: [`src/main/java/tn/esprit/autoloc/repository`](https://github.com/skander101/autoloc_api/tree/main/src/main/java/tn/esprit/autoloc/repository) (Data repositories), [`src/main/java/tn/esprit/autoloc/web/controller`](https://github.com/skander101/autoloc_api/tree/main/src/main/java/tn/esprit/autoloc/web/controller) (Resource controllers), [`src/main/java/tn/esprit/autoloc/service`](https://github.com/skander101/autoloc_api/tree/main/src/main/java/tn/esprit/autoloc/service) (Business services), [`src/main/java/tn/esprit/autoloc/domain`](https://github.com/skander101/autoloc_api/tree/main/src/main/java/tn/esprit/autoloc/domain) (Rental domain)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["REST API"]
  node_controllers["Resource controllers"]
end

subgraph group_business["Rental Operations"]
  node_services["Business services"]
end

subgraph group_persistence["Persistence"]
  node_repositories["Data repositories"]
  node_domain["Rental domain"]
end

node_client(("API clients"))
node_mysql[("MySQL database")]

node_client -->|"sends requests"| node_controllers
node_controllers -->|"delegates operations"| node_services
node_services -->|"reads and writes"| node_repositories
node_repositories -->|"persists entities"| node_domain
node_repositories -.->|"stores data"| node_mysql

click node_controllers "https://github.com/skander101/autoloc_api/tree/main/src/main/java/tn/esprit/autoloc/web/controller"
click node_services "https://github.com/skander101/autoloc_api/tree/main/src/main/java/tn/esprit/autoloc/service"
click node_repositories "https://github.com/skander101/autoloc_api/tree/main/src/main/java/tn/esprit/autoloc/repository"
click node_domain "https://github.com/skander101/autoloc_api/tree/main/src/main/java/tn/esprit/autoloc/domain"

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_controllers,node_client toneBlue
class node_services,node_mysql toneAmber
class node_repositories,node_domain toneMint
```

## Components

### REST API

- [Resource controllers](https://github.com/skander101/autoloc_api/tree/main/src/main/java/tn/esprit/autoloc/web/controller): `src/main/java/tn/esprit/autoloc/web/controller`

### Rental Operations

- [Business services](https://github.com/skander101/autoloc_api/tree/main/src/main/java/tn/esprit/autoloc/service): `src/main/java/tn/esprit/autoloc/service`

### Persistence

- [Data repositories](https://github.com/skander101/autoloc_api/tree/main/src/main/java/tn/esprit/autoloc/repository): `src/main/java/tn/esprit/autoloc/repository`
- [Rental domain](https://github.com/skander101/autoloc_api/tree/main/src/main/java/tn/esprit/autoloc/domain): `src/main/java/tn/esprit/autoloc/domain`

### Other components

- **API clients**
- **MySQL database**

## Connections

- API clients → Resource controllers: sends requests (evidence: `src/main/java/tn/esprit/autoloc/web/controller/VehiculeController.java`)
- Resource controllers → Business services: delegates operations (evidence: `src/main/java/tn/esprit/autoloc/web/controller/VehiculeController.java`)
- Business services → Data repositories: reads and writes (evidence: `src/main/java/tn/esprit/autoloc/service/ReservationService.java`)
- Data repositories → Rental domain: persists entities (evidence: `src/main/java/tn/esprit/autoloc/repository/ReservationRepository.java`)
- Data repositories → MySQL database: stores data
