# chowdamashok/shopecom architecture

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

- Interactive diagram: https://gitdiagram.com/chowdamashok/shopecom
- Repository: https://github.com/chowdamashok/shopecom

## Overview

ShopEcom is a React storefront backed by a Spring Boot REST API, with PostgreSQL persistence and Groq-powered AI features. The main user journey spans catalog discovery, cart and checkout, order tracking, and account features; admins also manage products, categories, orders, and analytics. The graph follows documented capabilities and the shown frontend routing and review/auth implementation. Most backend services and integrations are not sampled, so their links are documented or marked unverified rather than inferred from file names.

Main entry points: [`frontend/src/App.jsx`](https://github.com/chowdamashok/shopecom/blob/main/frontend/src/App.jsx) (React application), [`frontend/src/api/axios.js`](https://github.com/chowdamashok/shopecom/blob/main/frontend/src/api/axios.js) (HTTP client), [`backend/src/main/java/com/ecom/backend/controller`](https://github.com/chowdamashok/shopecom/tree/main/backend/src/main/java/com/ecom/backend/controller) (REST controllers), [`frontend/src/components/product/ReviewSection.jsx`](https://github.com/chowdamashok/shopecom/blob/main/frontend/src/components/product/ReviewSection.jsx) (Review interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_webapp["React application<br/>[App.jsx]"]
  node_catalogui["Catalog &amp; product pages<br/>[ProductsPage.jsx]"]
  node_cartcheckout["Cart &amp; checkout<br/>[CheckoutPage.jsx]"]
  node_ordersui["Order history &amp; tracking"]
  node_adminui["Admin &amp; analytics<br/>[AdminPage.jsx]"]
  node_reviewui["Review interface<br/>[ReviewSection.jsx]"]
  node_profileui["Profile &amp; addresses<br/>[ProfilePage.jsx]"]
  node_httpclient["HTTP client<br/>[axios.js]"]
  node_aiui["AI shopping assistant<br/>[AIChatbot.jsx]"]
end

subgraph group_commerce["Commerce API"]
  node_controllers["REST controllers"]
  node_commerce_services["Commerce services"]
  node_review_logic["Review service"]
  node_review_contracts["Review API contracts<br/>[ReviewRequest.java]"]
end

subgraph group_identity["Identity &amp; accounts"]
  node_auth_logic["Authentication service"]
  node_security["JWT security"]
  node_profile_logic["Profile services"]
end

subgraph group_persistence["Persistence"]
  node_repositories["Data repositories"]
  node_entities["Commerce entities"]
  node_review_entity["Review &amp; product model<br/>[Review.java]"]
end

subgraph group_integrations["External services"]
  node_groq{{"Groq AI API"}}
  node_postgres[("Neon PostgreSQL")]
end

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

node_shopper -->|"uses"| node_webapp
node_admin -->|"administers"| node_webapp
node_webapp -->|"routes to"| node_catalogui
node_webapp -->|"routes to"| node_cartcheckout
node_webapp -->|"routes to"| node_ordersui
node_webapp -->|"routes to"| node_adminui
node_webapp -->|"routes to"| node_profileui
node_webapp -.->|"renders"| node_reviewui
node_webapp -->|"renders"| node_aiui
node_catalogui -.->|"requests data"| node_httpclient
node_cartcheckout -.->|"requests data"| node_httpclient
node_ordersui -.->|"requests data"| node_httpclient
node_adminui -.->|"requests data"| node_httpclient
node_profileui -.->|"requests data"| node_httpclient
node_reviewui -.->|"loads API client"| node_httpclient
node_reviewui -->|"summarizes reviews"| node_groq
node_aiui -.->|"requests AI"| node_groq
node_httpclient -.->|"calls REST API"| node_controllers
node_controllers -.->|"delegates"| node_commerce_services
node_controllers -->|"delegates"| node_review_logic
node_controllers -.->|"delegates"| node_auth_logic
node_controllers -->|"delegates"| node_profile_logic
node_controllers -->|"looks up user"| node_repositories
node_review_logic -->|"reads &amp; writes"| node_repositories
node_auth_logic -->|"reads &amp; writes"| node_repositories
node_auth_logic -->|"issues tokens"| node_security
node_review_logic -->|"maps reviews"| node_review_entity
node_reviewui -.->|"submits reviews"| node_review_contracts
node_commerce_services -.->|"uses domain model"| node_entities
node_repositories -.->|"persists entities"| node_postgres

click node_webapp "https://github.com/chowdamashok/shopecom/blob/main/frontend/src/App.jsx"
click node_catalogui "https://github.com/chowdamashok/shopecom/blob/main/frontend/src/pages/product/ProductsPage.jsx"
click node_cartcheckout "https://github.com/chowdamashok/shopecom/blob/main/frontend/src/pages/order/CheckoutPage.jsx"
click node_ordersui "https://github.com/chowdamashok/shopecom/blob/main/frontend/src/pages/order/OrderTrackingPage.jsx"
click node_adminui "https://github.com/chowdamashok/shopecom/blob/main/frontend/src/pages/admin/AdminPage.jsx"
click node_reviewui "https://github.com/chowdamashok/shopecom/blob/main/frontend/src/components/product/ReviewSection.jsx"
click node_profileui "https://github.com/chowdamashok/shopecom/blob/main/frontend/src/pages/ProfilePage.jsx"
click node_httpclient "https://github.com/chowdamashok/shopecom/blob/main/frontend/src/api/axios.js"
click node_aiui "https://github.com/chowdamashok/shopecom/blob/main/frontend/src/components/common/AIChatbot.jsx"
click node_controllers "https://github.com/chowdamashok/shopecom/tree/main/backend/src/main/java/com/ecom/backend/controller"
click node_commerce_services "https://github.com/chowdamashok/shopecom/tree/main/backend/src/main/java/com/ecom/backend/service"
click node_review_logic "https://github.com/chowdamashok/shopecom/blob/main/backend/src/main/java/com/ecom/backend/service/impl/ReviewServiceImpl.java"
click node_auth_logic "https://github.com/chowdamashok/shopecom/blob/main/backend/src/main/java/com/ecom/backend/service/impl/AuthServiceImpl.java"
click node_security "https://github.com/chowdamashok/shopecom/tree/main/backend/src/main/java/com/ecom/backend/security"
click node_profile_logic "https://github.com/chowdamashok/shopecom/blob/main/backend/src/main/java/com/ecom/backend/service/impl/UserProfileServiceImpl.java"
click node_repositories "https://github.com/chowdamashok/shopecom/tree/main/backend/src/main/java/com/ecom/backend/repository"
click node_entities "https://github.com/chowdamashok/shopecom/tree/main/backend/src/main/java/com/ecom/backend/entity"
click node_review_entity "https://github.com/chowdamashok/shopecom/blob/main/backend/src/main/java/com/ecom/backend/entity/Review.java"
click node_review_contracts "https://github.com/chowdamashok/shopecom/blob/main/backend/src/main/java/com/ecom/backend/dto/request/ReviewRequest.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_cartcheckout,node_ordersui,node_adminui,node_reviewui,node_profileui,node_httpclient,node_aiui toneBlue
class node_controllers,node_commerce_services,node_review_logic,node_review_contracts toneAmber
class node_auth_logic,node_security,node_profile_logic toneMint
class node_repositories,node_entities,node_review_entity toneRose
class node_groq,node_postgres,node_shopper,node_admin toneIndigo
```

## Components

### Storefront

- [React application](https://github.com/chowdamashok/shopecom/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Catalog & product pages](https://github.com/chowdamashok/shopecom/blob/main/frontend/src/pages/product/ProductsPage.jsx): `frontend/src/pages/product/ProductsPage.jsx`
- [Cart & checkout](https://github.com/chowdamashok/shopecom/blob/main/frontend/src/pages/order/CheckoutPage.jsx): `frontend/src/pages/order/CheckoutPage.jsx`
- [Order history & tracking](https://github.com/chowdamashok/shopecom/blob/main/frontend/src/pages/order/OrderTrackingPage.jsx): `frontend/src/pages/order/OrderTrackingPage.jsx`
- [Admin & analytics](https://github.com/chowdamashok/shopecom/blob/main/frontend/src/pages/admin/AdminPage.jsx): `frontend/src/pages/admin/AdminPage.jsx`
- [Review interface](https://github.com/chowdamashok/shopecom/blob/main/frontend/src/components/product/ReviewSection.jsx): `frontend/src/components/product/ReviewSection.jsx`
- [Profile & addresses](https://github.com/chowdamashok/shopecom/blob/main/frontend/src/pages/ProfilePage.jsx): `frontend/src/pages/ProfilePage.jsx`
- [HTTP client](https://github.com/chowdamashok/shopecom/blob/main/frontend/src/api/axios.js): `frontend/src/api/axios.js`
- [AI shopping assistant](https://github.com/chowdamashok/shopecom/blob/main/frontend/src/components/common/AIChatbot.jsx): `frontend/src/components/common/AIChatbot.jsx`

### Commerce API

- [REST controllers](https://github.com/chowdamashok/shopecom/tree/main/backend/src/main/java/com/ecom/backend/controller): `backend/src/main/java/com/ecom/backend/controller`
- [Commerce services](https://github.com/chowdamashok/shopecom/tree/main/backend/src/main/java/com/ecom/backend/service): `backend/src/main/java/com/ecom/backend/service`
- [Review service](https://github.com/chowdamashok/shopecom/blob/main/backend/src/main/java/com/ecom/backend/service/impl/ReviewServiceImpl.java): `backend/src/main/java/com/ecom/backend/service/impl/ReviewServiceImpl.java`
- [Review API contracts](https://github.com/chowdamashok/shopecom/blob/main/backend/src/main/java/com/ecom/backend/dto/request/ReviewRequest.java): `backend/src/main/java/com/ecom/backend/dto/request/ReviewRequest.java`

### Identity & accounts

- [Authentication service](https://github.com/chowdamashok/shopecom/blob/main/backend/src/main/java/com/ecom/backend/service/impl/AuthServiceImpl.java): `backend/src/main/java/com/ecom/backend/service/impl/AuthServiceImpl.java`
- [JWT security](https://github.com/chowdamashok/shopecom/tree/main/backend/src/main/java/com/ecom/backend/security): `backend/src/main/java/com/ecom/backend/security`
- [Profile services](https://github.com/chowdamashok/shopecom/blob/main/backend/src/main/java/com/ecom/backend/service/impl/UserProfileServiceImpl.java): `backend/src/main/java/com/ecom/backend/service/impl/UserProfileServiceImpl.java`

### Persistence

- [Data repositories](https://github.com/chowdamashok/shopecom/tree/main/backend/src/main/java/com/ecom/backend/repository): `backend/src/main/java/com/ecom/backend/repository`
- [Commerce entities](https://github.com/chowdamashok/shopecom/tree/main/backend/src/main/java/com/ecom/backend/entity): `backend/src/main/java/com/ecom/backend/entity`
- [Review & product model](https://github.com/chowdamashok/shopecom/blob/main/backend/src/main/java/com/ecom/backend/entity/Review.java): `backend/src/main/java/com/ecom/backend/entity/Review.java`

### External services

- **Groq AI API**
- **Neon PostgreSQL**

### Other components

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

## Connections

- Shopper → React application: uses
- Administrator → React application: administers
- React application → Catalog & product pages: routes to (evidence: `frontend/src/App.jsx`)
- React application → Cart & checkout: routes to (evidence: `frontend/src/App.jsx`)
- React application → Order history & tracking: routes to (evidence: `frontend/src/App.jsx`)
- React application → Admin & analytics: routes to (evidence: `frontend/src/App.jsx`)
- React application → Profile & addresses: routes to (evidence: `frontend/src/App.jsx`)
- React application → Review interface: renders
- React application → AI shopping assistant: renders (evidence: `frontend/src/App.jsx`)
- Catalog & product pages → HTTP client: requests data
- Cart & checkout → HTTP client: requests data
- Order history & tracking → HTTP client: requests data
- Admin & analytics → HTTP client: requests data (evidence: `frontend/src/pages/admin/AdminPage.jsx`)
- Profile & addresses → HTTP client: requests data (evidence: `frontend/src/pages/ProfilePage.jsx`)
- Review interface → HTTP client: loads API client
- Review interface → Groq AI API: summarizes reviews (evidence: `frontend/src/components/product/ReviewSection.jsx`)
- AI shopping assistant → Groq AI API: requests AI
- HTTP client → REST controllers: calls REST API
- REST controllers → Commerce services: delegates (evidence: `backend/src/main/java/com/ecom/backend/controller/ReviewController.java`)
- REST controllers → Review service: delegates (evidence: `backend/src/main/java/com/ecom/backend/controller/ReviewController.java`)
- REST controllers → Authentication service: delegates
- REST controllers → Profile services: delegates (evidence: `backend/src/main/java/com/ecom/backend/controller/UserProfileController.java`)
- REST controllers → Data repositories: looks up user (evidence: `backend/src/main/java/com/ecom/backend/controller/ReviewController.java`)
- Review service → Data repositories: reads & writes (evidence: `backend/src/main/java/com/ecom/backend/service/impl/ReviewServiceImpl.java`)
- Authentication service → Data repositories: reads & writes (evidence: `backend/src/main/java/com/ecom/backend/service/impl/AuthServiceImpl.java`)
- Authentication service → JWT security: issues tokens (evidence: `backend/src/main/java/com/ecom/backend/service/impl/AuthServiceImpl.java`)
- Review service → Review & product model: maps reviews (evidence: `backend/src/main/java/com/ecom/backend/service/impl/ReviewServiceImpl.java`)
- Review interface → Review API contracts: submits reviews
- Commerce services → Commerce entities: uses domain model (evidence: `backend/src/main/java/com/ecom/backend/service/impl/ReviewServiceImpl.java`)
- Data repositories → Neon PostgreSQL: persists entities
