# gumiho0812/ban_vot_cau_long architecture

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

- Interactive diagram: https://gitdiagram.com/gumiho0812/ban_vot_cau_long
- Repository: https://github.com/gumiho0812/ban_vot_cau_long

## Overview

This is a Tkinter badminton-racket sales and management application. Customers register or log in, browse and filter products, build a cart and place orders, then view invoices; staff log in to manage products and access invoice management and sales statistics. JSON files provide local persistence, and a separate crawler can collect Yonex product listings. The README is empty, and excerpts omit parts of the customer and invoice flows, so those links are limited to behavior visible in the supplied evidence.

Main entry points: [`caulong/store.py`](https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/store.py) (JSON store), [`caulong/main.py`](https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/main.py) (Login and routing), [`caulong/gui_customer.py`](https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/gui_customer.py) (Product browsing and cart), [`caulong/crawl.py`](https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/crawl.py) (Yonex product crawler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Access"]
  node_main["Login and routing<br/>[main.py]"]
  node_auth["Authentication and roles<br/>[auth.py]"]
  node_registration["Customer registration<br/>[gui_register.py]"]
end

subgraph group_catalog["Catalog and sourcing"]
  node_admin["Product management<br/>[gui_admin.py]"]
  node_customer_app["Product browsing and cart<br/>[gui_customer.py]"]
  node_crawler["Yonex product crawler<br/>[crawl.py]"]
end

subgraph group_commerce["Sales and invoices"]
  node_invoice["Orders and sales statistics<br/>[gui_invoice.py]"]
end

subgraph group_persistence["JSON persistence"]
  node_store["JSON store<br/>[store.py]"]
  node_product_data[("Racket catalog<br/>[sanpham_yonex.JSON]")]
  node_employee_data[("Employee accounts<br/>[nhanvien.JSON]")]
  node_customer_data[("Customer accounts<br/>[khachhang.JSON]")]
  node_order_data[("Orders<br/>[donhang.JSON]")]
end

node_customer(("Customer"))
node_staff(("Staff"))
node_web_source(("Yonex product website"))

node_customer -->|"opens app"| node_main
node_staff -->|"opens app"| node_main
node_main -->|"initializes stores"| node_store
node_main -->|"checks credentials"| node_auth
node_auth -->|"reads accounts"| node_store
node_store -->|"reads and writes"| node_employee_data
node_store -->|"reads and writes"| node_customer_data
node_store -->|"reads and writes"| node_product_data
node_main -->|"opens registration"| node_registration
node_registration -->|"checks and creates account"| node_store
node_main -->|"routes staff"| node_admin
node_main -->|"routes customer"| node_customer_app
node_admin -->|"manages products"| node_store
node_customer_app -->|"reads catalog"| node_store
node_customer_app -->|"creates orders"| node_order_data
node_customer_app -->|"opens invoices"| node_invoice
node_admin -->|"opens statistics"| node_invoice
node_invoice -->|"reads and updates"| node_order_data
node_crawler -.->|"fetches listings"| node_web_source
node_crawler -.->|"creates products"| node_store
node_crawler -.->|"writes catalog"| node_product_data

click node_main "https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/main.py"
click node_auth "https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/auth.py"
click node_registration "https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/gui_register.py"
click node_admin "https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/gui_admin.py"
click node_customer_app "https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/gui_customer.py"
click node_crawler "https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/crawl.py"
click node_invoice "https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/gui_invoice.py"
click node_store "https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/store.py"
click node_product_data "https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/data/sanpham_yonex.JSON"
click node_employee_data "https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/data/nhanvien.JSON"
click node_customer_data "https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/data/khachhang.JSON"
click node_order_data "https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/data/donhang.JSON"

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_main,node_auth,node_registration toneBlue
class node_admin,node_customer_app,node_crawler toneAmber
class node_invoice toneMint
class node_store,node_product_data,node_employee_data,node_customer_data,node_order_data toneRose
class node_customer,node_staff,node_web_source toneIndigo
```

## Components

### Access

- [Login and routing](https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/main.py): `caulong/main.py`
- [Authentication and roles](https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/auth.py): `caulong/auth.py`
- [Customer registration](https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/gui_register.py): `caulong/gui_register.py`

### Catalog and sourcing

- [Product management](https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/gui_admin.py): `caulong/gui_admin.py`
- [Product browsing and cart](https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/gui_customer.py): `caulong/gui_customer.py`
- [Yonex product crawler](https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/crawl.py): `caulong/crawl.py`

### Sales and invoices

- [Orders and sales statistics](https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/gui_invoice.py): `caulong/gui_invoice.py`

### JSON persistence

- [JSON store](https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/store.py): `caulong/store.py`
- [Racket catalog](https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/data/sanpham_yonex.JSON): `caulong/data/sanpham_yonex.JSON`
- [Employee accounts](https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/data/nhanvien.JSON): `caulong/data/nhanvien.JSON`
- [Customer accounts](https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/data/khachhang.JSON): `caulong/data/khachhang.JSON`
- [Orders](https://github.com/gumiho0812/ban_vot_cau_long/blob/caulong-only/caulong/data/donhang.JSON): `caulong/data/donhang.JSON`

### Other components

- **Customer**
- **Staff**
- **Yonex product website**

## Connections

- Customer → Login and routing: opens app
- Staff → Login and routing: opens app
- Login and routing → JSON store: initializes stores
- Login and routing → Authentication and roles: checks credentials
- Authentication and roles → JSON store: reads accounts
- JSON store → Employee accounts: reads and writes
- JSON store → Customer accounts: reads and writes
- JSON store → Racket catalog: reads and writes
- Login and routing → Customer registration: opens registration
- Customer registration → JSON store: checks and creates account
- Login and routing → Product management: routes staff
- Login and routing → Product browsing and cart: routes customer
- Product management → JSON store: manages products
- Product browsing and cart → JSON store: reads catalog
- Product browsing and cart → Orders: creates orders
- Product browsing and cart → Orders and sales statistics: opens invoices
- Product management → Orders and sales statistics: opens statistics
- Orders and sales statistics → Orders: reads and updates
- Yonex product crawler → Yonex product website: fetches listings
- Yonex product crawler → JSON store: creates products
- Yonex product crawler → Racket catalog: writes catalog
