# ashimsharma337/springboot-react-ecommerce architecture

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

- Interactive diagram: https://gitdiagram.com/ashimsharma337/springboot-react-ecommerce
- Repository: https://github.com/ashimsharma337/springboot-react-ecommerce

## Overview

This is a React storefront paired with a Spring Boot REST API and PostgreSQL. The visible browser workflow is product discovery, product-detail viewing and a local cart interaction; login sends credentials to the API and stores the returned token. The API separately supports user, product, cart and order operations, with JWT protection and persistence. The frontend is an early UI foundation, not a complete checkout client. Relationships for unsampled backend layers and API capabilities follow the README or source-index references; unsampled implementation details are not inferred.

Main entry points: [`ecommercefrontend/src/App.tsx`](https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/ecommercefrontend/src/App.tsx) (App Router), [`EcommerceBackend/src/main/java/com/ashim/dao`](https://github.com/ashimsharma337/springboot-react-ecommerce/tree/main/EcommerceBackend/src/main/java/com/ashim/dao) (JPA Repositories), [`EcommerceBackend/src/main/java/com/ashim/service/UserServiceImpl.java`](https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/service/UserServiceImpl.java) (User Service), [`EcommerceBackend/src/main/java/com/ashim/controller/UserController.java`](https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/controller/UserController.java) (User Endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront UI"]
  node_app["App Router<br/>[App.tsx]"]
  node_navigation["Main Navigation<br/>[mainNav.tsx]"]
  node_landing["Storefront Sections"]
  node_product_grid["Product Grid<br/>[ProductGrid.tsx]"]
  node_product_detail["Product Detail<br/>[ProductDetail.tsx]"]
  node_detail_views["Detail Views"]
  node_catalog_data["Catalog Data<br/>[storefront.ts]"]
  node_detail_data["Product Detail Data<br/>[studioOneDetail.ts]"]
  node_login["Login Form<br/>[login.tsx]"]
  node_browser_storage["Browser Token Storage<br/>[App.tsx]"]
end

subgraph group_identity["Identity and Security"]
  node_security_config["Security Configuration"]
  node_jwt_filter["JWT Filter<br/>[JwtFilter.java]"]
  node_jwt_service["JWT Service<br/>[JWTService.java]"]
  node_user_details["User Loading"]
end

subgraph group_api["REST API and Services"]
  node_api_client["REST API"]
  node_user_controller["User Endpoints"]
  node_product_controller["Product Endpoints"]
  node_cart_controller["Cart Endpoints"]
  node_order_controller["Order Endpoints"]
  node_user_service["User Service"]
  node_product_service["Product Service"]
  node_cart_service["Cart Service"]
  node_order_service["Order Service"]
  node_exception_handling["Exception Handling"]
end

subgraph group_persistence["Persistence"]
  node_repositories["JPA Repositories"]
  node_entities["Domain Entities"]
  node_postgres[("PostgreSQL")]
end

node_browser(("Shopper"))

node_browser -->|"uses"| node_app
node_app -->|"renders"| node_navigation
node_app -->|"renders"| node_landing
node_app -->|"renders"| node_product_grid
node_app -->|"routes to"| node_product_detail
node_app -->|"renders"| node_login
node_app -->|"reads"| node_catalog_data
node_product_grid -->|"renders data"| node_catalog_data
node_product_detail -->|"renders"| node_detail_views
node_product_detail -->|"reads"| node_detail_data
node_detail_views -->|"renders data"| node_detail_data
node_login -->|"posts credentials"| node_api_client
node_api_client -->|"routes login"| node_user_controller
node_login -->|"stores token"| node_browser_storage
node_browser -->|"browses"| node_product_grid
node_product_controller -->|"delegates"| node_product_service
node_cart_controller -->|"delegates"| node_cart_service
node_order_controller -->|"delegates"| node_order_service
node_user_controller -->|"delegates"| node_user_service
node_user_controller -.->|"handled errors"| node_exception_handling
node_product_service -->|"raises errors"| node_exception_handling
node_order_service -->|"raises errors"| node_exception_handling
node_user_service -->|"raises errors"| node_exception_handling
node_product_service -->|"reads and writes"| node_repositories
node_cart_service -->|"reads and writes"| node_repositories
node_order_service -->|"reads and writes"| node_repositories
node_user_service -->|"reads and writes"| node_repositories
node_repositories -->|"maps records"| node_entities
node_repositories -->|"persists"| node_postgres
node_security_config -.->|"configures"| node_jwt_filter
node_jwt_filter -->|"validates token"| node_jwt_service
node_jwt_filter -->|"loads user"| node_user_details
node_user_service -->|"generates token"| node_jwt_service
node_security_config -.->|"permits login"| node_user_controller

click node_app "https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/ecommercefrontend/src/App.tsx"
click node_navigation "https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/ecommercefrontend/src/components/common/navbar/mainNav.tsx"
click node_landing "https://github.com/ashimsharma337/springboot-react-ecommerce/tree/main/ecommercefrontend/src/components/landing"
click node_product_grid "https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/ecommercefrontend/src/components/landing/ProductGrid.tsx"
click node_product_detail "https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/ecommercefrontend/src/components/product-detail/ProductDetail.tsx"
click node_detail_views "https://github.com/ashimsharma337/springboot-react-ecommerce/tree/main/ecommercefrontend/src/components/product-detail"
click node_catalog_data "https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/ecommercefrontend/src/data/storefront.ts"
click node_detail_data "https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/ecommercefrontend/src/data/studioOneDetail.ts"
click node_login "https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/ecommercefrontend/src/components/login/login.tsx"
click node_browser_storage "https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/ecommercefrontend/src/App.tsx"
click node_user_controller "https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/controller/UserController.java"
click node_product_controller "https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/controller/ProductController.java"
click node_cart_controller "https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/controller/CartController.java"
click node_order_controller "https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/controller/OrderController.java"
click node_user_service "https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/service/UserServiceImpl.java"
click node_product_service "https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/service/ProductServiceImpl.java"
click node_cart_service "https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/service/CartServiceImpl.java"
click node_order_service "https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/service/OrderServiceImpl.java"
click node_exception_handling "https://github.com/ashimsharma337/springboot-react-ecommerce/tree/main/EcommerceBackend/src/main/java/com/ashim/exceptions"
click node_security_config "https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/config/SecurityConfig.java"
click node_jwt_filter "https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/config/JwtFilter.java"
click node_jwt_service "https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/service/JWTService.java"
click node_user_details "https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/service/UserDetailsServiceImpl.java"
click node_repositories "https://github.com/ashimsharma337/springboot-react-ecommerce/tree/main/EcommerceBackend/src/main/java/com/ashim/dao"
click node_entities "https://github.com/ashimsharma337/springboot-react-ecommerce/tree/main/EcommerceBackend/src/main/java/com/ashim/entity"

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_app,node_navigation,node_landing,node_product_grid,node_product_detail,node_detail_views,node_catalog_data,node_detail_data,node_login,node_browser_storage toneBlue
class node_security_config,node_jwt_filter,node_jwt_service,node_user_details toneAmber
class node_api_client,node_user_controller,node_product_controller,node_cart_controller,node_order_controller,node_user_service,node_product_service,node_cart_service,node_order_service,node_exception_handling toneMint
class node_repositories,node_entities,node_postgres toneRose
class node_browser toneIndigo
```

## Components

### Storefront UI

- [App Router](https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/ecommercefrontend/src/App.tsx): `ecommercefrontend/src/App.tsx`
- [Main Navigation](https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/ecommercefrontend/src/components/common/navbar/mainNav.tsx): `ecommercefrontend/src/components/common/navbar/mainNav.tsx`
- [Storefront Sections](https://github.com/ashimsharma337/springboot-react-ecommerce/tree/main/ecommercefrontend/src/components/landing): `ecommercefrontend/src/components/landing`
- [Product Grid](https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/ecommercefrontend/src/components/landing/ProductGrid.tsx): `ecommercefrontend/src/components/landing/ProductGrid.tsx`
- [Product Detail](https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/ecommercefrontend/src/components/product-detail/ProductDetail.tsx): `ecommercefrontend/src/components/product-detail/ProductDetail.tsx`
- [Detail Views](https://github.com/ashimsharma337/springboot-react-ecommerce/tree/main/ecommercefrontend/src/components/product-detail): `ecommercefrontend/src/components/product-detail`
- [Catalog Data](https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/ecommercefrontend/src/data/storefront.ts): `ecommercefrontend/src/data/storefront.ts`
- [Product Detail Data](https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/ecommercefrontend/src/data/studioOneDetail.ts): `ecommercefrontend/src/data/studioOneDetail.ts`
- [Login Form](https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/ecommercefrontend/src/components/login/login.tsx): `ecommercefrontend/src/components/login/login.tsx`
- [Browser Token Storage](https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/ecommercefrontend/src/App.tsx): `ecommercefrontend/src/App.tsx`

### Identity and Security

- [Security Configuration](https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/config/SecurityConfig.java): `EcommerceBackend/src/main/java/com/ashim/config/SecurityConfig.java`
- [JWT Filter](https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/config/JwtFilter.java): `EcommerceBackend/src/main/java/com/ashim/config/JwtFilter.java`
- [JWT Service](https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/service/JWTService.java): `EcommerceBackend/src/main/java/com/ashim/service/JWTService.java`
- [User Loading](https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/service/UserDetailsServiceImpl.java): `EcommerceBackend/src/main/java/com/ashim/service/UserDetailsServiceImpl.java`

### REST API and Services

- **REST API**
- [User Endpoints](https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/controller/UserController.java): `EcommerceBackend/src/main/java/com/ashim/controller/UserController.java`
- [Product Endpoints](https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/controller/ProductController.java): `EcommerceBackend/src/main/java/com/ashim/controller/ProductController.java`
- [Cart Endpoints](https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/controller/CartController.java): `EcommerceBackend/src/main/java/com/ashim/controller/CartController.java`
- [Order Endpoints](https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/controller/OrderController.java): `EcommerceBackend/src/main/java/com/ashim/controller/OrderController.java`
- [User Service](https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/service/UserServiceImpl.java): `EcommerceBackend/src/main/java/com/ashim/service/UserServiceImpl.java`
- [Product Service](https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/service/ProductServiceImpl.java): `EcommerceBackend/src/main/java/com/ashim/service/ProductServiceImpl.java`
- [Cart Service](https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/service/CartServiceImpl.java): `EcommerceBackend/src/main/java/com/ashim/service/CartServiceImpl.java`
- [Order Service](https://github.com/ashimsharma337/springboot-react-ecommerce/blob/main/EcommerceBackend/src/main/java/com/ashim/service/OrderServiceImpl.java): `EcommerceBackend/src/main/java/com/ashim/service/OrderServiceImpl.java`
- [Exception Handling](https://github.com/ashimsharma337/springboot-react-ecommerce/tree/main/EcommerceBackend/src/main/java/com/ashim/exceptions): `EcommerceBackend/src/main/java/com/ashim/exceptions`

### Persistence

- [JPA Repositories](https://github.com/ashimsharma337/springboot-react-ecommerce/tree/main/EcommerceBackend/src/main/java/com/ashim/dao): `EcommerceBackend/src/main/java/com/ashim/dao`
- [Domain Entities](https://github.com/ashimsharma337/springboot-react-ecommerce/tree/main/EcommerceBackend/src/main/java/com/ashim/entity): `EcommerceBackend/src/main/java/com/ashim/entity`
- **PostgreSQL**

### Other components

- **Shopper**

## Connections

- Shopper → App Router: uses (evidence: `README.md`)
- App Router → Main Navigation: renders (evidence: `ecommercefrontend/src/App.tsx`)
- App Router → Storefront Sections: renders (evidence: `ecommercefrontend/src/App.tsx`)
- App Router → Product Grid: renders (evidence: `ecommercefrontend/src/App.tsx`)
- App Router → Product Detail: routes to (evidence: `ecommercefrontend/src/App.tsx`)
- App Router → Login Form: renders (evidence: `ecommercefrontend/src/App.tsx`)
- App Router → Catalog Data: reads (evidence: `ecommercefrontend/src/App.tsx`)
- Product Grid → Catalog Data: renders data (evidence: `ecommercefrontend/src/components/landing/ProductGrid.tsx`)
- Product Detail → Detail Views: renders (evidence: `ecommercefrontend/src/components/product-detail/ProductDetail.tsx`)
- Product Detail → Product Detail Data: reads (evidence: `ecommercefrontend/src/components/product-detail/ProductDetail.tsx`)
- Detail Views → Product Detail Data: renders data (evidence: `ecommercefrontend/src/components/product-detail/ProductInformation.tsx`)
- Login Form → REST API: posts credentials (evidence: `README.md`)
- REST API → User Endpoints: routes login (evidence: `README.md`)
- Login Form → Browser Token Storage: stores token (evidence: `README.md`)
- Shopper → Product Grid: browses
- Product Endpoints → Product Service: delegates (evidence: `EcommerceBackend/src/main/java/com/ashim/controller/ProductController.java`)
- Cart Endpoints → Cart Service: delegates (evidence: `EcommerceBackend/src/main/java/com/ashim/controller/CartController.java`)
- Order Endpoints → Order Service: delegates (evidence: `EcommerceBackend/src/main/java/com/ashim/controller/OrderController.java`)
- User Endpoints → User Service: delegates (evidence: `EcommerceBackend/src/main/java/com/ashim/controller/UserController.java`)
- User Endpoints → Exception Handling: handled errors
- Product Service → Exception Handling: raises errors (evidence: `EcommerceBackend/src/main/java/com/ashim/service/ProductServiceImpl.java`)
- Order Service → Exception Handling: raises errors (evidence: `EcommerceBackend/src/main/java/com/ashim/service/OrderServiceImpl.java`)
- User Service → Exception Handling: raises errors (evidence: `EcommerceBackend/src/main/java/com/ashim/service/UserServiceImpl.java`)
- Product Service → JPA Repositories: reads and writes (evidence: `EcommerceBackend/src/main/java/com/ashim/service/ProductServiceImpl.java`)
- Cart Service → JPA Repositories: reads and writes (evidence: `EcommerceBackend/src/main/java/com/ashim/service/CartServiceImpl.java`)
- Order Service → JPA Repositories: reads and writes (evidence: `EcommerceBackend/src/main/java/com/ashim/service/OrderServiceImpl.java`)
- User Service → JPA Repositories: reads and writes (evidence: `EcommerceBackend/src/main/java/com/ashim/service/UserServiceImpl.java`)
- JPA Repositories → Domain Entities: maps records (evidence: `EcommerceBackend/src/main/java/com/ashim/dao/IProductRepository.java`)
- JPA Repositories → PostgreSQL: persists (evidence: `README.md`)
- Security Configuration → JWT Filter: configures
- JWT Filter → JWT Service: validates token (evidence: `EcommerceBackend/src/main/java/com/ashim/config/JwtFilter.java`)
- JWT Filter → User Loading: loads user (evidence: `README.md`)
- User Service → JWT Service: generates token (evidence: `EcommerceBackend/src/main/java/com/ashim/service/UserServiceImpl.java`)
- Security Configuration → User Endpoints: permits login
