# daucaothanh/karate-do-shop architecture

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

- Interactive diagram: https://gitdiagram.com/daucaothanh/karate-do-shop
- Repository: https://github.com/daucaothanh/karate-do-shop

## Overview

Karate-Do Shop is a Laravel storefront with customer accounts, product discovery, cart and wishlist features, checkout, order tracking, and an AI chatbot, plus an admin/staff back office for catalog, orders, reporting, reviews, and workforce operations. The main flow is customer request → web routes → client controllers → persisted commerce data; staff controllers manage fulfillment and shift operations. Edges reflect the README, excerpts, and SOURCE INDEX references; unsampled capabilities are included where the tree and route index support them, but their internal call details are not assumed.

Main entry points: [`routes/web.php`](https://github.com/daucaothanh/karate-do-shop/blob/main/routes/web.php) (Web routes), [`app/Models/Product.php`](https://github.com/daucaothanh/karate-do-shop/blob/main/app/Models/Product.php) (Products), [`app/Http/Controllers/Admin/ShiftController.php`](https://github.com/daucaothanh/karate-do-shop/blob/main/app/Http/Controllers/Admin/ShiftController.php) (Shift operations), [`app/Models/Order.php`](https://github.com/daucaothanh/karate-do-shop/blob/main/app/Models/Order.php) (Orders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_http["HTTP entry<br/>[index.php]"]
  node_bootstrap["App bootstrap<br/>[app.php]"]
  node_routes["Web routes<br/>[web.php]"]
end

subgraph group_shop["Customer commerce"]
  node_storefront["Catalog &amp; account"]
  node_cart["Cart &amp; wishlist<br/>[CartController.php]"]
  node_checkout["Checkout &amp; orders"]
  node_chatbot["Product chatbot"]
  node_clientauth["Customer authentication<br/>[AuthController.php]"]
end

subgraph group_backoffice["Admin operations"]
  node_admincatalog["Catalog management"]
  node_adminorders["Order fulfillment"]
  node_adminworkforce["Shift operations"]
  node_payroll["Payroll"]
  node_reports["Reports"]
  node_reviews["Review moderation"]
end

subgraph group_domain["Domain data"]
  node_product["Products<br/>[Product.php]"]
  node_category["Categories<br/>[Category.php]"]
  node_order["Orders<br/>[Order.php]"]
  node_user["Users &amp; roles<br/>[User.php]"]
  node_workshift["Work shifts<br/>[WorkShift.php]"]
  node_worklog["Staff work logs<br/>[StaffWorkLog.php]"]
  node_mysql[("MySQL")]
end

node_customer(("Customer"))

node_customer -->|"sends requests"| node_http
node_http -->|"loads app"| node_bootstrap
node_routes -->|"routes to"| node_storefront
node_routes -->|"routes to"| node_cart
node_routes -->|"routes to"| node_checkout
node_routes -->|"routes to"| node_chatbot
node_routes -->|"routes to"| node_clientauth
node_routes -->|"routes to"| node_admincatalog
node_routes -->|"routes to"| node_adminorders
node_routes -->|"routes to"| node_adminworkforce
node_routes -->|"routes to"| node_payroll
node_routes -->|"routes to"| node_reports
node_routes -.->|"routes to"| node_reviews
node_storefront -.->|"queries"| node_product
node_cart -->|"reads products"| node_product
node_checkout -->|"creates orders"| node_order
node_chatbot -->|"searches products"| node_product
node_admincatalog -.->|"manages"| node_product
node_adminorders -->|"updates"| node_order
node_adminorders -->|"records handling"| node_worklog
node_adminworkforce -->|"manages shifts"| node_workshift
node_adminworkforce -->|"reads and updates"| node_worklog
node_adminworkforce -->|"summarizes orders"| node_order
node_payroll -->|"reads work logs"| node_worklog
node_reports -->|"reports on"| node_order
node_reviews -->|"filters by product"| node_product
node_storefront -.->|"browses categories"| node_category
node_checkout -->|"uses customer account"| node_user
node_adminworkforce -->|"manages staff"| node_user
node_order -.->|"persists"| node_mysql
node_product -.->|"persists"| node_mysql
node_user -.->|"persists"| node_mysql
node_workshift -.->|"persists"| node_mysql
node_worklog -.->|"persists"| node_mysql

click node_http "https://github.com/daucaothanh/karate-do-shop/blob/main/public/index.php"
click node_bootstrap "https://github.com/daucaothanh/karate-do-shop/blob/main/bootstrap/app.php"
click node_routes "https://github.com/daucaothanh/karate-do-shop/blob/main/routes/web.php"
click node_storefront "https://github.com/daucaothanh/karate-do-shop/blob/main/app/Http/Controllers/Clients/ProductController.php"
click node_cart "https://github.com/daucaothanh/karate-do-shop/blob/main/app/Http/Controllers/Clients/CartController.php"
click node_checkout "https://github.com/daucaothanh/karate-do-shop/blob/main/app/Http/Controllers/Clients/CheckoutController.php"
click node_chatbot "https://github.com/daucaothanh/karate-do-shop/blob/main/app/Http/Controllers/Clients/ChatbotController.php"
click node_clientauth "https://github.com/daucaothanh/karate-do-shop/blob/main/app/Http/Controllers/Clients/AuthController.php"
click node_admincatalog "https://github.com/daucaothanh/karate-do-shop/blob/main/app/Http/Controllers/Admin/ProductController.php"
click node_adminorders "https://github.com/daucaothanh/karate-do-shop/blob/main/app/Http/Controllers/Admin/OrderController.php"
click node_adminworkforce "https://github.com/daucaothanh/karate-do-shop/blob/main/app/Http/Controllers/Admin/ShiftController.php"
click node_payroll "https://github.com/daucaothanh/karate-do-shop/blob/main/app/Http/Controllers/Admin/PayrollController.php"
click node_reports "https://github.com/daucaothanh/karate-do-shop/blob/main/app/Http/Controllers/Admin/ReportController.php"
click node_reviews "https://github.com/daucaothanh/karate-do-shop/blob/main/app/Http/Controllers/Admin/ReviewController.php"
click node_product "https://github.com/daucaothanh/karate-do-shop/blob/main/app/Models/Product.php"
click node_category "https://github.com/daucaothanh/karate-do-shop/blob/main/app/Models/Category.php"
click node_order "https://github.com/daucaothanh/karate-do-shop/blob/main/app/Models/Order.php"
click node_user "https://github.com/daucaothanh/karate-do-shop/blob/main/app/Models/User.php"
click node_workshift "https://github.com/daucaothanh/karate-do-shop/blob/main/app/Models/WorkShift.php"
click node_worklog "https://github.com/daucaothanh/karate-do-shop/blob/main/app/Models/StaffWorkLog.php"

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_http,node_bootstrap,node_routes toneBlue
class node_storefront,node_cart,node_checkout,node_chatbot,node_clientauth toneAmber
class node_admincatalog,node_adminorders,node_adminworkforce,node_payroll,node_reports,node_reviews toneMint
class node_product,node_category,node_order,node_user,node_workshift,node_worklog,node_mysql toneRose
class node_customer toneIndigo
```

## Components

### Application entry

- [HTTP entry](https://github.com/daucaothanh/karate-do-shop/blob/main/public/index.php): `public/index.php`
- [App bootstrap](https://github.com/daucaothanh/karate-do-shop/blob/main/bootstrap/app.php): `bootstrap/app.php`
- [Web routes](https://github.com/daucaothanh/karate-do-shop/blob/main/routes/web.php): `routes/web.php`

### Customer commerce

- [Catalog & account](https://github.com/daucaothanh/karate-do-shop/blob/main/app/Http/Controllers/Clients/ProductController.php): `app/Http/Controllers/Clients/ProductController.php`
- [Cart & wishlist](https://github.com/daucaothanh/karate-do-shop/blob/main/app/Http/Controllers/Clients/CartController.php): `app/Http/Controllers/Clients/CartController.php`
- [Checkout & orders](https://github.com/daucaothanh/karate-do-shop/blob/main/app/Http/Controllers/Clients/CheckoutController.php): `app/Http/Controllers/Clients/CheckoutController.php`
- [Product chatbot](https://github.com/daucaothanh/karate-do-shop/blob/main/app/Http/Controllers/Clients/ChatbotController.php): `app/Http/Controllers/Clients/ChatbotController.php`
- [Customer authentication](https://github.com/daucaothanh/karate-do-shop/blob/main/app/Http/Controllers/Clients/AuthController.php): `app/Http/Controllers/Clients/AuthController.php`

### Admin operations

- [Catalog management](https://github.com/daucaothanh/karate-do-shop/blob/main/app/Http/Controllers/Admin/ProductController.php): `app/Http/Controllers/Admin/ProductController.php`
- [Order fulfillment](https://github.com/daucaothanh/karate-do-shop/blob/main/app/Http/Controllers/Admin/OrderController.php): `app/Http/Controllers/Admin/OrderController.php`
- [Shift operations](https://github.com/daucaothanh/karate-do-shop/blob/main/app/Http/Controllers/Admin/ShiftController.php): `app/Http/Controllers/Admin/ShiftController.php`
- [Payroll](https://github.com/daucaothanh/karate-do-shop/blob/main/app/Http/Controllers/Admin/PayrollController.php): `app/Http/Controllers/Admin/PayrollController.php`
- [Reports](https://github.com/daucaothanh/karate-do-shop/blob/main/app/Http/Controllers/Admin/ReportController.php): `app/Http/Controllers/Admin/ReportController.php`
- [Review moderation](https://github.com/daucaothanh/karate-do-shop/blob/main/app/Http/Controllers/Admin/ReviewController.php): `app/Http/Controllers/Admin/ReviewController.php`

### Domain data

- [Products](https://github.com/daucaothanh/karate-do-shop/blob/main/app/Models/Product.php): `app/Models/Product.php`
- [Categories](https://github.com/daucaothanh/karate-do-shop/blob/main/app/Models/Category.php): `app/Models/Category.php`
- [Orders](https://github.com/daucaothanh/karate-do-shop/blob/main/app/Models/Order.php): `app/Models/Order.php`
- [Users & roles](https://github.com/daucaothanh/karate-do-shop/blob/main/app/Models/User.php): `app/Models/User.php`
- [Work shifts](https://github.com/daucaothanh/karate-do-shop/blob/main/app/Models/WorkShift.php): `app/Models/WorkShift.php`
- [Staff work logs](https://github.com/daucaothanh/karate-do-shop/blob/main/app/Models/StaffWorkLog.php): `app/Models/StaffWorkLog.php`
- **MySQL**

### Other components

- **Customer**

## Connections

- Customer → HTTP entry: sends requests
- HTTP entry → App bootstrap: loads app (evidence: `public/index.php`)
- Web routes → Catalog & account: routes to (evidence: `routes/web.php`)
- Web routes → Cart & wishlist: routes to (evidence: `routes/web.php`)
- Web routes → Checkout & orders: routes to (evidence: `routes/web.php`)
- Web routes → Product chatbot: routes to (evidence: `routes/web.php`)
- Web routes → Customer authentication: routes to (evidence: `routes/web.php`)
- Web routes → Catalog management: routes to (evidence: `routes/web.php`)
- Web routes → Order fulfillment: routes to (evidence: `routes/web.php`)
- Web routes → Shift operations: routes to (evidence: `routes/web.php`)
- Web routes → Payroll: routes to (evidence: `routes/web.php`)
- Web routes → Reports: routes to (evidence: `routes/web.php`)
- Web routes → Review moderation: routes to (evidence: `routes/web.php`)
- Catalog & account → Products: queries
- Cart & wishlist → Products: reads products (evidence: `app/Http/Controllers/Clients/CartController.php`)
- Checkout & orders → Orders: creates orders (evidence: `app/Http/Controllers/Clients/CheckoutController.php`)
- Product chatbot → Products: searches products (evidence: `app/Http/Controllers/Clients/ChatbotController.php`)
- Catalog management → Products: manages
- Order fulfillment → Orders: updates (evidence: `app/Http/Controllers/Admin/OrderController.php`)
- Order fulfillment → Staff work logs: records handling (evidence: `app/Http/Controllers/Admin/OrderController.php`)
- Shift operations → Work shifts: manages shifts (evidence: `app/Http/Controllers/Admin/ShiftController.php`)
- Shift operations → Staff work logs: reads and updates (evidence: `app/Http/Controllers/Admin/ShiftController.php`)
- Shift operations → Orders: summarizes orders (evidence: `app/Http/Controllers/Admin/ShiftController.php`)
- Payroll → Staff work logs: reads work logs (evidence: `app/Http/Controllers/Admin/PayrollController.php`)
- Reports → Orders: reports on (evidence: `app/Http/Controllers/Admin/ReportController.php`)
- Review moderation → Products: filters by product (evidence: `app/Http/Controllers/Admin/ReviewController.php`)
- Catalog & account → Categories: browses categories
- Checkout & orders → Users & roles: uses customer account (evidence: `app/Http/Controllers/Clients/CheckoutController.php`)
- Shift operations → Users & roles: manages staff (evidence: `app/Http/Controllers/Admin/ShiftController.php`)
- Orders → MySQL: persists (evidence: `README.md`)
- Products → MySQL: persists (evidence: `README.md`)
- Users & roles → MySQL: persists (evidence: `README.md`)
- Work shifts → MySQL: persists (evidence: `README.md`)
- Staff work logs → MySQL: persists (evidence: `README.md`)
