# hakazoki/bdd-symfony architecture

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

- Interactive diagram: https://gitdiagram.com/hakazoki/bdd-symfony
- Repository: https://github.com/hakazoki/bdd-symfony

## Overview

This Symfony application is a restaurant directory and review site. Visitors browse restaurants, optionally filter by city, and view ratings and comments; signed-in users can register, add restaurants, comment, and reply. The domain also supports region/city administration and restaurant edit/delete authorization. Controllers coordinate forms and persistence, while Doctrine entities and repositories model and query the domain. The graph reflects the sampled controllers and entities; unsampled routes, templates, and configuration are not expanded into unverified connections.

Main entry points: [`src/Controller/RestaurantController.php`](https://github.com/hakazoki/bdd-symfony/blob/master/src/Controller/RestaurantController.php) (Restaurant workflows), [`src/Entity/Restaurant.php`](https://github.com/hakazoki/bdd-symfony/blob/master/src/Entity/Restaurant.php) (Restaurant entity), [`src/Entity/Commentaire.php`](https://github.com/hakazoki/bdd-symfony/blob/master/src/Entity/Commentaire.php) (Comment entity), [`src/Entity/User.php`](https://github.com/hakazoki/bdd-symfony/blob/master/src/Entity/User.php) (User entity)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web workflows"]
  node_restaurants["Restaurant workflows"]
  node_comments["Comment workflows"]
  node_restaurant_form["Restaurant form<br/>[RestaurantType.php]"]
  node_comment_form["Comment form"]
end

subgraph group_identity["Identity and access"]
  node_registration["Registration workflow"]
  node_login["Login workflow"]
  node_registration_form["Registration form"]
  node_voter["Restaurant voter"]
end

subgraph group_geo["Location catalog"]
  node_regions["Region workflows"]
  node_cities["City workflows"]
  node_region_form["Region form<br/>[RegionType.php]"]
  node_city_form["City form<br/>[VilleType.php]"]
end

subgraph group_data["Domain and persistence"]
  node_restaurant_entity["Restaurant entity<br/>[Restaurant.php]"]
  node_comment_entity["Comment entity<br/>[Commentaire.php]"]
  node_user_entity["User entity<br/>[User.php]"]
  node_region_entity["Region entity<br/>[Region.php]"]
  node_city_entity["City entity<br/>[Ville.php]"]
  node_restaurant_repo["Restaurant repository"]
  node_comment_repo["Comment repository"]
  node_user_repo["User repository<br/>[UserRepository.php]"]
  node_region_repo["Region repository"]
  node_city_repo["City repository"]
end

node_visitor(("Visitor"))
node_member(("Signed-in member"))

node_visitor -->|"browses"| node_restaurants
node_member -->|"manages"| node_restaurants
node_member -->|"reviews"| node_comments
node_member -.->|"registers"| node_registration
node_visitor -.->|"signs in"| node_login
node_restaurants -->|"creates via"| node_restaurant_form
node_restaurants -->|"persists"| node_restaurant_entity
node_restaurants -->|"queries"| node_restaurant_repo
node_restaurants -->|"lists cities"| node_city_repo
node_restaurants -->|"checks access"| node_voter
node_comments -->|"creates via"| node_comment_form
node_comments -->|"persists"| node_comment_entity
node_registration -->|"creates via"| node_registration_form
node_registration -->|"creates"| node_user_entity
node_regions -->|"creates via"| node_region_form
node_regions -->|"manages"| node_region_entity
node_regions -->|"queries"| node_region_repo
node_cities -->|"creates via"| node_city_form
node_cities -->|"manages"| node_city_entity
node_cities -->|"queries"| node_city_repo
node_restaurant_entity -->|"uses repository"| node_restaurant_repo
node_comment_entity -->|"uses repository"| node_comment_repo
node_user_entity -->|"uses repository"| node_user_repo
node_region_entity -->|"uses repository"| node_region_repo
node_city_entity -->|"uses repository"| node_city_repo
node_restaurant_entity -->|"belongs to"| node_city_entity
node_restaurant_entity -->|"owned by"| node_user_entity
node_restaurant_entity -->|"has reviews"| node_comment_entity
node_comment_entity -->|"authored by"| node_user_entity
node_comment_entity -->|"replies to"| node_comment_entity
node_city_entity -->|"belongs to"| node_region_entity
node_voter -->|"authorizes"| node_restaurant_entity
node_voter -->|"checks user"| node_user_entity

click node_restaurants "https://github.com/hakazoki/bdd-symfony/blob/master/src/Controller/RestaurantController.php"
click node_comments "https://github.com/hakazoki/bdd-symfony/blob/master/src/Controller/CommentaireController.php"
click node_restaurant_form "https://github.com/hakazoki/bdd-symfony/blob/master/src/Form/RestaurantType.php"
click node_comment_form "https://github.com/hakazoki/bdd-symfony/blob/master/src/Form/CommentaireType.php"
click node_registration "https://github.com/hakazoki/bdd-symfony/blob/master/src/Controller/RegistrationController.php"
click node_login "https://github.com/hakazoki/bdd-symfony/blob/master/src/Controller/SecurityController.php"
click node_registration_form "https://github.com/hakazoki/bdd-symfony/blob/master/src/Form/RegistrationFormType.php"
click node_voter "https://github.com/hakazoki/bdd-symfony/blob/master/src/Security/Voter/RestaurantVoter.php"
click node_regions "https://github.com/hakazoki/bdd-symfony/blob/master/src/Controller/RegionController.php"
click node_cities "https://github.com/hakazoki/bdd-symfony/blob/master/src/Controller/VilleController.php"
click node_region_form "https://github.com/hakazoki/bdd-symfony/blob/master/src/Form/RegionType.php"
click node_city_form "https://github.com/hakazoki/bdd-symfony/blob/master/src/Form/VilleType.php"
click node_restaurant_entity "https://github.com/hakazoki/bdd-symfony/blob/master/src/Entity/Restaurant.php"
click node_comment_entity "https://github.com/hakazoki/bdd-symfony/blob/master/src/Entity/Commentaire.php"
click node_user_entity "https://github.com/hakazoki/bdd-symfony/blob/master/src/Entity/User.php"
click node_region_entity "https://github.com/hakazoki/bdd-symfony/blob/master/src/Entity/Region.php"
click node_city_entity "https://github.com/hakazoki/bdd-symfony/blob/master/src/Entity/Ville.php"
click node_restaurant_repo "https://github.com/hakazoki/bdd-symfony/blob/master/src/Repository/RestaurantRepository.php"
click node_comment_repo "https://github.com/hakazoki/bdd-symfony/blob/master/src/Repository/CommentaireRepository.php"
click node_user_repo "https://github.com/hakazoki/bdd-symfony/blob/master/src/Repository/UserRepository.php"
click node_region_repo "https://github.com/hakazoki/bdd-symfony/blob/master/src/Repository/RegionRepository.php"
click node_city_repo "https://github.com/hakazoki/bdd-symfony/blob/master/src/Repository/VilleRepository.php"

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_restaurants,node_comments,node_restaurant_form,node_comment_form toneBlue
class node_registration,node_login,node_registration_form,node_voter toneAmber
class node_regions,node_cities,node_region_form,node_city_form toneMint
class node_restaurant_entity,node_comment_entity,node_user_entity,node_region_entity,node_city_entity,node_restaurant_repo,node_comment_repo,node_user_repo,node_region_repo,node_city_repo toneRose
class node_visitor,node_member toneIndigo
```

## Components

### Web workflows

- [Restaurant workflows](https://github.com/hakazoki/bdd-symfony/blob/master/src/Controller/RestaurantController.php): `src/Controller/RestaurantController.php`
- [Comment workflows](https://github.com/hakazoki/bdd-symfony/blob/master/src/Controller/CommentaireController.php): `src/Controller/CommentaireController.php`
- [Restaurant form](https://github.com/hakazoki/bdd-symfony/blob/master/src/Form/RestaurantType.php): `src/Form/RestaurantType.php`
- [Comment form](https://github.com/hakazoki/bdd-symfony/blob/master/src/Form/CommentaireType.php): `src/Form/CommentaireType.php`

### Identity and access

- [Registration workflow](https://github.com/hakazoki/bdd-symfony/blob/master/src/Controller/RegistrationController.php): `src/Controller/RegistrationController.php`
- [Login workflow](https://github.com/hakazoki/bdd-symfony/blob/master/src/Controller/SecurityController.php): `src/Controller/SecurityController.php`
- [Registration form](https://github.com/hakazoki/bdd-symfony/blob/master/src/Form/RegistrationFormType.php): `src/Form/RegistrationFormType.php`
- [Restaurant voter](https://github.com/hakazoki/bdd-symfony/blob/master/src/Security/Voter/RestaurantVoter.php): `src/Security/Voter/RestaurantVoter.php`

### Location catalog

- [Region workflows](https://github.com/hakazoki/bdd-symfony/blob/master/src/Controller/RegionController.php): `src/Controller/RegionController.php`
- [City workflows](https://github.com/hakazoki/bdd-symfony/blob/master/src/Controller/VilleController.php): `src/Controller/VilleController.php`
- [Region form](https://github.com/hakazoki/bdd-symfony/blob/master/src/Form/RegionType.php): `src/Form/RegionType.php`
- [City form](https://github.com/hakazoki/bdd-symfony/blob/master/src/Form/VilleType.php): `src/Form/VilleType.php`

### Domain and persistence

- [Restaurant entity](https://github.com/hakazoki/bdd-symfony/blob/master/src/Entity/Restaurant.php): `src/Entity/Restaurant.php`
- [Comment entity](https://github.com/hakazoki/bdd-symfony/blob/master/src/Entity/Commentaire.php): `src/Entity/Commentaire.php`
- [User entity](https://github.com/hakazoki/bdd-symfony/blob/master/src/Entity/User.php): `src/Entity/User.php`
- [Region entity](https://github.com/hakazoki/bdd-symfony/blob/master/src/Entity/Region.php): `src/Entity/Region.php`
- [City entity](https://github.com/hakazoki/bdd-symfony/blob/master/src/Entity/Ville.php): `src/Entity/Ville.php`
- [Restaurant repository](https://github.com/hakazoki/bdd-symfony/blob/master/src/Repository/RestaurantRepository.php): `src/Repository/RestaurantRepository.php`
- [Comment repository](https://github.com/hakazoki/bdd-symfony/blob/master/src/Repository/CommentaireRepository.php): `src/Repository/CommentaireRepository.php`
- [User repository](https://github.com/hakazoki/bdd-symfony/blob/master/src/Repository/UserRepository.php): `src/Repository/UserRepository.php`
- [Region repository](https://github.com/hakazoki/bdd-symfony/blob/master/src/Repository/RegionRepository.php): `src/Repository/RegionRepository.php`
- [City repository](https://github.com/hakazoki/bdd-symfony/blob/master/src/Repository/VilleRepository.php): `src/Repository/VilleRepository.php`

### Other components

- **Visitor**
- **Signed-in member**

## Connections

- Visitor → Restaurant workflows: browses (evidence: `src/Controller/RestaurantController.php`)
- Signed-in member → Restaurant workflows: manages (evidence: `src/Controller/RestaurantController.php`)
- Signed-in member → Comment workflows: reviews (evidence: `src/Controller/CommentaireController.php`)
- Signed-in member → Registration workflow: registers
- Visitor → Login workflow: signs in
- Restaurant workflows → Restaurant form: creates via (evidence: `src/Controller/RestaurantController.php`)
- Restaurant workflows → Restaurant entity: persists (evidence: `src/Controller/RestaurantController.php`)
- Restaurant workflows → Restaurant repository: queries (evidence: `src/Controller/RestaurantController.php`)
- Restaurant workflows → City repository: lists cities (evidence: `src/Controller/RestaurantController.php`)
- Restaurant workflows → Restaurant voter: checks access (evidence: `src/Controller/RestaurantController.php`)
- Comment workflows → Comment form: creates via (evidence: `src/Controller/CommentaireController.php`)
- Comment workflows → Comment entity: persists (evidence: `src/Controller/CommentaireController.php`)
- Registration workflow → Registration form: creates via (evidence: `src/Controller/RegistrationController.php`)
- Registration workflow → User entity: creates (evidence: `src/Controller/RegistrationController.php`)
- Region workflows → Region form: creates via (evidence: `src/Controller/RegionController.php`)
- Region workflows → Region entity: manages (evidence: `src/Controller/RegionController.php`)
- Region workflows → Region repository: queries (evidence: `src/Controller/RegionController.php`)
- City workflows → City form: creates via (evidence: `src/Controller/VilleController.php`)
- City workflows → City entity: manages (evidence: `src/Controller/VilleController.php`)
- City workflows → City repository: queries (evidence: `src/Controller/VilleController.php`)
- Restaurant entity → Restaurant repository: uses repository (evidence: `src/Entity/Restaurant.php`)
- Comment entity → Comment repository: uses repository (evidence: `src/Entity/Commentaire.php`)
- User entity → User repository: uses repository (evidence: `src/Entity/User.php`)
- Region entity → Region repository: uses repository (evidence: `src/Entity/Region.php`)
- City entity → City repository: uses repository (evidence: `src/Entity/Ville.php`)
- Restaurant entity → City entity: belongs to (evidence: `src/Entity/Restaurant.php`)
- Restaurant entity → User entity: owned by (evidence: `src/Entity/Restaurant.php`)
- Restaurant entity → Comment entity: has reviews (evidence: `src/Entity/Restaurant.php`)
- Comment entity → User entity: authored by (evidence: `src/Entity/Commentaire.php`)
- Comment entity → Comment entity: replies to (evidence: `src/Entity/Commentaire.php`)
- City entity → Region entity: belongs to (evidence: `src/Entity/Ville.php`)
- Restaurant voter → Restaurant entity: authorizes (evidence: `src/Security/Voter/RestaurantVoter.php`)
- Restaurant voter → User entity: checks user (evidence: `src/Security/Voter/RestaurantVoter.php`)
