# revaldo007/e-commerce-platform architecture

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

- Interactive diagram: https://gitdiagram.com/revaldo007/e-commerce-platform
- Repository: https://github.com/revaldo007/e-commerce-platform

## Overview

Sable is a full-stack e-commerce storefront with customer shopping and a built-in admin catalog. Customers browse products, manage a locally persisted cart, authenticate, and submit checkout; the backend creates and tracks orders, using demo payment or Stripe, and the frontend presents confirmation and order history. Admins manage products, images, categories, and orders. The graph reflects documented capabilities and source-index references; some frontend-to-backend links are therefore shown as unverified rather than as directly inspected calls.

Main entry points: [`frontend/src/api/client.js`](https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/api/client.js) (HTTP client), [`frontend/src/App.jsx`](https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/App.jsx) (Route application), [`backend/app/routers/orders.py`](https://github.com/revaldo007/e-commerce-platform/blob/main/backend/app/routers/orders.py) (Checkout and orders), [`backend/app/main.py`](https://github.com/revaldo007/e-commerce-platform/blob/main/backend/app/main.py) (FastAPI application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app["Route application<br/>[App.jsx]"]
  node_browse["Product browsing<br/>[Home.jsx]"]
  node_product["Product detail<br/>[ProductDetail.jsx]"]
  node_cart["Cart and checkout<br/>[Cart.jsx]"]
  node_cartstate["Cart state<br/>[CartContext.jsx]"]
  node_ordersui["Order views<br/>[Orders.jsx]"]
  node_confirmation["Order confirmation"]
  node_adminui["Admin panel<br/>[AdminHome.jsx]"]
  node_adminproducts["Product management<br/>[AdminProducts.jsx]"]
  node_admincategories["Category management"]
  node_adminorders["Order management<br/>[AdminOrders.jsx]"]
end

subgraph group_identity["Identity"]
  node_authui["Authentication state<br/>[AuthContext.jsx]"]
  node_api["HTTP client<br/>[client.js]"]
  node_authroutes["Auth endpoints<br/>[auth.py]"]
  node_authcore["JWT and access control<br/>[auth.py]"]
end

subgraph group_commerce["Commerce API"]
  node_server["FastAPI application<br/>[main.py]"]
  node_productsapi["Product endpoints<br/>[products.py]"]
  node_categoriesapi["Category endpoints<br/>[categories.py]"]
  node_ordersapi["Checkout and orders<br/>[orders.py]"]
  node_schemas["API schemas<br/>[schemas.py]"]
  node_serializers["Money serializers<br/>[serializers.py]"]
end

subgraph group_data["Data and integrations"]
  node_models["Commerce models<br/>[models.py]"]
  node_database["Database sessions<br/>[database.py]"]
  node_postgres[("PostgreSQL")]
  node_stripe["Stripe Checkout"]
end

node_shopper(("Shopper"))

node_shopper -->|"uses storefront"| node_app
node_app -->|"routes to"| node_browse
node_app -->|"routes to"| node_product
node_app -->|"routes to"| node_cart
node_app -->|"routes to"| node_ordersui
node_app -->|"routes to"| node_confirmation
node_app -->|"routes to"| node_adminui
node_cart -->|"uses cart state"| node_cartstate
node_browse -->|"requests data"| node_api
node_product -->|"requests data"| node_api
node_cart -->|"submits checkout"| node_api
node_ordersui -->|"requests history"| node_api
node_confirmation -->|"loads order"| node_api
node_adminui -->|"routes to"| node_adminproducts
node_adminui -->|"routes to"| node_admincategories
node_adminui -->|"routes to"| node_adminorders
node_authui -->|"sends credentials"| node_api
node_api -.->|"calls API"| node_server
node_server -->|"registers router"| node_authroutes
node_server -->|"registers router"| node_productsapi
node_server -->|"registers router"| node_categoriesapi
node_server -->|"registers router"| node_ordersapi
node_authroutes -->|"uses JWT helpers"| node_authcore
node_productsapi -->|"uses sessions"| node_database
node_categoriesapi -->|"uses sessions"| node_database
node_ordersapi -->|"uses sessions"| node_database
node_ordersapi -->|"creates checkout"| node_stripe
node_stripe -->|"confirms by webhook"| node_ordersapi
node_productsapi -->|"converts money"| node_serializers
node_ordersapi -->|"serializes amounts"| node_serializers
node_database -->|"connects to"| node_postgres
node_authroutes -->|"validates payloads"| node_schemas
node_productsapi -->|"uses product schemas"| node_schemas
node_ordersapi -->|"uses order schemas"| node_schemas
node_productsapi -->|"queries products"| node_models
node_categoriesapi -->|"queries categories"| node_models
node_ordersapi -->|"creates orders"| node_models
node_authroutes -->|"queries users"| node_models
node_models -->|"uses declarative base"| node_database
node_adminproducts -.->|"manages catalog"| node_api
node_admincategories -->|"manages categories"| node_api
node_adminorders -.->|"manages orders"| node_api

click node_app "https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/App.jsx"
click node_browse "https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/pages/Home.jsx"
click node_product "https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/pages/ProductDetail.jsx"
click node_cart "https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/pages/Cart.jsx"
click node_cartstate "https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/context/CartContext.jsx"
click node_ordersui "https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/pages/Orders.jsx"
click node_confirmation "https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/pages/OrderConfirmation.jsx"
click node_adminui "https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/pages/admin/AdminHome.jsx"
click node_adminproducts "https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/pages/admin/AdminProducts.jsx"
click node_admincategories "https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/pages/admin/AdminCategories.jsx"
click node_adminorders "https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/pages/admin/AdminOrders.jsx"
click node_authui "https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/context/AuthContext.jsx"
click node_api "https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/api/client.js"
click node_authroutes "https://github.com/revaldo007/e-commerce-platform/blob/main/backend/app/routers/auth.py"
click node_authcore "https://github.com/revaldo007/e-commerce-platform/blob/main/backend/app/auth.py"
click node_server "https://github.com/revaldo007/e-commerce-platform/blob/main/backend/app/main.py"
click node_productsapi "https://github.com/revaldo007/e-commerce-platform/blob/main/backend/app/routers/products.py"
click node_categoriesapi "https://github.com/revaldo007/e-commerce-platform/blob/main/backend/app/routers/categories.py"
click node_ordersapi "https://github.com/revaldo007/e-commerce-platform/blob/main/backend/app/routers/orders.py"
click node_schemas "https://github.com/revaldo007/e-commerce-platform/blob/main/backend/app/schemas.py"
click node_serializers "https://github.com/revaldo007/e-commerce-platform/blob/main/backend/app/serializers.py"
click node_models "https://github.com/revaldo007/e-commerce-platform/blob/main/backend/app/models.py"
click node_database "https://github.com/revaldo007/e-commerce-platform/blob/main/backend/app/database.py"

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_product,node_cart,node_cartstate,node_ordersui,node_confirmation,node_adminui,node_adminproducts,node_admincategories,node_adminorders toneBlue
class node_authui,node_api,node_authroutes,node_authcore toneAmber
class node_server,node_productsapi,node_categoriesapi,node_ordersapi,node_schemas,node_serializers toneMint
class node_models,node_database,node_postgres,node_stripe toneRose
class node_shopper toneIndigo
```

## Components

### Storefront

- [Route application](https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Product browsing](https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Product detail](https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/pages/ProductDetail.jsx): `frontend/src/pages/ProductDetail.jsx`
- [Cart and checkout](https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/pages/Cart.jsx): `frontend/src/pages/Cart.jsx`
- [Cart state](https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/context/CartContext.jsx): `frontend/src/context/CartContext.jsx`
- [Order views](https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/pages/Orders.jsx): `frontend/src/pages/Orders.jsx`
- [Order confirmation](https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/pages/OrderConfirmation.jsx): `frontend/src/pages/OrderConfirmation.jsx`
- [Admin panel](https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/pages/admin/AdminHome.jsx): `frontend/src/pages/admin/AdminHome.jsx`
- [Product management](https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/pages/admin/AdminProducts.jsx): `frontend/src/pages/admin/AdminProducts.jsx`
- [Category management](https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/pages/admin/AdminCategories.jsx): `frontend/src/pages/admin/AdminCategories.jsx`
- [Order management](https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/pages/admin/AdminOrders.jsx): `frontend/src/pages/admin/AdminOrders.jsx`

### Identity

- [Authentication state](https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [HTTP client](https://github.com/revaldo007/e-commerce-platform/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`
- [Auth endpoints](https://github.com/revaldo007/e-commerce-platform/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [JWT and access control](https://github.com/revaldo007/e-commerce-platform/blob/main/backend/app/auth.py): `backend/app/auth.py`

### Commerce API

- [FastAPI application](https://github.com/revaldo007/e-commerce-platform/blob/main/backend/app/main.py): `backend/app/main.py`
- [Product endpoints](https://github.com/revaldo007/e-commerce-platform/blob/main/backend/app/routers/products.py): `backend/app/routers/products.py`
- [Category endpoints](https://github.com/revaldo007/e-commerce-platform/blob/main/backend/app/routers/categories.py): `backend/app/routers/categories.py`
- [Checkout and orders](https://github.com/revaldo007/e-commerce-platform/blob/main/backend/app/routers/orders.py): `backend/app/routers/orders.py`
- [API schemas](https://github.com/revaldo007/e-commerce-platform/blob/main/backend/app/schemas.py): `backend/app/schemas.py`
- [Money serializers](https://github.com/revaldo007/e-commerce-platform/blob/main/backend/app/serializers.py): `backend/app/serializers.py`

### Data and integrations

- [Commerce models](https://github.com/revaldo007/e-commerce-platform/blob/main/backend/app/models.py): `backend/app/models.py`
- [Database sessions](https://github.com/revaldo007/e-commerce-platform/blob/main/backend/app/database.py): `backend/app/database.py`
- **PostgreSQL**
- **Stripe Checkout**

### Other components

- **Shopper**

## Connections

- Shopper → Route application: uses storefront (evidence: `frontend/src/App.jsx`)
- Route application → Product browsing: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Product detail: 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 → Order confirmation: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Admin panel: routes to (evidence: `frontend/src/App.jsx`)
- Cart and checkout → Cart state: uses cart state (evidence: `frontend/src/pages/Cart.jsx`)
- Product browsing → HTTP client: requests data (evidence: `frontend/src/pages/Home.jsx`)
- Product detail → HTTP client: requests data (evidence: `frontend/src/pages/ProductDetail.jsx`)
- Cart and checkout → HTTP client: submits checkout (evidence: `frontend/src/pages/Cart.jsx`)
- Order views → HTTP client: requests history (evidence: `frontend/src/pages/Orders.jsx`)
- Order confirmation → HTTP client: loads order (evidence: `frontend/src/pages/OrderConfirmation.jsx`)
- Admin panel → Product management: routes to (evidence: `frontend/src/pages/admin/AdminHome.jsx`)
- Admin panel → Category management: routes to (evidence: `frontend/src/pages/admin/AdminHome.jsx`)
- Admin panel → Order management: routes to (evidence: `frontend/src/pages/admin/AdminHome.jsx`)
- Authentication state → HTTP client: sends credentials (evidence: `frontend/src/context/AuthContext.jsx`)
- HTTP client → FastAPI application: calls API
- FastAPI application → Auth endpoints: registers router (evidence: `backend/app/main.py`)
- FastAPI application → Product endpoints: registers router (evidence: `backend/app/main.py`)
- FastAPI application → Category endpoints: registers router (evidence: `backend/app/main.py`)
- FastAPI application → Checkout and orders: registers router (evidence: `backend/app/main.py`)
- Auth endpoints → JWT and access control: uses JWT helpers (evidence: `backend/app/routers/auth.py`)
- Product endpoints → Database sessions: uses sessions (evidence: `backend/app/routers/products.py`)
- Category endpoints → Database sessions: uses sessions (evidence: `backend/app/routers/categories.py`)
- Checkout and orders → Database sessions: uses sessions (evidence: `backend/app/routers/orders.py`)
- Checkout and orders → Stripe Checkout: creates checkout (evidence: `README.md`)
- Stripe Checkout → Checkout and orders: confirms by webhook (evidence: `README.md`)
- Product endpoints → Money serializers: converts money (evidence: `backend/app/routers/products.py`)
- Checkout and orders → Money serializers: serializes amounts (evidence: `backend/app/routers/orders.py`)
- Database sessions → PostgreSQL: connects to (evidence: `README.md`)
- Auth endpoints → API schemas: validates payloads (evidence: `backend/app/routers/auth.py`)
- Product endpoints → API schemas: uses product schemas (evidence: `backend/app/routers/products.py`)
- Checkout and orders → API schemas: uses order schemas (evidence: `backend/app/routers/orders.py`)
- Product endpoints → Commerce models: queries products (evidence: `backend/app/routers/products.py`)
- Category endpoints → Commerce models: queries categories (evidence: `backend/app/routers/categories.py`)
- Checkout and orders → Commerce models: creates orders (evidence: `backend/app/routers/orders.py`)
- Auth endpoints → Commerce models: queries users (evidence: `backend/app/routers/auth.py`)
- Commerce models → Database sessions: uses declarative base (evidence: `backend/app/models.py`)
- Product management → HTTP client: manages catalog
- Category management → HTTP client: manages categories (evidence: `frontend/src/pages/admin/AdminCategories.jsx`)
- Order management → HTTP client: manages orders
