# cuongvu0207/datn architecture

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

- Interactive diagram: https://gitdiagram.com/cuongvu0207/datn
- Repository: https://github.com/cuongvu0207/datn

## Overview

This is a browser-based retail management frontend: staff sign in, use routed workspaces for sales, inventory and imports, customers, invoices, finance, pricing, and demand forecasting, with results presented in tables, charts, or payment notifications. React pages own feature workflows and call shared API services; layout, theme, formatting, and pagination support those workflows. Forecasting also has a Python service in the tree, but its invocation and relationship to the forecast page are not shown, so that link is omitted. Edges reflect imports and calls visible in excerpts or the source index; unsampled feature internals are not inferred.

Main entry points: [`FE/src/App.jsx`](https://github.com/cuongvu0207/datn/blob/main/FE/src/App.jsx) (Routes and access), [`FE/src/services/api.js`](https://github.com/cuongvu0207/datn/blob/main/FE/src/services/api.js) (HTTP API config), [`FE/src/layouts/MainLayout.jsx`](https://github.com/cuongvu0207/datn/blob/main/FE/src/layouts/MainLayout.jsx) (Main workspace), [`FE/src/pages/SalesPage.jsx`](https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/SalesPage.jsx) (Sales checkout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_entry["React entry<br/>[main.jsx]"]
  node_routing["Routes and access<br/>[App.jsx]"]
  node_layout["Main workspace<br/>[MainLayout.jsx]"]
  node_login["Sign in<br/>[LoginPage.jsx]"]
end

subgraph group_commerce["Sales and invoices"]
  node_sales["Sales checkout<br/>[SalesPage.jsx]"]
  node_customerpanel["Customer and cart panel<br/>[CustomerPanel.jsx]"]
  node_printing["Invoice printing<br/>[printInvoice.js]"]
  node_invoicehistory["Invoice history"]
  node_invoicetable["Invoice table<br/>[InvoiceTable.jsx]"]
  node_paymentnotice["Payment notification"]
end

subgraph group_inventory["Products and imports"]
  node_products["Product catalog"]
  node_producteditor["Product editing<br/>[AddProductCard.jsx]"]
  node_pricing["Price management<br/>[SetPricePage.jsx]"]
  node_imports["Import records<br/>[ImportPage.jsx]"]
  node_importdetail["Import processing"]
  node_importtable["Import list"]
end

subgraph group_operations["Store operations"]
  node_customers["Customer management<br/>[CustomerPage.jsx]"]
  node_staffpage["Staff management<br/>[StaffPage.jsx]"]
  node_finance["Finance reports<br/>[FinancePage.jsx]"]
  node_home["Dashboard<br/>[HomePage.jsx]"]
  node_forecast["Demand forecasts"]
  node_forecastservice["Forecast service<br/>[ProphetService.py]"]
end

subgraph group_shared["Shared services"]
  node_theme["Theme state<br/>[ThemeContext.jsx]"]
  node_api["HTTP API config<br/>[api.js]"]
  node_format["Format utilities<br/>[formatters.js]"]
  node_pagination["Table pagination"]
end

node_staff(("Store staff"))
node_backend(("Retail API"))

node_staff -->|"opens"| node_entry
node_entry -->|"renders"| node_routing
node_routing -->|"provides"| node_theme
node_routing -->|"routes to"| node_login
node_routing -->|"routes to"| node_sales
node_routing -->|"routes to"| node_invoicehistory
node_routing -->|"routes to"| node_products
node_routing -->|"routes to"| node_pricing
node_routing -->|"routes to"| node_imports
node_routing -->|"routes to"| node_importdetail
node_routing -->|"routes to"| node_customers
node_routing -->|"routes to"| node_staffpage
node_routing -->|"routes to"| node_finance
node_routing -->|"routes to"| node_home
node_routing -->|"routes to"| node_forecast
node_routing -->|"routes to"| node_paymentnotice
node_sales -->|"renders within"| node_layout
node_home -->|"renders within"| node_layout
node_finance -->|"renders within"| node_layout
node_customers -->|"renders within"| node_layout
node_importdetail -->|"renders within"| node_layout
node_sales -->|"renders"| node_customerpanel
node_customerpanel -->|"calls"| node_printing
node_invoicehistory -->|"renders"| node_invoicetable
node_imports -->|"renders"| node_importtable
node_importdetail -->|"uses"| node_producteditor
node_invoicehistory -->|"uses"| node_api
node_sales -->|"uses"| node_api
node_customers -->|"uses"| node_api
node_finance -->|"uses"| node_api
node_home -->|"uses"| node_api
node_imports -->|"uses"| node_api
node_importdetail -->|"uses"| node_api
node_api -->|"configures API"| node_backend
node_invoicetable -->|"formats values"| node_format
node_importtable -->|"formats values"| node_format
node_home -->|"formats values"| node_format
node_finance -->|"formats values"| node_format
node_invoicetable -->|"renders"| node_pagination
node_forecast -.-> node_forecastservice

click node_entry "https://github.com/cuongvu0207/datn/blob/main/FE/src/main.jsx"
click node_routing "https://github.com/cuongvu0207/datn/blob/main/FE/src/App.jsx"
click node_layout "https://github.com/cuongvu0207/datn/blob/main/FE/src/layouts/MainLayout.jsx"
click node_theme "https://github.com/cuongvu0207/datn/blob/main/FE/src/context/ThemeContext.jsx"
click node_login "https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/LoginPage.jsx"
click node_sales "https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/SalesPage.jsx"
click node_customerpanel "https://github.com/cuongvu0207/datn/blob/main/FE/src/components/sale/CustomerPanel.jsx"
click node_printing "https://github.com/cuongvu0207/datn/blob/main/FE/src/components/sale/printInvoice.js"
click node_invoicehistory "https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/InvoiceListPage.jsx"
click node_invoicetable "https://github.com/cuongvu0207/datn/blob/main/FE/src/components/invoice/InvoiceTable.jsx"
click node_products "https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/ProductListPage.jsx"
click node_producteditor "https://github.com/cuongvu0207/datn/blob/main/FE/src/components/common/AddProductCard.jsx"
click node_pricing "https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/SetPricePage.jsx"
click node_imports "https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/ImportPage.jsx"
click node_importdetail "https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/ImportDetailPage.jsx"
click node_importtable "https://github.com/cuongvu0207/datn/blob/main/FE/src/components/import/ImportTableList.jsx"
click node_customers "https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/CustomerPage.jsx"
click node_staffpage "https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/StaffPage.jsx"
click node_finance "https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/FinancePage.jsx"
click node_home "https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/HomePage.jsx"
click node_forecast "https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/DemandForecastPage.jsx"
click node_forecastservice "https://github.com/cuongvu0207/datn/blob/main/FE/ProphetService.py"
click node_paymentnotice "https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/PaymentNotification.jsx"
click node_api "https://github.com/cuongvu0207/datn/blob/main/FE/src/services/api.js"
click node_format "https://github.com/cuongvu0207/datn/blob/main/FE/src/utils/formatters.js"
click node_pagination "https://github.com/cuongvu0207/datn/blob/main/FE/src/components/common/TablePagination.jsx"

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_entry,node_routing,node_layout,node_login toneBlue
class node_sales,node_customerpanel,node_printing,node_invoicehistory,node_invoicetable,node_paymentnotice toneAmber
class node_products,node_producteditor,node_pricing,node_imports,node_importdetail,node_importtable,node_backend toneMint
class node_customers,node_staffpage,node_finance,node_home,node_forecast,node_forecastservice toneRose
class node_theme,node_api,node_format,node_pagination,node_staff toneIndigo
```

## Components

### Application shell

- [React entry](https://github.com/cuongvu0207/datn/blob/main/FE/src/main.jsx): `FE/src/main.jsx`
- [Routes and access](https://github.com/cuongvu0207/datn/blob/main/FE/src/App.jsx): `FE/src/App.jsx`
- [Main workspace](https://github.com/cuongvu0207/datn/blob/main/FE/src/layouts/MainLayout.jsx): `FE/src/layouts/MainLayout.jsx`
- [Sign in](https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/LoginPage.jsx): `FE/src/pages/LoginPage.jsx`

### Sales and invoices

- [Sales checkout](https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/SalesPage.jsx): `FE/src/pages/SalesPage.jsx`
- [Customer and cart panel](https://github.com/cuongvu0207/datn/blob/main/FE/src/components/sale/CustomerPanel.jsx): `FE/src/components/sale/CustomerPanel.jsx`
- [Invoice printing](https://github.com/cuongvu0207/datn/blob/main/FE/src/components/sale/printInvoice.js): `FE/src/components/sale/printInvoice.js`
- [Invoice history](https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/InvoiceListPage.jsx): `FE/src/pages/InvoiceListPage.jsx`
- [Invoice table](https://github.com/cuongvu0207/datn/blob/main/FE/src/components/invoice/InvoiceTable.jsx): `FE/src/components/invoice/InvoiceTable.jsx`
- [Payment notification](https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/PaymentNotification.jsx): `FE/src/pages/PaymentNotification.jsx`

### Products and imports

- [Product catalog](https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/ProductListPage.jsx): `FE/src/pages/ProductListPage.jsx`
- [Product editing](https://github.com/cuongvu0207/datn/blob/main/FE/src/components/common/AddProductCard.jsx): `FE/src/components/common/AddProductCard.jsx`
- [Price management](https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/SetPricePage.jsx): `FE/src/pages/SetPricePage.jsx`
- [Import records](https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/ImportPage.jsx): `FE/src/pages/ImportPage.jsx`
- [Import processing](https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/ImportDetailPage.jsx): `FE/src/pages/ImportDetailPage.jsx`
- [Import list](https://github.com/cuongvu0207/datn/blob/main/FE/src/components/import/ImportTableList.jsx): `FE/src/components/import/ImportTableList.jsx`

### Store operations

- [Customer management](https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/CustomerPage.jsx): `FE/src/pages/CustomerPage.jsx`
- [Staff management](https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/StaffPage.jsx): `FE/src/pages/StaffPage.jsx`
- [Finance reports](https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/FinancePage.jsx): `FE/src/pages/FinancePage.jsx`
- [Dashboard](https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/HomePage.jsx): `FE/src/pages/HomePage.jsx`
- [Demand forecasts](https://github.com/cuongvu0207/datn/blob/main/FE/src/pages/DemandForecastPage.jsx): `FE/src/pages/DemandForecastPage.jsx`
- [Forecast service](https://github.com/cuongvu0207/datn/blob/main/FE/ProphetService.py): `FE/ProphetService.py`

### Shared services

- [Theme state](https://github.com/cuongvu0207/datn/blob/main/FE/src/context/ThemeContext.jsx): `FE/src/context/ThemeContext.jsx`
- [HTTP API config](https://github.com/cuongvu0207/datn/blob/main/FE/src/services/api.js): `FE/src/services/api.js`
- [Format utilities](https://github.com/cuongvu0207/datn/blob/main/FE/src/utils/formatters.js): `FE/src/utils/formatters.js`
- [Table pagination](https://github.com/cuongvu0207/datn/blob/main/FE/src/components/common/TablePagination.jsx): `FE/src/components/common/TablePagination.jsx`

### Other components

- **Store staff**
- **Retail API**

## Connections

- Store staff → React entry: opens (evidence: `FE/src/main.jsx`)
- React entry → Routes and access: renders (evidence: `FE/src/main.jsx`)
- Routes and access → Theme state: provides (evidence: `FE/src/App.jsx`)
- Routes and access → Sign in: routes to (evidence: `FE/src/App.jsx`)
- Routes and access → Sales checkout: routes to (evidence: `FE/src/App.jsx`)
- Routes and access → Invoice history: routes to (evidence: `FE/src/App.jsx`)
- Routes and access → Product catalog: routes to (evidence: `FE/src/App.jsx`)
- Routes and access → Price management: routes to (evidence: `FE/src/App.jsx`)
- Routes and access → Import records: routes to (evidence: `FE/src/App.jsx`)
- Routes and access → Import processing: routes to (evidence: `FE/src/App.jsx`)
- Routes and access → Customer management: routes to (evidence: `FE/src/App.jsx`)
- Routes and access → Staff management: routes to (evidence: `FE/src/App.jsx`)
- Routes and access → Finance reports: routes to (evidence: `FE/src/App.jsx`)
- Routes and access → Dashboard: routes to (evidence: `FE/src/App.jsx`)
- Routes and access → Demand forecasts: routes to (evidence: `FE/src/App.jsx`)
- Routes and access → Payment notification: routes to (evidence: `FE/src/App.jsx`)
- Sales checkout → Main workspace: renders within (evidence: `FE/src/pages/SalesPage.jsx`)
- Dashboard → Main workspace: renders within (evidence: `FE/src/pages/HomePage.jsx`)
- Finance reports → Main workspace: renders within (evidence: `FE/src/pages/FinancePage.jsx`)
- Customer management → Main workspace: renders within (evidence: `FE/src/pages/CustomerPage.jsx`)
- Import processing → Main workspace: renders within (evidence: `FE/src/pages/ImportDetailPage.jsx`)
- Sales checkout → Customer and cart panel: renders (evidence: `FE/src/pages/SalesPage.jsx`)
- Customer and cart panel → Invoice printing: calls (evidence: `FE/src/components/sale/CustomerPanel.jsx`)
- Invoice history → Invoice table: renders (evidence: `FE/src/pages/InvoiceListPage.jsx`)
- Import records → Import list: renders (evidence: `FE/src/pages/ImportPage.jsx`)
- Import processing → Product editing: uses (evidence: `FE/src/pages/ImportDetailPage.jsx`)
- Invoice history → HTTP API config: uses (evidence: `FE/src/pages/InvoiceListPage.jsx`)
- Sales checkout → HTTP API config: uses (evidence: `FE/src/pages/SalesPage.jsx`)
- Customer management → HTTP API config: uses (evidence: `FE/src/pages/CustomerPage.jsx`)
- Finance reports → HTTP API config: uses (evidence: `FE/src/pages/FinancePage.jsx`)
- Dashboard → HTTP API config: uses (evidence: `FE/src/pages/HomePage.jsx`)
- Import records → HTTP API config: uses (evidence: `FE/src/pages/ImportPage.jsx`)
- Import processing → HTTP API config: uses (evidence: `FE/src/pages/ImportDetailPage.jsx`)
- HTTP API config → Retail API: configures API (evidence: `FE/src/services/api.js`)
- Invoice table → Format utilities: formats values (evidence: `FE/src/components/invoice/InvoiceTable.jsx`)
- Import list → Format utilities: formats values (evidence: `FE/src/components/import/ImportTableList.jsx`)
- Dashboard → Format utilities: formats values (evidence: `FE/src/pages/HomePage.jsx`)
- Finance reports → Format utilities: formats values (evidence: `FE/src/pages/FinancePage.jsx`)
- Invoice table → Table pagination: renders (evidence: `FE/src/components/invoice/InvoiceTable.jsx`)
- Demand forecasts → Forecast service
