# durgeshcoder/threadvalut--sell-tshirts architecture

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

- Interactive diagram: https://gitdiagram.com/durgeshcoder/threadvalut--sell-tshirts
- Repository: https://github.com/durgeshcoder/threadvalut--sell-tshirts

## Overview

ThreadVault is a React storefront backed by a Spring Boot commerce API. Shoppers browse and filter products, select variants, manage a cart, authenticate, check out, and track orders; administrators manage catalog, inventory, and orders. The graph preserves these distinct product areas and the API/service/persistence layering. The README documents the broad workflows and integrations; sampled source confirms selected frontend routing, cart/auth behavior, and catalog/admin controller-to-service calls. Other subsystem links are documented capability-level relationships, not claims that unsampled implementation details were inspected.

Main entry points: [`backend/src/main/java/com/substring/tshirt/backend/controller`](https://github.com/durgeshcoder/threadvalut--sell-tshirts/tree/master/backend/src/main/java/com/substring/tshirt/backend/controller) (REST controllers), [`frontend/src/api/client.js`](https://github.com/durgeshcoder/threadvalut--sell-tshirts/blob/master/frontend/src/api/client.js) (API client), [`frontend/src/App.jsx`](https://github.com/durgeshcoder/threadvalut--sell-tshirts/blob/master/frontend/src/App.jsx) (Storefront routes), [`frontend/src/pages`](https://github.com/durgeshcoder/threadvalut--sell-tshirts/tree/master/frontend/src/pages) (Checkout and orders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_webapp["Storefront routes<br/>[App.jsx]"]
  node_catalogui["Browse and product views"]
  node_checkoutui["Checkout and orders"]
  node_adminui["Admin dashboard"]
  node_authstate["Auth state<br/>[AuthContext.jsx]"]
  node_cartstate["Cart state<br/>[CartContext.jsx]"]
  node_api["API client<br/>[client.js]"]
end

subgraph group_commerce["Commerce API"]
  node_controllers["REST controllers"]
  node_products["Catalog and variants"]
  node_cartorders["Cart and orders"]
  node_payments["Payment handling"]
  node_addresses["Address management"]
end

subgraph group_identity["Identity and access"]
  node_authservice["Authentication service"]
  node_security["JWT security"]
end

subgraph group_data["Data and integrations"]
  node_repositories["Data repositories"]
  node_domain["Commerce entities"]
  node_postgres[("PostgreSQL")]
  node_media["ImageKit media"]
  node_imagekit["ImageKit"]
  node_gateways["Payment gateways"]
end

node_shopper(("Shopper"))
node_admin(("Administrator"))

node_shopper -->|"uses"| node_webapp
node_admin -->|"manages"| node_adminui
node_webapp -->|"routes to"| node_catalogui
node_webapp -->|"routes to"| node_checkoutui
node_webapp -->|"routes to"| node_adminui
node_catalogui -.->|"requests catalog"| node_api
node_checkoutui -.->|"uses cart"| node_cartstate
node_checkoutui -.->|"requests checkout"| node_api
node_authstate -->|"calls auth"| node_api
node_cartstate -->|"calls cart API"| node_api
node_adminui -.->|"requests administration"| node_api
node_api -.->|"sends API requests"| node_controllers
node_controllers -->|"delegates catalog"| node_products
node_controllers -->|"delegates admin edits"| node_products
node_controllers -.->|"delegates authentication"| node_authservice
node_controllers -.->|"handles cart and orders"| node_cartorders
node_controllers -.->|"initiates payments"| node_payments
node_controllers -.->|"handles addresses"| node_addresses
node_authservice -->|"issues JWTs"| node_security
node_products -.->|"persists catalog"| node_repositories
node_cartorders -.->|"persists transactions"| node_repositories
node_payments -.->|"integrates payments"| node_gateways
node_media -.->|"uploads media"| node_imagekit
node_repositories -.->|"stores entities"| node_domain
node_domain -.->|"maps to"| node_postgres

click node_webapp "https://github.com/durgeshcoder/threadvalut--sell-tshirts/blob/master/frontend/src/App.jsx"
click node_catalogui "https://github.com/durgeshcoder/threadvalut--sell-tshirts/tree/master/frontend/src/pages"
click node_checkoutui "https://github.com/durgeshcoder/threadvalut--sell-tshirts/tree/master/frontend/src/pages"
click node_adminui "https://github.com/durgeshcoder/threadvalut--sell-tshirts/blob/master/frontend/src/pages/AdminDashboardPage.jsx"
click node_authstate "https://github.com/durgeshcoder/threadvalut--sell-tshirts/blob/master/frontend/src/context/AuthContext.jsx"
click node_cartstate "https://github.com/durgeshcoder/threadvalut--sell-tshirts/blob/master/frontend/src/context/CartContext.jsx"
click node_api "https://github.com/durgeshcoder/threadvalut--sell-tshirts/blob/master/frontend/src/api/client.js"
click node_controllers "https://github.com/durgeshcoder/threadvalut--sell-tshirts/tree/master/backend/src/main/java/com/substring/tshirt/backend/controller"
click node_products "https://github.com/durgeshcoder/threadvalut--sell-tshirts/tree/master/backend/src/main/java/com/substring/tshirt/backend/service"
click node_cartorders "https://github.com/durgeshcoder/threadvalut--sell-tshirts/tree/master/backend/src/main/java/com/substring/tshirt/backend/service"
click node_addresses "https://github.com/durgeshcoder/threadvalut--sell-tshirts/tree/master/backend/src/main/java/com/substring/tshirt/backend/service"
click node_authservice "https://github.com/durgeshcoder/threadvalut--sell-tshirts/blob/master/backend/src/main/java/com/substring/tshirt/backend/service/impl/AuthServiceImpl.java"
click node_security "https://github.com/durgeshcoder/threadvalut--sell-tshirts/tree/master/backend/src/main/java/com/substring/tshirt/backend/security"
click node_repositories "https://github.com/durgeshcoder/threadvalut--sell-tshirts/tree/master/backend/src/main/java/com/substring/tshirt/backend/repository"
click node_domain "https://github.com/durgeshcoder/threadvalut--sell-tshirts/tree/master/backend/src/main/java/com/substring/tshirt/backend/entity"
click node_media "https://github.com/durgeshcoder/threadvalut--sell-tshirts/blob/master/backend/src/main/java/com/substring/tshirt/backend/service/impl/ImageUploadServiceImpl.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_webapp,node_catalogui,node_checkoutui,node_adminui,node_authstate,node_cartstate,node_api toneBlue
class node_controllers,node_products,node_cartorders,node_payments,node_addresses toneAmber
class node_authservice,node_security toneMint
class node_repositories,node_domain,node_postgres,node_media,node_imagekit,node_gateways toneRose
class node_shopper,node_admin toneIndigo
```

## Components

### Storefront

- [Storefront routes](https://github.com/durgeshcoder/threadvalut--sell-tshirts/blob/master/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Browse and product views](https://github.com/durgeshcoder/threadvalut--sell-tshirts/tree/master/frontend/src/pages): `frontend/src/pages`
- [Checkout and orders](https://github.com/durgeshcoder/threadvalut--sell-tshirts/tree/master/frontend/src/pages): `frontend/src/pages`
- [Admin dashboard](https://github.com/durgeshcoder/threadvalut--sell-tshirts/blob/master/frontend/src/pages/AdminDashboardPage.jsx): `frontend/src/pages/AdminDashboardPage.jsx`
- [Auth state](https://github.com/durgeshcoder/threadvalut--sell-tshirts/blob/master/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Cart state](https://github.com/durgeshcoder/threadvalut--sell-tshirts/blob/master/frontend/src/context/CartContext.jsx): `frontend/src/context/CartContext.jsx`
- [API client](https://github.com/durgeshcoder/threadvalut--sell-tshirts/blob/master/frontend/src/api/client.js): `frontend/src/api/client.js`

### Commerce API

- [REST controllers](https://github.com/durgeshcoder/threadvalut--sell-tshirts/tree/master/backend/src/main/java/com/substring/tshirt/backend/controller): `backend/src/main/java/com/substring/tshirt/backend/controller`
- [Catalog and variants](https://github.com/durgeshcoder/threadvalut--sell-tshirts/tree/master/backend/src/main/java/com/substring/tshirt/backend/service): `backend/src/main/java/com/substring/tshirt/backend/service`
- [Cart and orders](https://github.com/durgeshcoder/threadvalut--sell-tshirts/tree/master/backend/src/main/java/com/substring/tshirt/backend/service): `backend/src/main/java/com/substring/tshirt/backend/service`
- **Payment handling**
- [Address management](https://github.com/durgeshcoder/threadvalut--sell-tshirts/tree/master/backend/src/main/java/com/substring/tshirt/backend/service): `backend/src/main/java/com/substring/tshirt/backend/service`

### Identity and access

- [Authentication service](https://github.com/durgeshcoder/threadvalut--sell-tshirts/blob/master/backend/src/main/java/com/substring/tshirt/backend/service/impl/AuthServiceImpl.java): `backend/src/main/java/com/substring/tshirt/backend/service/impl/AuthServiceImpl.java`
- [JWT security](https://github.com/durgeshcoder/threadvalut--sell-tshirts/tree/master/backend/src/main/java/com/substring/tshirt/backend/security): `backend/src/main/java/com/substring/tshirt/backend/security`

### Data and integrations

- [Data repositories](https://github.com/durgeshcoder/threadvalut--sell-tshirts/tree/master/backend/src/main/java/com/substring/tshirt/backend/repository): `backend/src/main/java/com/substring/tshirt/backend/repository`
- [Commerce entities](https://github.com/durgeshcoder/threadvalut--sell-tshirts/tree/master/backend/src/main/java/com/substring/tshirt/backend/entity): `backend/src/main/java/com/substring/tshirt/backend/entity`
- **PostgreSQL**
- [ImageKit media](https://github.com/durgeshcoder/threadvalut--sell-tshirts/blob/master/backend/src/main/java/com/substring/tshirt/backend/service/impl/ImageUploadServiceImpl.java): `backend/src/main/java/com/substring/tshirt/backend/service/impl/ImageUploadServiceImpl.java`
- **ImageKit**
- **Payment gateways**

### Other components

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

## Connections

- Shopper → Storefront routes: uses
- Administrator → Admin dashboard: manages
- Storefront routes → Browse and product views: routes to (evidence: `frontend/src/App.jsx`)
- Storefront routes → Checkout and orders: routes to (evidence: `frontend/src/App.jsx`)
- Storefront routes → Admin dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Browse and product views → API client: requests catalog
- Checkout and orders → Cart state: uses cart
- Checkout and orders → API client: requests checkout
- Auth state → API client: calls auth (evidence: `frontend/src/context/AuthContext.jsx`)
- Cart state → API client: calls cart API (evidence: `frontend/src/context/CartContext.jsx`)
- Admin dashboard → API client: requests administration
- API client → REST controllers: sends API requests
- REST controllers → Catalog and variants: delegates catalog (evidence: `backend/src/main/java/com/substring/tshirt/backend/controller/ProductController.java`)
- REST controllers → Catalog and variants: delegates admin edits (evidence: `backend/src/main/java/com/substring/tshirt/backend/controller/AdminProductController.java`)
- REST controllers → Authentication service: delegates authentication
- REST controllers → Cart and orders: handles cart and orders (evidence: `backend/src/main/java/com/substring/tshirt/backend/controller/AdminProductController.java`)
- REST controllers → Payment handling: initiates payments
- REST controllers → Address management: handles addresses (evidence: `backend/src/main/java/com/substring/tshirt/backend/controller/AdminProductController.java`)
- Authentication service → JWT security: issues JWTs (evidence: `backend/src/main/java/com/substring/tshirt/backend/service/impl/AuthServiceImpl.java`)
- Catalog and variants → Data repositories: persists catalog (evidence: `backend/src/main/java/com/substring/tshirt/backend/service/impl/AuthServiceImpl.java`)
- Cart and orders → Data repositories: persists transactions (evidence: `backend/src/main/java/com/substring/tshirt/backend/service/impl/AuthServiceImpl.java`)
- Payment handling → Payment gateways: integrates payments
- ImageKit media → ImageKit: uploads media
- Data repositories → Commerce entities: stores entities (evidence: `backend/src/main/java/com/substring/tshirt/backend/repository/ProductRepository.java`)
- Commerce entities → PostgreSQL: maps to
