# banhluudanhphuoc/projectptsport_fe architecture

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

- Interactive diagram: https://gitdiagram.com/banhluudanhphuoc/projectptsport_fe
- Repository: https://github.com/banhluudanhphuoc/projectptsport_fe

## Overview

PT Sports is a React storefront with a separate administration interface. Shoppers browse the catalog, view products, manage a cart, and proceed to checkout; account, wishlist, and news pages provide related experiences. Administrators have routes for catalog, customer, order, discount, news, and dashboard work. The sampled files show route dispatch, storefront API calls, and layout dependencies; many admin page implementations were not sampled, so their internal relationships are not inferred.

Main entry points: [`src/router.js`](https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/router.js) (Route Dispatch), [`src/pages/users/theme/masterLayout/index.js`](https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/theme/masterLayout/index.js) (Store Layout), [`src/pages/users/productDetail/index.js`](https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/productDetail/index.js) (Product Detail), [`src/pages/users/blogsPage/index.js`](https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/blogsPage/index.js) (News Pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application Shell"]
  node_router["Route Dispatch<br/>[router.js]"]
  node_routekeys["Route Keys<br/>[router.js]"]
  node_i18n["Translations<br/>[i18n.js]"]
end

subgraph group_store["Storefront"]
  node_userlayout["Store Layout<br/>[index.js]"]
  node_home["Home &amp; Browse<br/>[index.js]"]
  node_category["Category Listing<br/>[index.js]"]
  node_product["Product Detail<br/>[index.js]"]
  node_cart["Shopping Cart<br/>[index.js]"]
  node_checkout["Checkout<br/>[index.js]"]
  node_confirmation["Order Confirmation<br/>[index.js]"]
  node_accounts["Customer Accounts<br/>[index.js]"]
  node_wishlist["Wishlist<br/>[index.js]"]
  node_news["News Pages<br/>[index.js]"]
end

subgraph group_admin["Administration"]
  node_adminlayout["Admin Layout<br/>[index.js]"]
  node_catalogadmin["Catalog Management"]
  node_ordersadmin["Order Management"]
  node_customersadmin["Customer Management"]
  node_contentadmin["Content &amp; Promotions"]
  node_dashboard["Sales Dashboard<br/>[index.js]"]
  node_charts["Order Analytics"]
end

subgraph group_shared["Shared UI"]
  node_banner["Page Banner<br/>[index.js]"]
  node_jquery["UI Behaviors<br/>[main.js]"]
  node_sticky["Sticky Scrolling<br/>[jquery.sticky.js]"]
end

node_shopper(("Shopper"))
node_adminuser(("Administrator"))
node_api{{"Backend API"}}

node_shopper -->|"opens pages"| node_router
node_adminuser -->|"opens admin"| node_router
node_router -->|"renders storefront"| node_userlayout
node_router -->|"routes to"| node_product
node_router -->|"routes to"| node_category
node_router -->|"routes to"| node_news
node_router -->|"renders admin"| node_adminlayout
node_router -->|"routes to edit"| node_catalogadmin
node_router -->|"routes to details"| node_ordersadmin
node_router -->|"routes to edit"| node_customersadmin
node_router -->|"routes to edit"| node_contentadmin
node_home -->|"updates cart"| node_api
node_checkout -->|"loads cart"| node_api
node_product -->|"renders"| node_banner
node_news -->|"renders"| node_banner
node_userlayout -->|"loads behavior"| node_jquery
node_userlayout -->|"loads plugin"| node_sticky

click node_router "https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/router.js"
click node_routekeys "https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/utils/router.js"
click node_i18n "https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/i18n.js"
click node_userlayout "https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/theme/masterLayout/index.js"
click node_home "https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/homePage/index.js"
click node_category "https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/categoryPage/index.js"
click node_product "https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/productDetail/index.js"
click node_cart "https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/cartPage/index.js"
click node_checkout "https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/checkoutPage/index.js"
click node_confirmation "https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/confirmation/index.js"
click node_accounts "https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/profileCustomer/index.js"
click node_wishlist "https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/wishList/index.js"
click node_news "https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/blogsPage/index.js"
click node_adminlayout "https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/admin/theme/masterLayoutAdmin/index.js"
click node_catalogadmin "https://github.com/banhluudanhphuoc/projectptsport_fe/tree/main/src/pages/admin/products"
click node_ordersadmin "https://github.com/banhluudanhphuoc/projectptsport_fe/tree/main/src/pages/admin/orders"
click node_customersadmin "https://github.com/banhluudanhphuoc/projectptsport_fe/tree/main/src/pages/admin/customers"
click node_contentadmin "https://github.com/banhluudanhphuoc/projectptsport_fe/tree/main/src/pages/admin/news"
click node_dashboard "https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/admin/dashBoard/index.js"
click node_charts "https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/components/admin/OrderAmountComparisonTable.js"
click node_banner "https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/theme/banner/index.js"
click node_jquery "https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/style/js/main.js"
click node_sticky "https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/style/js/jquery.sticky.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_router,node_routekeys,node_i18n toneBlue
class node_userlayout,node_home,node_category,node_product,node_cart,node_checkout,node_confirmation,node_accounts,node_wishlist,node_news toneAmber
class node_adminlayout,node_catalogadmin,node_ordersadmin,node_customersadmin,node_contentadmin,node_dashboard,node_charts,node_api toneMint
class node_banner,node_jquery,node_sticky toneRose
class node_shopper,node_adminuser toneIndigo
```

## Components

### Application Shell

- [Route Dispatch](https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/router.js): `src/router.js`
- [Route Keys](https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/utils/router.js): `src/utils/router.js`
- [Translations](https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/i18n.js): `src/i18n.js`

### Storefront

- [Store Layout](https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/theme/masterLayout/index.js): `src/pages/users/theme/masterLayout/index.js`
- [Home & Browse](https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/homePage/index.js): `src/pages/users/homePage/index.js`
- [Category Listing](https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/categoryPage/index.js): `src/pages/users/categoryPage/index.js`
- [Product Detail](https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/productDetail/index.js): `src/pages/users/productDetail/index.js`
- [Shopping Cart](https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/cartPage/index.js): `src/pages/users/cartPage/index.js`
- [Checkout](https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/checkoutPage/index.js): `src/pages/users/checkoutPage/index.js`
- [Order Confirmation](https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/confirmation/index.js): `src/pages/users/confirmation/index.js`
- [Customer Accounts](https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/profileCustomer/index.js): `src/pages/users/profileCustomer/index.js`
- [Wishlist](https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/wishList/index.js): `src/pages/users/wishList/index.js`
- [News Pages](https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/blogsPage/index.js): `src/pages/users/blogsPage/index.js`

### Administration

- [Admin Layout](https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/admin/theme/masterLayoutAdmin/index.js): `src/pages/admin/theme/masterLayoutAdmin/index.js`
- [Catalog Management](https://github.com/banhluudanhphuoc/projectptsport_fe/tree/main/src/pages/admin/products): `src/pages/admin/products`
- [Order Management](https://github.com/banhluudanhphuoc/projectptsport_fe/tree/main/src/pages/admin/orders): `src/pages/admin/orders`
- [Customer Management](https://github.com/banhluudanhphuoc/projectptsport_fe/tree/main/src/pages/admin/customers): `src/pages/admin/customers`
- [Content & Promotions](https://github.com/banhluudanhphuoc/projectptsport_fe/tree/main/src/pages/admin/news): `src/pages/admin/news`
- [Sales Dashboard](https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/admin/dashBoard/index.js): `src/pages/admin/dashBoard/index.js`
- [Order Analytics](https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/components/admin/OrderAmountComparisonTable.js): `src/components/admin/OrderAmountComparisonTable.js`

### Shared UI

- [Page Banner](https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/pages/users/theme/banner/index.js): `src/pages/users/theme/banner/index.js`
- [UI Behaviors](https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/style/js/main.js): `src/style/js/main.js`
- [Sticky Scrolling](https://github.com/banhluudanhphuoc/projectptsport_fe/blob/main/src/style/js/jquery.sticky.js): `src/style/js/jquery.sticky.js`

### Other components

- **Shopper**
- **Administrator**
- **Backend API**

## Connections

- Shopper → Route Dispatch: opens pages (evidence: `src/router.js`)
- Administrator → Route Dispatch: opens admin (evidence: `src/router.js`)
- Route Dispatch → Store Layout: renders storefront (evidence: `src/router.js`)
- Route Dispatch → Product Detail: routes to (evidence: `src/router.js`)
- Route Dispatch → Category Listing: routes to (evidence: `src/router.js`)
- Route Dispatch → News Pages: routes to (evidence: `src/router.js`)
- Route Dispatch → Admin Layout: renders admin (evidence: `src/router.js`)
- Route Dispatch → Catalog Management: routes to edit (evidence: `src/router.js`)
- Route Dispatch → Order Management: routes to details (evidence: `src/router.js`)
- Route Dispatch → Customer Management: routes to edit (evidence: `src/router.js`)
- Route Dispatch → Content & Promotions: routes to edit (evidence: `src/router.js`)
- Home & Browse → Backend API: updates cart (evidence: `src/pages/users/homePage/index.js`)
- Checkout → Backend API: loads cart (evidence: `src/pages/users/checkoutPage/index.js`)
- Product Detail → Page Banner: renders (evidence: `src/pages/users/productDetail/index.js`)
- News Pages → Page Banner: renders
- Store Layout → UI Behaviors: loads behavior (evidence: `src/pages/users/theme/masterLayout/index.js`)
- Store Layout → Sticky Scrolling: loads plugin (evidence: `src/pages/users/theme/masterLayout/index.js`)
