# mustafagomaa1/brandos-graduation-project architecture

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

- Interactive diagram: https://gitdiagram.com/mustafagomaa1/brandos-graduation-project
- Repository: https://github.com/mustafagomaa1/brandos-graduation-project

## Overview

Brandos is an e-commerce management platform: shoppers browse product pages, while administrators manage catalog and inventory; product recommendations form a separate AI-assisted branch. The documented recommendation workflow sends a viewed product’s identifier from Spring Boot to FastAPI, computes similar products, then uses MySQL-backed product data to render recommendations in Thymeleaf. The source excerpts show the Python model and endpoint, but not the Spring controllers, services, or repository calls; those internal links are therefore not asserted. The README describes the cross-service workflow, whose exact HTTP shape differs from the sampled endpoint.

Main entry points: [`src/main/java/com/example/brandos/BrandosApplication.java`](https://github.com/mustafagomaa1/brandos-graduation-project/blob/main/src/main/java/com/example/brandos/BrandosApplication.java) (Spring Boot App), [`FastAPIProject/main.py`](https://github.com/mustafagomaa1/brandos-graduation-project/blob/main/FastAPIProject/main.py) (FastAPI Endpoint), [`src/main/java/com/example/brandos/service`](https://github.com/mustafagomaa1/brandos-graduation-project/tree/main/src/main/java/com/example/brandos/service) (Recommendation Integration), [`FastAPIProject/products.csv`](https://github.com/mustafagomaa1/brandos-graduation-project/blob/main/FastAPIProject/products.csv) (Product Dataset)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_management["Management Core"]
  node_spring["Spring Boot App"]
  node_security["Web Security"]
  node_data[("JPA Data Layer")]
end

subgraph group_commerce["Commerce Features"]
  node_catalog["Product Management"]
  node_customers["Customer Accounts"]
  node_reviews["Product Reviews"]
  node_chat["Product Chat"]
end

subgraph group_recommendations["Recommendations"]
  node_recommendation_client["Recommendation Integration"]
  node_fastapi["FastAPI Endpoint<br/>[main.py]"]
  node_model["Similarity Model<br/>[main.py]"]
  node_product_csv["Product Dataset<br/>[products.csv]"]
end

subgraph group_presentation["Web Presentation"]
  node_templates["Thymeleaf Views"]
end

node_shopper(("Shopper"))
node_admin(("Administrator"))
node_mysql[("MySQL")]

node_shopper -->|"browses products"| node_spring
node_admin -->|"manages site"| node_spring
node_spring -->|"persists data"| node_mysql
node_spring -->|"renders pages"| node_templates
node_spring -->|"requests suggestions"| node_recommendation_client
node_recommendation_client -->|"sends product ID"| node_fastapi
node_fastapi -->|"calls model"| node_model
node_model -->|"loads products"| node_product_csv
node_fastapi -->|"returns product IDs"| node_recommendation_client
node_spring -->|"fetches recommendations"| node_mysql

click node_spring "https://github.com/mustafagomaa1/brandos-graduation-project/blob/main/src/main/java/com/example/brandos/BrandosApplication.java"
click node_security "https://github.com/mustafagomaa1/brandos-graduation-project/tree/main/src/main/java/com/example/brandos/security"
click node_catalog "https://github.com/mustafagomaa1/brandos-graduation-project/blob/main/src/main/java/com/example/brandos/controller/ProductController.java"
click node_customers "https://github.com/mustafagomaa1/brandos-graduation-project/blob/main/src/main/java/com/example/brandos/controller/CustomerController.java"
click node_reviews "https://github.com/mustafagomaa1/brandos-graduation-project/blob/main/src/main/java/com/example/brandos/controller/ReviewController.java"
click node_chat "https://github.com/mustafagomaa1/brandos-graduation-project/blob/main/src/main/java/com/example/brandos/controller/ChatController.java"
click node_data "https://github.com/mustafagomaa1/brandos-graduation-project/tree/main/src/main/java/com/example/brandos/repository"
click node_templates "https://github.com/mustafagomaa1/brandos-graduation-project/tree/main/src/main/resources/templates"
click node_recommendation_client "https://github.com/mustafagomaa1/brandos-graduation-project/tree/main/src/main/java/com/example/brandos/service"
click node_fastapi "https://github.com/mustafagomaa1/brandos-graduation-project/blob/main/FastAPIProject/main.py"
click node_model "https://github.com/mustafagomaa1/brandos-graduation-project/blob/main/FastAPIProject/main.py"
click node_product_csv "https://github.com/mustafagomaa1/brandos-graduation-project/blob/main/FastAPIProject/products.csv"

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_spring,node_security,node_data toneBlue
class node_catalog,node_customers,node_reviews,node_chat,node_mysql toneAmber
class node_recommendation_client,node_fastapi,node_model,node_product_csv toneMint
class node_templates toneRose
class node_shopper,node_admin toneIndigo
```

## Components

### Management Core

- [Spring Boot App](https://github.com/mustafagomaa1/brandos-graduation-project/blob/main/src/main/java/com/example/brandos/BrandosApplication.java): `src/main/java/com/example/brandos/BrandosApplication.java`
- [Web Security](https://github.com/mustafagomaa1/brandos-graduation-project/tree/main/src/main/java/com/example/brandos/security): `src/main/java/com/example/brandos/security`
- [JPA Data Layer](https://github.com/mustafagomaa1/brandos-graduation-project/tree/main/src/main/java/com/example/brandos/repository): `src/main/java/com/example/brandos/repository`

### Commerce Features

- [Product Management](https://github.com/mustafagomaa1/brandos-graduation-project/blob/main/src/main/java/com/example/brandos/controller/ProductController.java): `src/main/java/com/example/brandos/controller/ProductController.java`
- [Customer Accounts](https://github.com/mustafagomaa1/brandos-graduation-project/blob/main/src/main/java/com/example/brandos/controller/CustomerController.java): `src/main/java/com/example/brandos/controller/CustomerController.java`
- [Product Reviews](https://github.com/mustafagomaa1/brandos-graduation-project/blob/main/src/main/java/com/example/brandos/controller/ReviewController.java): `src/main/java/com/example/brandos/controller/ReviewController.java`
- [Product Chat](https://github.com/mustafagomaa1/brandos-graduation-project/blob/main/src/main/java/com/example/brandos/controller/ChatController.java): `src/main/java/com/example/brandos/controller/ChatController.java`

### Recommendations

- [Recommendation Integration](https://github.com/mustafagomaa1/brandos-graduation-project/tree/main/src/main/java/com/example/brandos/service): `src/main/java/com/example/brandos/service`
- [FastAPI Endpoint](https://github.com/mustafagomaa1/brandos-graduation-project/blob/main/FastAPIProject/main.py): `FastAPIProject/main.py`
- [Similarity Model](https://github.com/mustafagomaa1/brandos-graduation-project/blob/main/FastAPIProject/main.py): `FastAPIProject/main.py`
- [Product Dataset](https://github.com/mustafagomaa1/brandos-graduation-project/blob/main/FastAPIProject/products.csv): `FastAPIProject/products.csv`

### Web Presentation

- [Thymeleaf Views](https://github.com/mustafagomaa1/brandos-graduation-project/tree/main/src/main/resources/templates): `src/main/resources/templates`

### Other components

- **Shopper**
- **Administrator**
- **MySQL**

## Connections

- Shopper → Spring Boot App: browses products (evidence: `README.md`)
- Administrator → Spring Boot App: manages site (evidence: `README.md`)
- Spring Boot App → MySQL: persists data (evidence: `README.md`)
- Spring Boot App → Thymeleaf Views: renders pages (evidence: `README.md`)
- Spring Boot App → Recommendation Integration: requests suggestions (evidence: `README.md`)
- Recommendation Integration → FastAPI Endpoint: sends product ID (evidence: `README.md`)
- FastAPI Endpoint → Similarity Model: calls model (evidence: `FastAPIProject/main.py`)
- Similarity Model → Product Dataset: loads products (evidence: `FastAPIProject/main.py`)
- FastAPI Endpoint → Recommendation Integration: returns product IDs (evidence: `README.md`)
- Spring Boot App → MySQL: fetches recommendations (evidence: `README.md`)
