# kiet0407-eng/24ct2-tranthekiet architecture

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

- Interactive diagram: https://gitdiagram.com/kiet0407-eng/24ct2-tranthekiet
- Repository: https://github.com/kiet0407-eng/24ct2-tranthekiet

## Overview

AgriMarket is a React storefront with customer shopping, account, messaging and notification screens, plus an admin area for catalog and order management. The main customer flow is browsing products, viewing details, managing a cart and submitting an order; the sampled code shows product and order requests going to a local API. Shared cart and notification state are provided at app startup. The README is only a Vite template description, so product capabilities are inferred from routes and source. Unsampled pages are included where routes establish their role; their internal behavior is not assumed.

Main entry points: [`src/App.jsx`](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/App.jsx) (Route Application), [`src/store/CartContext.jsx`](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/store/CartContext.jsx) (Cart State), [`src/pages/ProductDetail/ProductDetail.jsx`](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/ProductDetail/ProductDetail.jsx) (Product Detail), [`src/pages/Shop/Shop.jsx`](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Shop/Shop.jsx) (Shop Catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app["Route Application<br/>[App.jsx]"]
  node_home["Home<br/>[Home.jsx]"]
  node_productdata["Product Data<br/>[data.js]"]
  node_productdetail["Product Detail<br/>[ProductDetail.jsx]"]
  node_shop["Shop Catalog<br/>[Shop.jsx]"]
  node_header["Store Header<br/>[Header.jsx]"]
  node_otherpages["Informational Pages"]
end

subgraph group_commerce["Shopping and Orders"]
  node_cart["Cart<br/>[Cart.jsx]"]
  node_checkout["Checkout<br/>[Checkout.jsx]"]
  node_orderhistory["Order History<br/>[OrderHistory.jsx]"]
  node_cartstate["Cart State<br/>[CartContext.jsx]"]
  node_userapi{{"User API"}}
end

subgraph group_customer["Customer Services"]
  node_auth["Customer Authentication"]
  node_profile["Profile<br/>[Profile.jsx]"]
  node_messages["Vendor Messages<br/>[Messages.jsx]"]
  node_notifications["Notifications"]
  node_notifystate["Notification State"]
end

subgraph group_admin["Administration"]
  node_adminlogin["Admin Login<br/>[AdminLogin.jsx]"]
  node_adminlayout["Admin Layout<br/>[AdminLayout.jsx]"]
  node_dashboard["Admin Dashboard<br/>[Dashboard.jsx]"]
  node_adminproducts["Product Management<br/>[AdminProducts.jsx]"]
  node_admincategories["Category Management"]
  node_adminorders["Order Management<br/>[AdminOrders.jsx]"]
end

node_shopper(("Shopper"))

node_shopper -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_productdetail
node_app -->|"routes to"| node_shop
node_app -->|"routes to"| node_cart
node_app -->|"routes to"| node_checkout
node_app -->|"routes to"| node_orderhistory
node_app -->|"routes to"| node_auth
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_messages
node_app -->|"routes to"| node_notifications
node_app -->|"renders"| node_header
node_app -->|"routes to"| node_otherpages
node_home -->|"uses"| node_cartstate
node_productdetail -->|"reads"| node_productdata
node_productdetail -->|"uses"| node_cartstate
node_shop -->|"fetches catalog"| node_userapi
node_shop -->|"uses"| node_cartstate
node_cart -->|"uses"| node_cartstate
node_checkout -->|"reads and clears"| node_cartstate
node_checkout -->|"submits order"| node_userapi
node_header -->|"reads count"| node_cartstate
node_header -->|"reads notifications"| node_notifystate
node_notifications -->|"uses"| node_notifystate
node_app -->|"routes to"| node_adminlogin
node_app -->|"routes to"| node_adminlayout
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_adminproducts
node_app -->|"routes to"| node_admincategories
node_app -->|"routes to"| node_adminorders

click node_app "https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/App.jsx"
click node_home "https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Home/Home.jsx"
click node_productdata "https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/data.js"
click node_productdetail "https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/ProductDetail/ProductDetail.jsx"
click node_shop "https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Shop/Shop.jsx"
click node_cart "https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Cart/Cart.jsx"
click node_checkout "https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Checkout/Checkout.jsx"
click node_orderhistory "https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Orders/OrderHistory.jsx"
click node_cartstate "https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/store/CartContext.jsx"
click node_auth "https://github.com/kiet0407-eng/24ct2-tranthekiet/tree/main/src/pages/Auth"
click node_profile "https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/User/Profile.jsx"
click node_messages "https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Messages/Messages.jsx"
click node_notifications "https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Notification/NotificationPage.jsx"
click node_notifystate "https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/store/NotificationContext.jsx"
click node_header "https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/components/Layout/Header.jsx"
click node_adminlogin "https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Admin/Auth/AdminLogin.jsx"
click node_adminlayout "https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Admin/components/AdminLayout.jsx"
click node_dashboard "https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Admin/Dashboard/Dashboard.jsx"
click node_adminproducts "https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Admin/Products/AdminProducts.jsx"
click node_admincategories "https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Admin/Categories/AdminCategories.jsx"
click node_adminorders "https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Admin/Orders/AdminOrders.jsx"
click node_otherpages "https://github.com/kiet0407-eng/24ct2-tranthekiet/tree/main/src/pages"

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_home,node_productdata,node_productdetail,node_shop,node_header,node_otherpages toneBlue
class node_cart,node_checkout,node_orderhistory,node_cartstate,node_userapi toneAmber
class node_auth,node_profile,node_messages,node_notifications,node_notifystate toneMint
class node_adminlogin,node_adminlayout,node_dashboard,node_adminproducts,node_admincategories,node_adminorders toneRose
class node_shopper toneIndigo
```

## Components

### Storefront

- [Route Application](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/App.jsx): `src/App.jsx`
- [Home](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Home/Home.jsx): `src/pages/Home/Home.jsx`
- [Product Data](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/data.js): `src/data.js`
- [Product Detail](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/ProductDetail/ProductDetail.jsx): `src/pages/ProductDetail/ProductDetail.jsx`
- [Shop Catalog](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Shop/Shop.jsx): `src/pages/Shop/Shop.jsx`
- [Store Header](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/components/Layout/Header.jsx): `src/components/Layout/Header.jsx`
- [Informational Pages](https://github.com/kiet0407-eng/24ct2-tranthekiet/tree/main/src/pages): `src/pages`

### Shopping and Orders

- [Cart](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Cart/Cart.jsx): `src/pages/Cart/Cart.jsx`
- [Checkout](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Checkout/Checkout.jsx): `src/pages/Checkout/Checkout.jsx`
- [Order History](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Orders/OrderHistory.jsx): `src/pages/Orders/OrderHistory.jsx`
- [Cart State](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/store/CartContext.jsx): `src/store/CartContext.jsx`
- **User API**

### Customer Services

- [Customer Authentication](https://github.com/kiet0407-eng/24ct2-tranthekiet/tree/main/src/pages/Auth): `src/pages/Auth`
- [Profile](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/User/Profile.jsx): `src/pages/User/Profile.jsx`
- [Vendor Messages](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Messages/Messages.jsx): `src/pages/Messages/Messages.jsx`
- [Notifications](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Notification/NotificationPage.jsx): `src/pages/Notification/NotificationPage.jsx`
- [Notification State](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/store/NotificationContext.jsx): `src/store/NotificationContext.jsx`

### Administration

- [Admin Login](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Admin/Auth/AdminLogin.jsx): `src/pages/Admin/Auth/AdminLogin.jsx`
- [Admin Layout](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Admin/components/AdminLayout.jsx): `src/pages/Admin/components/AdminLayout.jsx`
- [Admin Dashboard](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Admin/Dashboard/Dashboard.jsx): `src/pages/Admin/Dashboard/Dashboard.jsx`
- [Product Management](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Admin/Products/AdminProducts.jsx): `src/pages/Admin/Products/AdminProducts.jsx`
- [Category Management](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Admin/Categories/AdminCategories.jsx): `src/pages/Admin/Categories/AdminCategories.jsx`
- [Order Management](https://github.com/kiet0407-eng/24ct2-tranthekiet/blob/main/src/pages/Admin/Orders/AdminOrders.jsx): `src/pages/Admin/Orders/AdminOrders.jsx`

### Other components

- **Shopper**

## Connections

- Shopper → Route Application: opens (evidence: `src/App.jsx`)
- Route Application → Home: routes to (evidence: `src/App.jsx`)
- Route Application → Product Detail: routes to (evidence: `src/App.jsx`)
- Route Application → Shop Catalog: routes to (evidence: `src/App.jsx`)
- Route Application → Cart: routes to (evidence: `src/App.jsx`)
- Route Application → Checkout: routes to (evidence: `src/App.jsx`)
- Route Application → Order History: routes to (evidence: `src/App.jsx`)
- Route Application → Customer Authentication: routes to (evidence: `src/App.jsx`)
- Route Application → Profile: routes to (evidence: `src/App.jsx`)
- Route Application → Vendor Messages: routes to (evidence: `src/App.jsx`)
- Route Application → Notifications: routes to (evidence: `src/App.jsx`)
- Route Application → Store Header: renders (evidence: `src/App.jsx`)
- Route Application → Informational Pages: routes to (evidence: `src/App.jsx`)
- Home → Cart State: uses (evidence: `src/pages/Home/Home.jsx`)
- Product Detail → Product Data: reads (evidence: `src/pages/ProductDetail/ProductDetail.jsx`)
- Product Detail → Cart State: uses (evidence: `src/pages/ProductDetail/ProductDetail.jsx`)
- Shop Catalog → User API: fetches catalog (evidence: `src/pages/Shop/Shop.jsx`)
- Shop Catalog → Cart State: uses (evidence: `src/pages/Shop/Shop.jsx`)
- Cart → Cart State: uses (evidence: `src/pages/Cart/Cart.jsx`)
- Checkout → Cart State: reads and clears (evidence: `src/pages/Checkout/Checkout.jsx`)
- Checkout → User API: submits order (evidence: `src/pages/Checkout/Checkout.jsx`)
- Store Header → Cart State: reads count (evidence: `src/components/Layout/Header.jsx`)
- Store Header → Notification State: reads notifications (evidence: `src/components/Layout/Header.jsx`)
- Notifications → Notification State: uses (evidence: `src/pages/Notification/NotificationPage.jsx`)
- Route Application → Admin Login: routes to (evidence: `src/App.jsx`)
- Route Application → Admin Layout: routes to (evidence: `src/App.jsx`)
- Route Application → Admin Dashboard: routes to (evidence: `src/App.jsx`)
- Route Application → Product Management: routes to (evidence: `src/App.jsx`)
- Route Application → Category Management: routes to (evidence: `src/App.jsx`)
- Route Application → Order Management: routes to (evidence: `src/App.jsx`)
