# gat0sy/gestion_spring_mvc-l3gl2 architecture

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

- Interactive diagram: https://gitdiagram.com/gat0sy/gestion_spring_mvc-l3gl2
- Repository: https://github.com/gat0sy/gestion_spring_mvc-l3gl2

## Overview

This is a Spring MVC product-and-type management application with server-rendered pages and a separate JSON API. Users list, create, edit, and delete products and types; product forms also load types so a product can reference one. Both entry points delegate to services, which delegate persistence to JPA repositories. The tree includes JSP views and entity paths, but their implementations and application configuration were not sampled, so those links are shown only where supported by the controllers.

Main entry points: [`src/main/java/groupe2/controller/ProductController.java`](https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/controller/ProductController.java) (Product pages), [`src/main/java/groupe2/service/impl/TypeServiceImpl.java`](https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/service/impl/TypeServiceImpl.java) (Type service), [`src/main/java/groupe2/controller/TypeController.java`](https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/controller/TypeController.java) (Type pages), [`src/main/java/groupe2/service/impl/ProductServiceImpl.java`](https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/service/impl/ProductServiceImpl.java) (Product service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web pages"]
  node_web_product["Product pages"]
  node_web_type["Type pages"]
  node_product_views["Product JSPs"]
  node_type_views["Type JSPs"]
end

subgraph group_api["REST API"]
  node_product_api["Product API"]
  node_type_api["Type API"]
end

subgraph group_product["Product domain"]
  node_product_service["Product service"]
  node_product_model["Product model<br/>[Product.java]"]
end

subgraph group_type["Type domain"]
  node_type_service["Type service"]
  node_type_model["Type model<br/>[Type.java]"]
end

subgraph group_persistence["Persistence"]
  node_product_repo["Product repository"]
  node_type_repo["Type repository"]
end

node_browser(("Browser user"))
node_database[("JPA database")]

node_browser -->|"requests pages"| node_web_product
node_browser -->|"requests pages"| node_web_type
node_browser -->|"sends API requests"| node_product_api
node_browser -->|"sends API requests"| node_type_api
node_web_product -->|"calls"| node_product_service
node_web_product -->|"loads types"| node_type_service
node_web_product -->|"selects view"| node_product_views
node_web_type -->|"calls"| node_type_service
node_web_type -->|"selects view"| node_type_views
node_product_api -->|"calls"| node_product_service
node_type_api -->|"calls"| node_type_service
node_product_service -->|"delegates operations"| node_product_repo
node_type_service -->|"delegates operations"| node_type_repo
node_product_repo -->|"queries and updates"| node_database
node_type_repo -->|"queries and updates"| node_database

click node_web_product "https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/controller/ProductController.java"
click node_web_type "https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/controller/TypeController.java"
click node_product_views "https://github.com/gat0sy/gestion_spring_mvc-l3gl2/tree/main/src/main/webapp/WEB-INF/views"
click node_type_views "https://github.com/gat0sy/gestion_spring_mvc-l3gl2/tree/main/src/main/webapp/WEB-INF/views"
click node_product_api "https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/rest/ProductRestController.java"
click node_type_api "https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/rest/TypeRestController.java"
click node_product_service "https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/service/impl/ProductServiceImpl.java"
click node_product_model "https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/entity/Product.java"
click node_type_service "https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/service/impl/TypeServiceImpl.java"
click node_type_model "https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/entity/Type.java"
click node_product_repo "https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/repository/impl/ProductRepositoryImpl.java"
click node_type_repo "https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/repository/impl/TypeRepositoryImpl.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_product,node_web_type,node_product_views,node_type_views,node_browser toneBlue
class node_product_api,node_type_api,node_database toneAmber
class node_product_service,node_product_model toneMint
class node_type_service,node_type_model toneRose
class node_product_repo,node_type_repo toneIndigo
```

## Components

### Web pages

- [Product pages](https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/controller/ProductController.java): `src/main/java/groupe2/controller/ProductController.java`
- [Type pages](https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/controller/TypeController.java): `src/main/java/groupe2/controller/TypeController.java`
- [Product JSPs](https://github.com/gat0sy/gestion_spring_mvc-l3gl2/tree/main/src/main/webapp/WEB-INF/views): `src/main/webapp/WEB-INF/views`
- [Type JSPs](https://github.com/gat0sy/gestion_spring_mvc-l3gl2/tree/main/src/main/webapp/WEB-INF/views): `src/main/webapp/WEB-INF/views`

### REST API

- [Product API](https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/rest/ProductRestController.java): `src/main/java/groupe2/rest/ProductRestController.java`
- [Type API](https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/rest/TypeRestController.java): `src/main/java/groupe2/rest/TypeRestController.java`

### Product domain

- [Product service](https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/service/impl/ProductServiceImpl.java): `src/main/java/groupe2/service/impl/ProductServiceImpl.java`
- [Product model](https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/entity/Product.java): `src/main/java/groupe2/entity/Product.java`

### Type domain

- [Type service](https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/service/impl/TypeServiceImpl.java): `src/main/java/groupe2/service/impl/TypeServiceImpl.java`
- [Type model](https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/entity/Type.java): `src/main/java/groupe2/entity/Type.java`

### Persistence

- [Product repository](https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/repository/impl/ProductRepositoryImpl.java): `src/main/java/groupe2/repository/impl/ProductRepositoryImpl.java`
- [Type repository](https://github.com/gat0sy/gestion_spring_mvc-l3gl2/blob/main/src/main/java/groupe2/repository/impl/TypeRepositoryImpl.java): `src/main/java/groupe2/repository/impl/TypeRepositoryImpl.java`

### Other components

- **Browser user**
- **JPA database**

## Connections

- Browser user → Product pages: requests pages
- Browser user → Type pages: requests pages
- Browser user → Product API: sends API requests
- Browser user → Type API: sends API requests
- Product pages → Product service: calls
- Product pages → Type service: loads types
- Product pages → Product JSPs: selects view
- Type pages → Type service: calls
- Type pages → Type JSPs: selects view
- Product API → Product service: calls
- Type API → Type service: calls
- Product service → Product repository: delegates operations
- Type service → Type repository: delegates operations
- Product repository → JPA database: queries and updates
- Type repository → JPA database: queries and updates
