# duonghuuthanh/cs2301testingdemov1 architecture

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

- Interactive diagram: https://gitdiagram.com/duonghuuthanh/cs2301testingdemov1
- Repository: https://github.com/duonghuuthanh/cs2301testingdemov1

## Overview

This is a Flask e-commerce application: shoppers browse and filter products, register or log in, maintain a session cart, and submit a purchase that creates receipt records. The admin area manages catalog data and displays sales statistics. The README provides no capability detail; the graph uses the sampled runtime sources, and leaves template/UI rendering details and unsampled wiring out where relationships are not evidenced.

Main entry points: [`saleappv1/eapp/dao.py`](https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/dao.py) (Data access), [`saleappv1/eapp/index.py`](https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/index.py) (Store routes), [`saleappv1/eapp/admin.py`](https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/admin.py) (Admin views), [`saleappv1/eapp/__init__.py`](https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/__init__.py) (Login manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shop["Shopping workflow"]
  node_routes["Store routes<br/>[index.py]"]
  node_cart_ui["Cart controls<br/>[main.js]"]
  node_cart_stats["Cart totals<br/>[utils.py]"]
  node_cart_session[("Session cart<br/>[index.py]")]
end

subgraph group_identity["Accounts"]
  node_account_routes["Account routes<br/>[index.py]"]
  node_auth["Login manager<br/>[__init__.py]"]
end

subgraph group_data["Catalog and persistence"]
  node_users[("User records<br/>[models.py]")]
  node_catalog[("Catalog records<br/>[models.py]")]
  node_receipts[("Receipt records<br/>[models.py]")]
  node_dao["Data access<br/>[dao.py]"]
end

subgraph group_admin["Administration"]
  node_admin_ui["Admin views<br/>[admin.py]"]
end

node_shopper(("Shopper"))
node_cloudinary["Cloudinary"]

node_shopper -->|"uses store"| node_routes
node_routes -->|"loads products"| node_dao
node_routes -->|"calculates totals"| node_cart_stats
node_cart_ui -->|"calls cart APIs"| node_routes
node_routes -->|"reads and writes"| node_cart_session
node_routes -->|"creates receipt"| node_dao
node_shopper -->|"registers or logs in"| node_account_routes
node_account_routes -->|"authenticates or adds user"| node_dao
node_account_routes -->|"uses login functions"| node_auth
node_auth -->|"loads user"| node_dao
node_dao -->|"queries and writes"| node_users
node_dao -->|"queries products"| node_catalog
node_dao -->|"writes and aggregates"| node_receipts
node_dao -.->|"uploads avatar"| node_cloudinary
node_admin_ui -->|"requests statistics"| node_dao
node_admin_ui -->|"manages catalog"| node_catalog

click node_routes "https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/index.py"
click node_cart_ui "https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/static/js/main.js"
click node_cart_stats "https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/utils.py"
click node_cart_session "https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/index.py"
click node_account_routes "https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/index.py"
click node_auth "https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/__init__.py"
click node_users "https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/models.py"
click node_catalog "https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/models.py"
click node_receipts "https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/models.py"
click node_dao "https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/dao.py"
click node_admin_ui "https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/admin.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_routes,node_cart_ui,node_cart_stats,node_cart_session toneBlue
class node_account_routes,node_auth toneAmber
class node_users,node_catalog,node_receipts,node_dao toneMint
class node_admin_ui toneRose
class node_shopper,node_cloudinary toneIndigo
```

## Components

### Shopping workflow

- [Store routes](https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/index.py): `saleappv1/eapp/index.py`
- [Cart controls](https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/static/js/main.js): `saleappv1/eapp/static/js/main.js`
- [Cart totals](https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/utils.py): `saleappv1/eapp/utils.py`
- [Session cart](https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/index.py): `saleappv1/eapp/index.py`

### Accounts

- [Account routes](https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/index.py): `saleappv1/eapp/index.py`
- [Login manager](https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/__init__.py): `saleappv1/eapp/__init__.py`

### Catalog and persistence

- [User records](https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/models.py): `saleappv1/eapp/models.py`
- [Catalog records](https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/models.py): `saleappv1/eapp/models.py`
- [Receipt records](https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/models.py): `saleappv1/eapp/models.py`
- [Data access](https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/dao.py): `saleappv1/eapp/dao.py`

### Administration

- [Admin views](https://github.com/duonghuuthanh/cs2301testingdemov1/blob/main/saleappv1/eapp/admin.py): `saleappv1/eapp/admin.py`

### Other components

- **Shopper**
- **Cloudinary**

## Connections

- Shopper → Store routes: uses store (evidence: `saleappv1/eapp/index.py`)
- Store routes → Data access: loads products (evidence: `saleappv1/eapp/index.py`)
- Store routes → Cart totals: calculates totals (evidence: `saleappv1/eapp/index.py`)
- Cart controls → Store routes: calls cart APIs (evidence: `saleappv1/eapp/static/js/main.js`)
- Store routes → Session cart: reads and writes (evidence: `saleappv1/eapp/index.py`)
- Store routes → Data access: creates receipt (evidence: `saleappv1/eapp/index.py`)
- Shopper → Account routes: registers or logs in (evidence: `saleappv1/eapp/index.py`)
- Account routes → Data access: authenticates or adds user (evidence: `saleappv1/eapp/index.py`)
- Account routes → Login manager: uses login functions (evidence: `saleappv1/eapp/index.py`)
- Login manager → Data access: loads user (evidence: `saleappv1/eapp/dao.py`)
- Data access → User records: queries and writes (evidence: `saleappv1/eapp/dao.py`)
- Data access → Catalog records: queries products (evidence: `saleappv1/eapp/dao.py`)
- Data access → Receipt records: writes and aggregates (evidence: `saleappv1/eapp/dao.py`)
- Data access → Cloudinary: uploads avatar (evidence: `saleappv1/eapp/dao.py`)
- Admin views → Data access: requests statistics (evidence: `saleappv1/eapp/admin.py`)
- Admin views → Catalog records: manages catalog (evidence: `saleappv1/eapp/admin.py`)
