# sieunhangao889/eshop-sut architecture

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

- Interactive diagram: https://gitdiagram.com/sieunhangao889/eshop-sut
- Repository: https://github.com/sieunhangao889/eshop-sut

## Overview

EShop is a multi-client commerce system: shoppers browse products, manage a cart, authenticate, and place orders; users can also manage profiles and review order history. The backend serves the web, admin, and mobile clients and persists commerce data in SQLite. The admin client manages catalog, coupons, users, and order status. The README documents additional requirements, but sampled implementation excerpts are partial; unsampled feature wiring is shown only where the tree or documentation supports it.

Main entry points: [`backend/server.js`](https://github.com/sieunhangao889/eshop-sut/blob/main/backend/server.js) (Express API), [`frontend-web/src/App.jsx`](https://github.com/sieunhangao889/eshop-sut/blob/main/frontend-web/src/App.jsx) (Web app), [`backend/database.js`](https://github.com/sieunhangao889/eshop-sut/blob/main/backend/database.js) (SQLite database), [`frontend-web/src/context/AuthContext.jsx`](https://github.com/sieunhangao889/eshop-sut/blob/main/frontend-web/src/context/AuthContext.jsx) (Web authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shopper["Shopper experiences"]
  node_web["Web app<br/>[App.jsx]"]
  node_auth["Web authentication<br/>[AuthContext.jsx]"]
  node_catalog["Product browsing<br/>[Home.jsx]"]
  node_product["Product detail<br/>[ProductDetail.jsx]"]
  node_cart["Shopping cart<br/>[CartContext.jsx]"]
  node_checkout["Checkout<br/>[Checkout.jsx]"]
  node_profile["Profile and orders<br/>[Profile.jsx]"]
  node_mobile["Mobile app<br/>[App.js]"]
end

subgraph group_admin["Admin operations"]
  node_adminapp["Admin console<br/>[App.jsx]"]
end

subgraph group_api["Commerce API"]
  node_api["Express API<br/>[server.js]"]
  node_accounts["Accounts and access<br/>[server.js]"]
  node_catalogapi["Catalog management<br/>[server.js]"]
  node_orders["Orders and status<br/>[server.js]"]
  node_coupons["Coupon handling<br/>[server.js]"]
end

subgraph group_data["Persistent data"]
  node_sqlite[("SQLite database<br/>[database.js]")]
end

node_customer(("Shopper"))
node_adminuser(("Administrator"))

node_customer -->|"uses"| node_web
node_customer -->|"uses"| node_mobile
node_web -->|"provides auth"| node_auth
node_web -->|"routes to"| node_catalog
node_web -->|"routes to"| node_product
node_web -->|"provides cart"| node_cart
node_web -->|"routes to"| node_checkout
node_web -->|"routes to"| node_profile
node_auth -->|"requests account"| node_api
node_catalog -->|"fetches products"| node_api
node_product -->|"fetches product"| node_api
node_checkout -->|"submits order"| node_api
node_profile -->|"updates and reads"| node_api
node_mobile -->|"requests commerce"| node_api
node_adminuser -->|"uses"| node_adminapp
node_adminapp -->|"manages commerce"| node_api
node_api -->|"dispatches"| node_accounts
node_api -->|"dispatches"| node_catalogapi
node_api -->|"dispatches"| node_orders
node_api -->|"dispatches"| node_coupons
node_accounts -->|"reads and writes"| node_sqlite
node_catalogapi -->|"reads and writes"| node_sqlite
node_orders -->|"reads and writes"| node_sqlite
node_coupons -->|"reads and writes"| node_sqlite

click node_web "https://github.com/sieunhangao889/eshop-sut/blob/main/frontend-web/src/App.jsx"
click node_auth "https://github.com/sieunhangao889/eshop-sut/blob/main/frontend-web/src/context/AuthContext.jsx"
click node_catalog "https://github.com/sieunhangao889/eshop-sut/blob/main/frontend-web/src/pages/Home.jsx"
click node_product "https://github.com/sieunhangao889/eshop-sut/blob/main/frontend-web/src/pages/ProductDetail.jsx"
click node_cart "https://github.com/sieunhangao889/eshop-sut/blob/main/frontend-web/src/context/CartContext.jsx"
click node_checkout "https://github.com/sieunhangao889/eshop-sut/blob/main/frontend-web/src/pages/Checkout.jsx"
click node_profile "https://github.com/sieunhangao889/eshop-sut/blob/main/frontend-web/src/pages/Profile.jsx"
click node_mobile "https://github.com/sieunhangao889/eshop-sut/blob/main/frontend-mobile/App.js"
click node_adminapp "https://github.com/sieunhangao889/eshop-sut/blob/main/frontend-admin/src/App.jsx"
click node_api "https://github.com/sieunhangao889/eshop-sut/blob/main/backend/server.js"
click node_accounts "https://github.com/sieunhangao889/eshop-sut/blob/main/backend/server.js"
click node_catalogapi "https://github.com/sieunhangao889/eshop-sut/blob/main/backend/server.js"
click node_orders "https://github.com/sieunhangao889/eshop-sut/blob/main/backend/server.js"
click node_coupons "https://github.com/sieunhangao889/eshop-sut/blob/main/backend/server.js"
click node_sqlite "https://github.com/sieunhangao889/eshop-sut/blob/main/backend/database.js"

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_web,node_auth,node_catalog,node_product,node_cart,node_checkout,node_profile,node_mobile toneBlue
class node_adminapp toneAmber
class node_api,node_accounts,node_catalogapi,node_orders,node_coupons toneMint
class node_sqlite toneRose
class node_customer,node_adminuser toneIndigo
```

## Components

### Shopper experiences

- [Web app](https://github.com/sieunhangao889/eshop-sut/blob/main/frontend-web/src/App.jsx): `frontend-web/src/App.jsx`
- [Web authentication](https://github.com/sieunhangao889/eshop-sut/blob/main/frontend-web/src/context/AuthContext.jsx): `frontend-web/src/context/AuthContext.jsx`
- [Product browsing](https://github.com/sieunhangao889/eshop-sut/blob/main/frontend-web/src/pages/Home.jsx): `frontend-web/src/pages/Home.jsx`
- [Product detail](https://github.com/sieunhangao889/eshop-sut/blob/main/frontend-web/src/pages/ProductDetail.jsx): `frontend-web/src/pages/ProductDetail.jsx`
- [Shopping cart](https://github.com/sieunhangao889/eshop-sut/blob/main/frontend-web/src/context/CartContext.jsx): `frontend-web/src/context/CartContext.jsx`
- [Checkout](https://github.com/sieunhangao889/eshop-sut/blob/main/frontend-web/src/pages/Checkout.jsx): `frontend-web/src/pages/Checkout.jsx`
- [Profile and orders](https://github.com/sieunhangao889/eshop-sut/blob/main/frontend-web/src/pages/Profile.jsx): `frontend-web/src/pages/Profile.jsx`
- [Mobile app](https://github.com/sieunhangao889/eshop-sut/blob/main/frontend-mobile/App.js): `frontend-mobile/App.js`

### Admin operations

- [Admin console](https://github.com/sieunhangao889/eshop-sut/blob/main/frontend-admin/src/App.jsx): `frontend-admin/src/App.jsx`

### Commerce API

- [Express API](https://github.com/sieunhangao889/eshop-sut/blob/main/backend/server.js): `backend/server.js`
- [Accounts and access](https://github.com/sieunhangao889/eshop-sut/blob/main/backend/server.js): `backend/server.js`
- [Catalog management](https://github.com/sieunhangao889/eshop-sut/blob/main/backend/server.js): `backend/server.js`
- [Orders and status](https://github.com/sieunhangao889/eshop-sut/blob/main/backend/server.js): `backend/server.js`
- [Coupon handling](https://github.com/sieunhangao889/eshop-sut/blob/main/backend/server.js): `backend/server.js`

### Persistent data

- [SQLite database](https://github.com/sieunhangao889/eshop-sut/blob/main/backend/database.js): `backend/database.js`

### Other components

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

## Connections

- Shopper → Web app: uses
- Shopper → Mobile app: uses
- Web app → Web authentication: provides auth
- Web app → Product browsing: routes to
- Web app → Product detail: routes to
- Web app → Shopping cart: provides cart
- Web app → Checkout: routes to
- Web app → Profile and orders: routes to
- Web authentication → Express API: requests account
- Product browsing → Express API: fetches products
- Product detail → Express API: fetches product
- Checkout → Express API: submits order
- Profile and orders → Express API: updates and reads
- Mobile app → Express API: requests commerce
- Administrator → Admin console: uses
- Admin console → Express API: manages commerce
- Express API → Accounts and access: dispatches
- Express API → Catalog management: dispatches
- Express API → Orders and status: dispatches
- Express API → Coupon handling: dispatches
- Accounts and access → SQLite database: reads and writes
- Catalog management → SQLite database: reads and writes
- Orders and status → SQLite database: reads and writes
- Coupon handling → SQLite database: reads and writes
