# jamesmateoxzy-wq/sakura-beaded-bags architecture

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

- Interactive diagram: https://gitdiagram.com/jamesmateoxzy-wq/sakura-beaded-bags
- Repository: https://github.com/jamesmateoxzy-wq/sakura-beaded-bags

## Overview

Sakura Beaded Bags is an internal PHP/MySQL business-management application. An administrator signs in and uses the dashboard and operational pages to manage products and costing, inventory, orders, payments, and reports. The APIs implement the sampled data operations; shared database access and dashboard queries provide an internal data layer. The README describes the intended capabilities, while the source index confirms several API-to-database dependencies. Browser-script wiring and some page-to-API calls were not shown, so those links are omitted or marked unverified.

Main entry points: [`includes/config.php`](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/includes/config.php) (Site configuration), [`includes/db.php`](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/includes/db.php) (PDO access), [`admin/dashboard.php`](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/dashboard.php) (Dashboard), [`admin/api/orders.php`](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/api/orders.php) (Orders API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Admin access"]
  node_login["Admin login<br/>[login.php]"]
  node_callback["Google callback"]
  node_header["Shared navigation<br/>[header.php]"]
  node_footer["Shared page footer<br/>[footer.php]"]
end

subgraph group_operations["Business operations"]
  node_dashboard["Dashboard<br/>[dashboard.php]"]
  node_orders_page["Order management<br/>[orders.php]"]
  node_inventory_page["Inventory management<br/>[inventory.php]"]
  node_products_page["Product costing<br/>[products.php]"]
end

subgraph group_finance["Sales and reporting"]
  node_payments_page["Payments and sales<br/>[payments.php]"]
  node_reports_page["Financial reports<br/>[reports.php]"]
end

subgraph group_backend["Application backend"]
  node_orders_api["Orders API<br/>[orders.php]"]
  node_inventory_api["Inventory API<br/>[inventory.php]"]
  node_products_api["Products API<br/>[products.php]"]
  node_catalog_api["Product catalog API"]
  node_payments_api["Payments API<br/>[payments.php]"]
  node_reports_api["Reports API<br/>[reports.php]"]
end

subgraph group_data["Data layer"]
  node_dashboard_data["Dashboard data"]
  node_database_access["PDO access<br/>[db.php]"]
  node_configuration["Site configuration<br/>[config.php]"]
  node_database[("MySQL database<br/>[schema.sql]")]
  node_helpers["Shared PHP helpers<br/>[functions.php]"]
  node_catalog_migration["Catalog migration"]
end

node_administrator(("Administrator"))

node_administrator -->|"signs in"| node_login
node_administrator -->|"uses navigation"| node_header
node_login -->|"reads settings"| node_configuration
node_callback -->|"reads settings"| node_configuration
node_header -->|"loads helpers"| node_helpers
node_dashboard -->|"loads figures"| node_dashboard_data
node_dashboard -->|"uses helpers"| node_helpers
node_dashboard -->|"renders layout"| node_header
node_dashboard -->|"renders layout"| node_footer
node_dashboard_data -->|"queries through"| node_database_access
node_orders_api -->|"uses connection"| node_database_access
node_orders_api -->|"loads settings"| node_configuration
node_inventory_api -->|"uses connection"| node_database_access
node_inventory_api -->|"loads settings"| node_configuration
node_products_api -->|"uses connection"| node_database_access
node_products_api -->|"loads settings"| node_configuration
node_catalog_api -->|"uses connection"| node_database_access
node_catalog_api -->|"loads settings"| node_configuration
node_payments_api -->|"uses connection"| node_database_access
node_payments_api -->|"loads settings"| node_configuration
node_reports_api -->|"uses connection"| node_database_access
node_reports_api -->|"loads settings"| node_configuration
node_products_page -.->|"likely requests"| node_products_api
node_orders_page -.->|"likely requests"| node_orders_api
node_inventory_page -.->|"likely requests"| node_inventory_api
node_payments_page -.->|"likely requests"| node_payments_api
node_reports_page -.->|"likely requests"| node_reports_api

click node_login "https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/login.php"
click node_callback "https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/google-callback.php"
click node_header "https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/includes/header.php"
click node_dashboard "https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/dashboard.php"
click node_orders_page "https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/orders.php"
click node_inventory_page "https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/inventory.php"
click node_products_page "https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/products.php"
click node_orders_api "https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/api/orders.php"
click node_inventory_api "https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/api/inventory.php"
click node_products_api "https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/api/products.php"
click node_catalog_api "https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/api/product_catalog.php"
click node_payments_page "https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/payments.php"
click node_payments_api "https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/api/payments.php"
click node_reports_page "https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/reports.php"
click node_reports_api "https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/api/reports.php"
click node_dashboard_data "https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/includes/dashboard_live_data.php"
click node_database_access "https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/includes/db.php"
click node_configuration "https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/includes/config.php"
click node_database "https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/database/schema.sql"
click node_helpers "https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/includes/functions.php"
click node_footer "https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/includes/footer.php"
click node_catalog_migration "https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/scripts/migrate_product_catalog.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_login,node_callback,node_header,node_footer toneBlue
class node_dashboard,node_orders_page,node_inventory_page,node_products_page toneAmber
class node_payments_page,node_reports_page toneMint
class node_orders_api,node_inventory_api,node_products_api,node_catalog_api,node_payments_api,node_reports_api toneRose
class node_dashboard_data,node_database_access,node_configuration,node_database,node_helpers,node_catalog_migration,node_administrator toneIndigo
```

## Components

### Admin access

- [Admin login](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/login.php): `admin/login.php`
- [Google callback](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/google-callback.php): `admin/google-callback.php`
- [Shared navigation](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/includes/header.php): `includes/header.php`
- [Shared page footer](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/includes/footer.php): `includes/footer.php`

### Business operations

- [Dashboard](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/dashboard.php): `admin/dashboard.php`
- [Order management](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/orders.php): `admin/orders.php`
- [Inventory management](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/inventory.php): `admin/inventory.php`
- [Product costing](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/products.php): `admin/products.php`

### Sales and reporting

- [Payments and sales](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/payments.php): `admin/payments.php`
- [Financial reports](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/reports.php): `admin/reports.php`

### Application backend

- [Orders API](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/api/orders.php): `admin/api/orders.php`
- [Inventory API](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/api/inventory.php): `admin/api/inventory.php`
- [Products API](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/api/products.php): `admin/api/products.php`
- [Product catalog API](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/api/product_catalog.php): `admin/api/product_catalog.php`
- [Payments API](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/api/payments.php): `admin/api/payments.php`
- [Reports API](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/admin/api/reports.php): `admin/api/reports.php`

### Data layer

- [Dashboard data](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/includes/dashboard_live_data.php): `includes/dashboard_live_data.php`
- [PDO access](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/includes/db.php): `includes/db.php`
- [Site configuration](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/includes/config.php): `includes/config.php`
- [MySQL database](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/database/schema.sql): `database/schema.sql`
- [Shared PHP helpers](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/includes/functions.php): `includes/functions.php`
- [Catalog migration](https://github.com/jamesmateoxzy-wq/sakura-beaded-bags/blob/main/scripts/migrate_product_catalog.php): `scripts/migrate_product_catalog.php`

### Other components

- **Administrator**

## Connections

- Administrator → Admin login: signs in
- Administrator → Shared navigation: uses navigation (evidence: `includes/header.php`)
- Admin login → Site configuration: reads settings (evidence: `admin/login.php`)
- Google callback → Site configuration: reads settings (evidence: `admin/google-callback.php`)
- Shared navigation → Shared PHP helpers: loads helpers (evidence: `includes/header.php`)
- Dashboard → Dashboard data: loads figures (evidence: `admin/dashboard.php`)
- Dashboard → Shared PHP helpers: uses helpers (evidence: `admin/dashboard.php`)
- Dashboard → Shared navigation: renders layout (evidence: `admin/dashboard.php`)
- Dashboard → Shared page footer: renders layout (evidence: `admin/dashboard.php`)
- Dashboard data → PDO access: queries through (evidence: `includes/dashboard_live_data.php`)
- Orders API → PDO access: uses connection (evidence: `admin/api/orders.php`)
- Orders API → Site configuration: loads settings (evidence: `admin/api/orders.php`)
- Inventory API → PDO access: uses connection (evidence: `admin/api/inventory.php`)
- Inventory API → Site configuration: loads settings (evidence: `admin/api/inventory.php`)
- Products API → PDO access: uses connection (evidence: `admin/api/products.php`)
- Products API → Site configuration: loads settings (evidence: `admin/api/products.php`)
- Product catalog API → PDO access: uses connection (evidence: `admin/api/product_catalog.php`)
- Product catalog API → Site configuration: loads settings (evidence: `admin/api/product_catalog.php`)
- Payments API → PDO access: uses connection (evidence: `admin/api/payments.php`)
- Payments API → Site configuration: loads settings (evidence: `admin/api/payments.php`)
- Reports API → PDO access: uses connection (evidence: `admin/api/reports.php`)
- Reports API → Site configuration: loads settings (evidence: `admin/api/reports.php`)
- Product costing → Products API: likely requests
- Order management → Orders API: likely requests
- Inventory management → Inventory API: likely requests
- Payments and sales → Payments API: likely requests
- Financial reports → Reports API: likely requests
