# dineshrajbhar-cloud/ecommerce-fullstack architecture

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

- Interactive diagram: https://gitdiagram.com/dineshrajbhar-cloud/ecommerce-fullstack
- Repository: https://github.com/dineshrajbhar-cloud/ecommerce-fullstack

## Overview

This is a full-stack e-commerce application. Shoppers browse and search products, manage a cart, check out, and view orders; administrators manage products, categories, users, and order status. The React client calls a Spring Boot REST API, whose services and repositories implement domain operations over PostgreSQL. README documents a Stripe PaymentIntent checkout integration, marked in progress. Source excerpts are selective, so some backend feature links reflect README-level architecture rather than inspected implementation calls.

Main entry points: [`frontend/src/App.jsx`](https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/blob/main/frontend/src/App.jsx) (Route application), [`frontend/src/api/axios.js`](https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/blob/main/frontend/src/api/axios.js) (REST client), [`frontend/src/pages`](https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/tree/main/frontend/src/pages) (Cart and checkout), [`backend/src/main/java/com/ecommerce/project/controller`](https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/tree/main/backend/src/main/java/com/ecommerce/project/controller) (Commerce controllers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React storefront"]
  node_app["Route application<br/>[App.jsx]"]
  node_browse["Browse and search"]
  node_cartui["Cart and checkout"]
  node_ordersui["Order views"]
  node_adminui["Admin management"]
  node_authctx["Auth context<br/>[AuthContext.jsx]"]
  node_cartctx["Cart context<br/>[CartContext.jsx]"]
  node_api["REST client<br/>[axios.js]"]
  node_authapi["Auth endpoints<br/>[auth.js]"]
  node_productapi["Product endpoints<br/>[products.js]"]
  node_cartapi["Cart endpoints<br/>[cart.js]"]
  node_paymentapi["Payment endpoints<br/>[payments.js]"]
end

subgraph group_commerce["Commerce API"]
  node_controllers["Commerce controllers"]
  node_services["Domain services"]
end

subgraph group_identity["Identity and access"]
  node_authcontroller["Authentication API"]
  node_security["JWT security"]
end

subgraph group_persistence["Persistence and payments"]
  node_repos["JPA repositories"]
  node_database[("PostgreSQL")]
  node_stripe["Stripe PaymentIntent"]
end

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

node_shopper -->|"uses"| node_app
node_admin -->|"uses"| node_app
node_app -->|"routes to"| node_browse
node_app -->|"routes to"| node_cartui
node_app -->|"routes to"| node_ordersui
node_app -->|"routes to"| node_adminui
node_browse -->|"requests products"| node_productapi
node_cartui -.->|"uses cart state"| node_cartctx
node_cartctx -->|"calls"| node_cartapi
node_authctx -->|"calls"| node_authapi
node_adminui -->|"manages products"| node_productapi
node_api -->|"REST requests"| node_controllers
node_authapi -->|"uses"| node_api
node_productapi -.->|"uses"| node_api
node_cartapi -.->|"uses"| node_api
node_paymentapi -.->|"uses"| node_api
node_authcontroller -->|"authenticates with"| node_security
node_controllers -->|"delegates domain work"| node_services
node_services -->|"uses repositories"| node_repos
node_repos -->|"reads and writes"| node_database
node_cartui -.->|"checkout to order"| node_ordersui
node_paymentapi -.->|"creates intent"| node_stripe
node_controllers -.->|"payment processing"| node_stripe

click node_app "https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/blob/main/frontend/src/App.jsx"
click node_browse "https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/tree/main/frontend/src/pages"
click node_cartui "https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/tree/main/frontend/src/pages"
click node_ordersui "https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/tree/main/frontend/src/pages"
click node_adminui "https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/tree/main/frontend/src/pages/admin"
click node_authctx "https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/blob/main/frontend/src/context/AuthContext.jsx"
click node_cartctx "https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/blob/main/frontend/src/context/CartContext.jsx"
click node_api "https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/blob/main/frontend/src/api/axios.js"
click node_authapi "https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/blob/main/frontend/src/api/auth.js"
click node_productapi "https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/blob/main/frontend/src/api/products.js"
click node_cartapi "https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/blob/main/frontend/src/api/cart.js"
click node_paymentapi "https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/blob/main/frontend/src/api/payments.js"
click node_authcontroller "https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/blob/main/backend/src/main/java/com/ecommerce/project/controller/AuthController.java"
click node_security "https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/tree/main/backend/src/main/java/com/ecommerce/project/security"
click node_controllers "https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/tree/main/backend/src/main/java/com/ecommerce/project/controller"
click node_services "https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/tree/main/backend/src/main/java/com/ecommerce/project/service"
click node_repos "https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/tree/main/backend/src/main/java/com/ecommerce/project/repositories"

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_browse,node_cartui,node_ordersui,node_adminui,node_authctx,node_cartctx,node_api,node_authapi,node_productapi,node_cartapi,node_paymentapi toneBlue
class node_controllers,node_services toneAmber
class node_authcontroller,node_security toneMint
class node_repos,node_database,node_stripe toneRose
class node_shopper,node_admin toneIndigo
```

## Components

### React storefront

- [Route application](https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Browse and search](https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/tree/main/frontend/src/pages): `frontend/src/pages`
- [Cart and checkout](https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/tree/main/frontend/src/pages): `frontend/src/pages`
- [Order views](https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/tree/main/frontend/src/pages): `frontend/src/pages`
- [Admin management](https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/tree/main/frontend/src/pages/admin): `frontend/src/pages/admin`
- [Auth context](https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Cart context](https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/blob/main/frontend/src/context/CartContext.jsx): `frontend/src/context/CartContext.jsx`
- [REST client](https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/blob/main/frontend/src/api/axios.js): `frontend/src/api/axios.js`
- [Auth endpoints](https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/blob/main/frontend/src/api/auth.js): `frontend/src/api/auth.js`
- [Product endpoints](https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/blob/main/frontend/src/api/products.js): `frontend/src/api/products.js`
- [Cart endpoints](https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/blob/main/frontend/src/api/cart.js): `frontend/src/api/cart.js`
- [Payment endpoints](https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/blob/main/frontend/src/api/payments.js): `frontend/src/api/payments.js`

### Commerce API

- [Commerce controllers](https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/tree/main/backend/src/main/java/com/ecommerce/project/controller): `backend/src/main/java/com/ecommerce/project/controller`
- [Domain services](https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/tree/main/backend/src/main/java/com/ecommerce/project/service): `backend/src/main/java/com/ecommerce/project/service`

### Identity and access

- [Authentication API](https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/blob/main/backend/src/main/java/com/ecommerce/project/controller/AuthController.java): `backend/src/main/java/com/ecommerce/project/controller/AuthController.java`
- [JWT security](https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/tree/main/backend/src/main/java/com/ecommerce/project/security): `backend/src/main/java/com/ecommerce/project/security`

### Persistence and payments

- [JPA repositories](https://github.com/dineshrajbhar-cloud/ecommerce-fullstack/tree/main/backend/src/main/java/com/ecommerce/project/repositories): `backend/src/main/java/com/ecommerce/project/repositories`
- **PostgreSQL**
- **Stripe PaymentIntent**

### Other components

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

## Connections

- Shopper → Route application: uses (evidence: `README.md`)
- Administrator → Route application: uses (evidence: `README.md`)
- Route application → Browse and search: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Cart and checkout: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Order views: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Admin management: routes to (evidence: `frontend/src/App.jsx`)
- Browse and search → Product endpoints: requests products (evidence: `frontend/src/pages/SearchResults.jsx`)
- Cart and checkout → Cart context: uses cart state
- Cart context → Cart endpoints: calls (evidence: `frontend/src/context/CartContext.jsx`)
- Auth context → Auth endpoints: calls (evidence: `frontend/src/context/AuthContext.jsx`)
- Admin management → Product endpoints: manages products (evidence: `frontend/src/pages/admin/ManageProducts.jsx`)
- REST client → Commerce controllers: REST requests (evidence: `README.md`)
- Auth endpoints → REST client: uses (evidence: `frontend/src/api/auth.js`)
- Product endpoints → REST client: uses (evidence: `frontend/src/api/products.js`)
- Cart endpoints → REST client: uses
- Payment endpoints → REST client: uses
- Authentication API → JWT security: authenticates with (evidence: `backend/src/main/java/com/ecommerce/project/controller/AuthController.java`)
- Commerce controllers → Domain services: delegates domain work (evidence: `README.md`)
- Domain services → JPA repositories: uses repositories (evidence: `README.md`)
- JPA repositories → PostgreSQL: reads and writes (evidence: `README.md`)
- Cart and checkout → Order views: checkout to order (evidence: `README.md`)
- Payment endpoints → Stripe PaymentIntent: creates intent (evidence: `README.md`)
- Commerce controllers → Stripe PaymentIntent: payment processing (evidence: `README.md`)
