# yuukun123/bakery-sweets architecture

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

- Interactive diagram: https://gitdiagram.com/yuukun123/bakery-sweets
- Repository: https://github.com/yuukun123/bakery-sweets

## Overview

Bakery-Sweets contains a web storefront and administration UI, a separate mobile API with real-time order/user sockets, and a PHP administration application. The visible customer journey is routed through the web client’s shared layout to product, account, cart, and payment pages; the repository excerpts do not establish how those web pages reach a backend. The mobile backend exposes API and WebSocket entry points, but only auth and socket internals were sampled. Several PHP administration capabilities are identifiable from the tree, while their controller wiring is not shown.

Main entry points: [`web/frontend/src/App.jsx`](https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/App.jsx) (Admin routes), [`mobile/backend/app/config/database.py`](https://github.com/yuukun123/bakery-sweets/blob/main/mobile/backend/app/config/database.py) (Database access), [`mobile/backend/main.py`](https://github.com/yuukun123/bakery-sweets/blob/main/mobile/backend/main.py) (API application), [`mobile/backend/app/api/v1/endpoints/auth.py`](https://github.com/yuukun123/bakery-sweets/blob/main/mobile/backend/app/api/v1/endpoints/auth.py) (Authentication endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web_store["Web storefront"]
  node_web_router["Web routes<br/>[App.jsx]"]
  node_client_layout["Client layout<br/>[ClientLayout.jsx]"]
  node_catalog_pages["Catalog pages<br/>[Home.jsx]"]
  node_product_detail["Product detail<br/>[ProductDetail.jsx]"]
  node_search_page["Product search<br/>[Search.jsx]"]
  node_account_pages["Account pages<br/>[Register.jsx]"]
  node_auth_state["Auth state<br/>[authStore.js]"]
  node_cart_ui["Cart drawer<br/>[CartDrawer.jsx]"]
  node_cart_state["Cart state<br/>[cartStore.js]"]
  node_checkout_page["Payment and receipt<br/>[Pay.jsx]"]
end

subgraph group_web_admin["Web administration"]
  node_admin_routes["Admin routes<br/>[App.jsx]"]
  node_admin_guard["Admin access guard<br/>[AdminRoute.jsx]"]
  node_admin_login["Admin login<br/>[AdminLogin.jsx]"]
  node_admin_layout["Admin workspace<br/>[AdminLayout.jsx]"]
  node_admin_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_admin_products["Product management<br/>[ProductForm.jsx]"]
  node_admin_orders["Order management<br/>[OrderList.jsx]"]
  node_admin_people["People management<br/>[EmployeeForm.jsx]"]
  node_admin_stats["Statistics<br/>[Statistical.jsx]"]
end

subgraph group_mobile_api["Mobile API"]
  node_api_entry["API application<br/>[main.py]"]
  node_api_routes["Versioned API router<br/>[api.py]"]
  node_auth_endpoint["Authentication endpoint<br/>[auth.py]"]
  node_security["Token security<br/>[security.py]"]
  node_user_model["User model<br/>[user.py]"]
  node_order_model["Order model<br/>[order.py]"]
  node_socket_endpoint["WebSocket endpoints<br/>[websocket.py]"]
  node_socket_manager["Socket connections<br/>[manager.py]"]
  node_db_config["Database access<br/>[database.py]"]
end

subgraph group_php_admin["PHP administration"]
  node_php_user_page["PHP user management<br/>[manager-user.php]"]
  node_php_user_view["User management view<br/>[manager.php]"]
  node_php_session["Admin session check"]
  node_php_header["Admin header<br/>[header.php]"]
end

node_shopper(("Shopper"))
node_mysql[("MySQL database")]

node_shopper -->|"opens storefront"| node_web_router
node_web_router -->|"routes through"| node_client_layout
node_web_router -->|"routes to"| node_catalog_pages
node_web_router -->|"routes to"| node_product_detail
node_web_router -->|"routes to"| node_search_page
node_web_router -->|"routes to"| node_account_pages
node_web_router -->|"routes to"| node_checkout_page
node_client_layout -->|"renders"| node_cart_ui
node_admin_routes -->|"protects routes"| node_admin_guard
node_admin_routes -->|"routes to"| node_admin_login
node_admin_routes -->|"routes through"| node_admin_layout
node_admin_routes -->|"routes to"| node_admin_dashboard
node_admin_routes -->|"routes to"| node_admin_products
node_admin_routes -->|"routes to"| node_admin_orders
node_admin_routes -->|"routes to"| node_admin_people
node_admin_routes -->|"routes to"| node_admin_stats
node_admin_guard -->|"checks auth"| node_auth_state
node_admin_login -->|"updates auth"| node_auth_state
node_api_entry -->|"mounts API"| node_api_routes
node_api_entry -->|"mounts sockets"| node_socket_endpoint
node_api_entry -->|"creates tables"| node_db_config
node_auth_endpoint -->|"uses sessions"| node_db_config
node_auth_endpoint -->|"queries users"| node_user_model
node_auth_endpoint -->|"uses security"| node_security
node_socket_endpoint -->|"dispatches sockets"| node_socket_manager
node_user_model -->|"maps database"| node_db_config
node_order_model -->|"maps database"| node_db_config
node_db_config -->|"connects to"| node_mysql
node_php_user_page -->|"checks session"| node_php_session
node_php_user_page -->|"includes header"| node_php_header
node_php_user_page -->|"includes view"| node_php_user_view

click node_web_router "https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/App.jsx"
click node_client_layout "https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/components/layout/ClientLayout.jsx"
click node_catalog_pages "https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/pages/Home.jsx"
click node_product_detail "https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/pages/ProductDetail.jsx"
click node_search_page "https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/pages/Search.jsx"
click node_account_pages "https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/pages/Register.jsx"
click node_auth_state "https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/store/authStore.js"
click node_cart_ui "https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/components/ui/CartDrawer.jsx"
click node_cart_state "https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/store/cartStore.js"
click node_checkout_page "https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/pages/Pay.jsx"
click node_admin_routes "https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/App.jsx"
click node_admin_guard "https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/admin/components/AdminRoute.jsx"
click node_admin_login "https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/admin/pages/AdminLogin.jsx"
click node_admin_layout "https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/admin/layouts/AdminLayout.jsx"
click node_admin_dashboard "https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/admin/pages/Dashboard.jsx"
click node_admin_products "https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/admin/pages/ProductForm.jsx"
click node_admin_orders "https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/admin/pages/OrderList.jsx"
click node_admin_people "https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/admin/pages/EmployeeForm.jsx"
click node_admin_stats "https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/admin/pages/Statistical.jsx"
click node_api_entry "https://github.com/yuukun123/bakery-sweets/blob/main/mobile/backend/main.py"
click node_api_routes "https://github.com/yuukun123/bakery-sweets/blob/main/mobile/backend/app/api/v1/api.py"
click node_auth_endpoint "https://github.com/yuukun123/bakery-sweets/blob/main/mobile/backend/app/api/v1/endpoints/auth.py"
click node_security "https://github.com/yuukun123/bakery-sweets/blob/main/mobile/backend/app/core/security.py"
click node_user_model "https://github.com/yuukun123/bakery-sweets/blob/main/mobile/backend/app/models/user.py"
click node_order_model "https://github.com/yuukun123/bakery-sweets/blob/main/mobile/backend/app/models/order.py"
click node_socket_endpoint "https://github.com/yuukun123/bakery-sweets/blob/main/mobile/backend/app/api/v1/endpoints/websocket.py"
click node_socket_manager "https://github.com/yuukun123/bakery-sweets/blob/main/mobile/backend/app/websocket/manager.py"
click node_db_config "https://github.com/yuukun123/bakery-sweets/blob/main/mobile/backend/app/config/database.py"
click node_php_user_page "https://github.com/yuukun123/bakery-sweets/blob/main/app/admin/pages/manager-user.php"
click node_php_user_view "https://github.com/yuukun123/bakery-sweets/blob/main/app/admin/Views/users/manager.php"
click node_php_session "https://github.com/yuukun123/bakery-sweets/blob/main/app/admin/Api_php/check-session-admin.php"
click node_php_header "https://github.com/yuukun123/bakery-sweets/blob/main/app/admin/includes/header.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_web_router,node_client_layout,node_catalog_pages,node_product_detail,node_search_page,node_account_pages,node_auth_state,node_cart_ui,node_cart_state,node_checkout_page toneBlue
class node_admin_routes,node_admin_guard,node_admin_login,node_admin_layout,node_admin_dashboard,node_admin_products,node_admin_orders,node_admin_people,node_admin_stats,node_mysql toneAmber
class node_api_entry,node_api_routes,node_auth_endpoint,node_security,node_user_model,node_order_model,node_socket_endpoint,node_socket_manager,node_db_config toneMint
class node_php_user_page,node_php_user_view,node_php_session,node_php_header toneRose
class node_shopper toneIndigo
```

## Components

### Web storefront

- [Web routes](https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/App.jsx): `web/frontend/src/App.jsx`
- [Client layout](https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/components/layout/ClientLayout.jsx): `web/frontend/src/components/layout/ClientLayout.jsx`
- [Catalog pages](https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/pages/Home.jsx): `web/frontend/src/pages/Home.jsx`
- [Product detail](https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/pages/ProductDetail.jsx): `web/frontend/src/pages/ProductDetail.jsx`
- [Product search](https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/pages/Search.jsx): `web/frontend/src/pages/Search.jsx`
- [Account pages](https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/pages/Register.jsx): `web/frontend/src/pages/Register.jsx`
- [Auth state](https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/store/authStore.js): `web/frontend/src/store/authStore.js`
- [Cart drawer](https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/components/ui/CartDrawer.jsx): `web/frontend/src/components/ui/CartDrawer.jsx`
- [Cart state](https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/store/cartStore.js): `web/frontend/src/store/cartStore.js`
- [Payment and receipt](https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/pages/Pay.jsx): `web/frontend/src/pages/Pay.jsx`

### Web administration

- [Admin routes](https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/App.jsx): `web/frontend/src/App.jsx`
- [Admin access guard](https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/admin/components/AdminRoute.jsx): `web/frontend/src/admin/components/AdminRoute.jsx`
- [Admin login](https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/admin/pages/AdminLogin.jsx): `web/frontend/src/admin/pages/AdminLogin.jsx`
- [Admin workspace](https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/admin/layouts/AdminLayout.jsx): `web/frontend/src/admin/layouts/AdminLayout.jsx`
- [Dashboard](https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/admin/pages/Dashboard.jsx): `web/frontend/src/admin/pages/Dashboard.jsx`
- [Product management](https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/admin/pages/ProductForm.jsx): `web/frontend/src/admin/pages/ProductForm.jsx`
- [Order management](https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/admin/pages/OrderList.jsx): `web/frontend/src/admin/pages/OrderList.jsx`
- [People management](https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/admin/pages/EmployeeForm.jsx): `web/frontend/src/admin/pages/EmployeeForm.jsx`
- [Statistics](https://github.com/yuukun123/bakery-sweets/blob/main/web/frontend/src/admin/pages/Statistical.jsx): `web/frontend/src/admin/pages/Statistical.jsx`

### Mobile API

- [API application](https://github.com/yuukun123/bakery-sweets/blob/main/mobile/backend/main.py): `mobile/backend/main.py`
- [Versioned API router](https://github.com/yuukun123/bakery-sweets/blob/main/mobile/backend/app/api/v1/api.py): `mobile/backend/app/api/v1/api.py`
- [Authentication endpoint](https://github.com/yuukun123/bakery-sweets/blob/main/mobile/backend/app/api/v1/endpoints/auth.py): `mobile/backend/app/api/v1/endpoints/auth.py`
- [Token security](https://github.com/yuukun123/bakery-sweets/blob/main/mobile/backend/app/core/security.py): `mobile/backend/app/core/security.py`
- [User model](https://github.com/yuukun123/bakery-sweets/blob/main/mobile/backend/app/models/user.py): `mobile/backend/app/models/user.py`
- [Order model](https://github.com/yuukun123/bakery-sweets/blob/main/mobile/backend/app/models/order.py): `mobile/backend/app/models/order.py`
- [WebSocket endpoints](https://github.com/yuukun123/bakery-sweets/blob/main/mobile/backend/app/api/v1/endpoints/websocket.py): `mobile/backend/app/api/v1/endpoints/websocket.py`
- [Socket connections](https://github.com/yuukun123/bakery-sweets/blob/main/mobile/backend/app/websocket/manager.py): `mobile/backend/app/websocket/manager.py`
- [Database access](https://github.com/yuukun123/bakery-sweets/blob/main/mobile/backend/app/config/database.py): `mobile/backend/app/config/database.py`

### PHP administration

- [PHP user management](https://github.com/yuukun123/bakery-sweets/blob/main/app/admin/pages/manager-user.php): `app/admin/pages/manager-user.php`
- [User management view](https://github.com/yuukun123/bakery-sweets/blob/main/app/admin/Views/users/manager.php): `app/admin/Views/users/manager.php`
- [Admin session check](https://github.com/yuukun123/bakery-sweets/blob/main/app/admin/Api_php/check-session-admin.php): `app/admin/Api_php/check-session-admin.php`
- [Admin header](https://github.com/yuukun123/bakery-sweets/blob/main/app/admin/includes/header.php): `app/admin/includes/header.php`

### Other components

- **Shopper**
- **MySQL database**

## Connections

- Shopper → Web routes: opens storefront (evidence: `web/frontend/src/App.jsx`)
- Web routes → Client layout: routes through (evidence: `web/frontend/src/App.jsx`)
- Web routes → Catalog pages: routes to (evidence: `web/frontend/src/App.jsx`)
- Web routes → Product detail: routes to (evidence: `web/frontend/src/App.jsx`)
- Web routes → Product search: routes to (evidence: `web/frontend/src/App.jsx`)
- Web routes → Account pages: routes to (evidence: `web/frontend/src/App.jsx`)
- Web routes → Payment and receipt: routes to (evidence: `web/frontend/src/App.jsx`)
- Client layout → Cart drawer: renders (evidence: `web/frontend/src/components/layout/ClientLayout.jsx`)
- Admin routes → Admin access guard: protects routes (evidence: `web/frontend/src/App.jsx`)
- Admin routes → Admin login: routes to (evidence: `web/frontend/src/App.jsx`)
- Admin routes → Admin workspace: routes through (evidence: `web/frontend/src/App.jsx`)
- Admin routes → Dashboard: routes to (evidence: `web/frontend/src/App.jsx`)
- Admin routes → Product management: routes to (evidence: `web/frontend/src/App.jsx`)
- Admin routes → Order management: routes to (evidence: `web/frontend/src/App.jsx`)
- Admin routes → People management: routes to (evidence: `web/frontend/src/App.jsx`)
- Admin routes → Statistics: routes to (evidence: `web/frontend/src/App.jsx`)
- Admin access guard → Auth state: checks auth (evidence: `web/frontend/src/admin/components/AdminRoute.jsx`)
- Admin login → Auth state: updates auth (evidence: `web/frontend/src/admin/pages/AdminLogin.jsx`)
- API application → Versioned API router: mounts API (evidence: `mobile/backend/main.py`)
- API application → WebSocket endpoints: mounts sockets (evidence: `mobile/backend/main.py`)
- API application → Database access: creates tables (evidence: `mobile/backend/main.py`)
- Authentication endpoint → Database access: uses sessions (evidence: `mobile/backend/app/api/v1/endpoints/auth.py`)
- Authentication endpoint → User model: queries users (evidence: `mobile/backend/app/api/v1/endpoints/auth.py`)
- Authentication endpoint → Token security: uses security (evidence: `mobile/backend/app/api/v1/endpoints/auth.py`)
- WebSocket endpoints → Socket connections: dispatches sockets (evidence: `mobile/backend/app/api/v1/endpoints/websocket.py`)
- User model → Database access: maps database (evidence: `mobile/backend/app/models/user.py`)
- Order model → Database access: maps database (evidence: `mobile/backend/app/models/order.py`)
- Database access → MySQL database: connects to (evidence: `mobile/backend/app/config/database.py`)
- PHP user management → Admin session check: checks session (evidence: `app/admin/pages/manager-user.php`)
- PHP user management → Admin header: includes header (evidence: `app/admin/pages/manager-user.php`)
- PHP user management → User management view: includes view (evidence: `app/admin/pages/manager-user.php`)
