# zhelez9aca/clothes-shop architecture

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

- Interactive diagram: https://gitdiagram.com/zhelez9aca/clothes-shop
- Repository: https://github.com/zhelez9aca/clothes-shop

## Overview

Clothes Shop is a Spring Boot backend for an online clothing store. Its documented user workflow covers registration or login with JWT cookies, browsing products and categories, managing a cart, and creating or retrieving orders. The README describes a controller → service → repository → database architecture; the graph uses that documented layering but does not claim unsampled implementation details. DTOs, mappers, and exception handling are present as internal supporting layers, but their specific runtime connections are not established by the available evidence.

Main entry points: [`src/main/java/com/example/clothesshop/repository`](https://github.com/zhelez9aca/clothes-shop/tree/main/src/main/java/com/example/clothesshop/repository) (Repositories), [`src/main/java/com/example/clothesshop/service/AuthorizationService.java`](https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/service/AuthorizationService.java) (Authorization), [`src/main/java/com/example/clothesshop/controller/AuthController.java`](https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/controller/AuthController.java) (Auth API), [`src/main/java/com/example/clothesshop/controller/ClothesController.java`](https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/controller/ClothesController.java) (Catalog API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_auth_api["Auth API"]
  node_catalog_api["Catalog API"]
  node_category_api["Category API"]
  node_cart_api["Cart API"]
  node_order_api["Order API"]
end

subgraph group_business["Shop Services"]
  node_auth_service["Authorization"]
  node_clothes_service["Clothes Service"]
  node_category_service["Category Service"]
  node_cart_service["Cart Service<br/>[CartService.java]"]
  node_order_service["Order Service<br/>[OrderService.java]"]
end

subgraph group_persistence["Persistence"]
  node_repo_layer["Repositories"]
  node_postgres[("PostgreSQL")]
end

subgraph group_security["Authentication"]
  node_jwt["JWT Cookie<br/>[JWToken.java]"]
  node_security_config["Security Config"]
end

node_shopper(("Shopper"))

node_shopper -->|"registers or logs in"| node_auth_api
node_shopper -->|"views products"| node_catalog_api
node_shopper -->|"browses categories"| node_category_api
node_shopper -->|"manages cart"| node_cart_api
node_shopper -->|"manages orders"| node_order_api
node_auth_api -->|"handles auth"| node_auth_service
node_catalog_api -->|"handles catalog"| node_clothes_service
node_category_api -->|"handles categories"| node_category_service
node_cart_api -->|"handles cart"| node_cart_service
node_order_api -->|"handles orders"| node_order_service
node_auth_service -->|"uses repository layer"| node_repo_layer
node_clothes_service -->|"uses repository layer"| node_repo_layer
node_category_service -->|"uses repository layer"| node_repo_layer
node_cart_service -->|"uses repository layer"| node_repo_layer
node_order_service -->|"uses repository layer"| node_repo_layer
node_repo_layer -->|"persists data"| node_postgres
node_auth_service -->|"issues JWT"| node_jwt
node_jwt -->|"sets HttpOnly cookie"| node_shopper

click node_auth_api "https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/controller/AuthController.java"
click node_catalog_api "https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/controller/ClothesController.java"
click node_category_api "https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/controller/CategoryController.java"
click node_cart_api "https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/controller/CartController.java"
click node_order_api "https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/controller/OrderController.java"
click node_auth_service "https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/service/AuthorizationService.java"
click node_clothes_service "https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/service/ClothesService.java"
click node_category_service "https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/service/CategoryService.java"
click node_cart_service "https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/service/CartService.java"
click node_order_service "https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/service/OrderService.java"
click node_repo_layer "https://github.com/zhelez9aca/clothes-shop/tree/main/src/main/java/com/example/clothesshop/repository"
click node_jwt "https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/security/JWToken.java"
click node_security_config "https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/config/SpringSecurity.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_auth_api,node_catalog_api,node_category_api,node_cart_api,node_order_api toneBlue
class node_auth_service,node_clothes_service,node_category_service,node_cart_service,node_order_service toneAmber
class node_repo_layer,node_postgres toneMint
class node_jwt,node_security_config toneRose
class node_shopper toneIndigo
```

## Components

### HTTP API

- [Auth API](https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/controller/AuthController.java): `src/main/java/com/example/clothesshop/controller/AuthController.java`
- [Catalog API](https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/controller/ClothesController.java): `src/main/java/com/example/clothesshop/controller/ClothesController.java`
- [Category API](https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/controller/CategoryController.java): `src/main/java/com/example/clothesshop/controller/CategoryController.java`
- [Cart API](https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/controller/CartController.java): `src/main/java/com/example/clothesshop/controller/CartController.java`
- [Order API](https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/controller/OrderController.java): `src/main/java/com/example/clothesshop/controller/OrderController.java`

### Shop Services

- [Authorization](https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/service/AuthorizationService.java): `src/main/java/com/example/clothesshop/service/AuthorizationService.java`
- [Clothes Service](https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/service/ClothesService.java): `src/main/java/com/example/clothesshop/service/ClothesService.java`
- [Category Service](https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/service/CategoryService.java): `src/main/java/com/example/clothesshop/service/CategoryService.java`
- [Cart Service](https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/service/CartService.java): `src/main/java/com/example/clothesshop/service/CartService.java`
- [Order Service](https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/service/OrderService.java): `src/main/java/com/example/clothesshop/service/OrderService.java`

### Persistence

- [Repositories](https://github.com/zhelez9aca/clothes-shop/tree/main/src/main/java/com/example/clothesshop/repository): `src/main/java/com/example/clothesshop/repository`
- **PostgreSQL**

### Authentication

- [JWT Cookie](https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/security/JWToken.java): `src/main/java/com/example/clothesshop/security/JWToken.java`
- [Security Config](https://github.com/zhelez9aca/clothes-shop/blob/main/src/main/java/com/example/clothesshop/config/SpringSecurity.java): `src/main/java/com/example/clothesshop/config/SpringSecurity.java`

### Other components

- **Shopper**

## Connections

- Shopper → Auth API: registers or logs in (evidence: `README.md`)
- Shopper → Catalog API: views products (evidence: `README.md`)
- Shopper → Category API: browses categories (evidence: `README.md`)
- Shopper → Cart API: manages cart (evidence: `README.md`)
- Shopper → Order API: manages orders (evidence: `README.md`)
- Auth API → Authorization: handles auth (evidence: `README.md`)
- Catalog API → Clothes Service: handles catalog (evidence: `README.md`)
- Category API → Category Service: handles categories (evidence: `README.md`)
- Cart API → Cart Service: handles cart (evidence: `README.md`)
- Order API → Order Service: handles orders (evidence: `README.md`)
- Authorization → Repositories: uses repository layer (evidence: `README.md`)
- Clothes Service → Repositories: uses repository layer (evidence: `README.md`)
- Category Service → Repositories: uses repository layer (evidence: `README.md`)
- Cart Service → Repositories: uses repository layer (evidence: `README.md`)
- Order Service → Repositories: uses repository layer (evidence: `README.md`)
- Repositories → PostgreSQL: persists data (evidence: `README.md`)
- Authorization → JWT Cookie: issues JWT (evidence: `README.md`)
- JWT Cookie → Shopper: sets HttpOnly cookie (evidence: `README.md`)
