# johnmichaelanadon7-cmd/webdev architecture

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

- Interactive diagram: https://gitdiagram.com/johnmichaelanadon7-cmd/webdev
- Repository: https://github.com/johnmichaelanadon7-cmd/webdev

## Overview

Harvest Bread Co. is a PHP bakery storefront with customer accounts, shopping cart and ordering, payment recording, and administrator tools. The customer path is product browsing, cart management, checkout and order creation, then payment and order tracking; separate branches cover account management and catalog/order administration. Shared PHP helpers provide database access, session-cart operations, validation and error redirects. The README is empty; relationships below are limited to source excerpts and SOURCE INDEX references, so unsampled form wiring is not asserted.

Main entry points: [`database/config.php`](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/database/config.php) (MySQL database), [`partials/header.php`](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/partials/header.php) (Site navigation), [`cart_helpers.php`](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/cart_helpers.php) (Cart operations), [`error_helpers.php`](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/error_helpers.php) (Error redirects)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_store["Product storefront<br/>[index.php]"]
  node_site_header["Site navigation<br/>[header.php]"]
end

subgraph group_accounts["Accounts"]
  node_account_pages["Sign-in &amp; registration<br/>[signup.php]"]
  node_account_handlers["Account handlers"]
  node_validation["Input validation<br/>[validation.php]"]
  node_errors["Error redirects<br/>[error_helpers.php]"]
end

subgraph group_commerce["Orders &amp; Payments"]
  node_cart_page["Cart view<br/>[cart.php]"]
  node_cart_ops["Cart operations<br/>[cart_helpers.php]"]
  node_cart_endpoints["Cart endpoints<br/>[cart_add.php]"]
  node_cart_update["Cart updates<br/>[cart_update.php]"]
  node_checkout_page["Checkout form<br/>[checkout.php]"]
  node_checkout["Order creation"]
  node_payment_page["Payment form<br/>[payment.php]"]
  node_payment_handler["Payment processing"]
  node_order_views["Order history &amp; detail<br/>[orders.php]"]
  node_order_success["Order confirmation<br/>[order_success.php]"]
end

subgraph group_operations["Administration"]
  node_admin_dashboard["User administration<br/>[admin.php]"]
  node_admin_products["Product administration<br/>[admin_products.php]"]
  node_admin_orders["Order administration<br/>[admin_orders.php]"]
  node_admin_actions["Admin actions<br/>[admin_actions.php]"]
  node_order_actions["Order status actions"]
end

node_customer(("Customer"))
node_database[("MySQL database<br/>[config.php]")]

node_store -->|"loads products"| node_database
node_store -->|"uses cart"| node_cart_ops
node_store -->|"includes navigation"| node_site_header
node_site_header -->|"counts items"| node_cart_ops
node_cart_page -->|"reads products"| node_database
node_cart_page -->|"reads cart"| node_cart_ops
node_cart_page -->|"includes navigation"| node_site_header
node_cart_endpoints -->|"accesses products"| node_database
node_cart_endpoints -->|"updates cart"| node_cart_ops
node_cart_update -->|"accesses products"| node_database
node_cart_update -->|"updates cart"| node_cart_ops
node_checkout_page -->|"loads checkout data"| node_database
node_checkout_page -->|"reads cart"| node_cart_ops
node_checkout_page -->|"includes navigation"| node_site_header
node_checkout -->|"creates order"| node_database
node_checkout -->|"reads and clears"| node_cart_ops
node_checkout -->|"redirects errors"| node_errors
node_payment_page -->|"loads order"| node_database
node_payment_page -->|"includes navigation"| node_site_header
node_payment_handler -->|"records payment"| node_database
node_payment_handler -->|"redirects errors"| node_errors
node_order_views -->|"loads orders"| node_database
node_order_views -->|"includes navigation"| node_site_header
node_order_success -->|"loads order"| node_database
node_order_success -->|"includes navigation"| node_site_header
node_account_pages -->|"includes navigation"| node_site_header
node_account_handlers -->|"stores account"| node_database
node_account_handlers -->|"validates input"| node_validation
node_account_handlers -->|"redirects errors"| node_errors
node_admin_dashboard -->|"loads users"| node_database
node_admin_products -->|"loads products"| node_database
node_admin_orders -->|"loads orders"| node_database
node_admin_actions -->|"updates users"| node_database
node_admin_actions -->|"redirects errors"| node_errors
node_order_actions -->|"updates orders"| node_database
node_order_actions -->|"redirects errors"| node_errors

click node_store "https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/index.php"
click node_site_header "https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/partials/header.php"
click node_cart_page "https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/cart.php"
click node_cart_ops "https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/cart_helpers.php"
click node_cart_endpoints "https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/cart_add.php"
click node_cart_update "https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/cart_update.php"
click node_checkout_page "https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/checkout.php"
click node_checkout "https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/checkout_function.php"
click node_payment_page "https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/payment.php"
click node_payment_handler "https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/payment_function.php"
click node_order_views "https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/orders.php"
click node_order_success "https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/order_success.php"
click node_account_pages "https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/signup.php"
click node_account_handlers "https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/signup_function.php"
click node_admin_dashboard "https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/admin.php"
click node_admin_products "https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/admin_products.php"
click node_admin_orders "https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/admin_orders.php"
click node_admin_actions "https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/admin_actions.php"
click node_order_actions "https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/admin_order_actions.php"
click node_database "https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/database/config.php"
click node_validation "https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/validation.php"
click node_errors "https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/error_helpers.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_store,node_site_header toneBlue
class node_account_pages,node_account_handlers,node_validation,node_errors,node_database toneAmber
class node_cart_page,node_cart_ops,node_cart_endpoints,node_cart_update,node_checkout_page,node_checkout,node_payment_page,node_payment_handler,node_order_views,node_order_success toneMint
class node_admin_dashboard,node_admin_products,node_admin_orders,node_admin_actions,node_order_actions toneRose
class node_customer toneIndigo
```

## Components

### Storefront

- [Product storefront](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/index.php): `index.php`
- [Site navigation](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/partials/header.php): `partials/header.php`

### Accounts

- [Sign-in & registration](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/signup.php): `signup.php`
- [Account handlers](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/signup_function.php): `signup_function.php`
- [Input validation](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/validation.php): `validation.php`
- [Error redirects](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/error_helpers.php): `error_helpers.php`

### Orders & Payments

- [Cart view](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/cart.php): `cart.php`
- [Cart operations](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/cart_helpers.php): `cart_helpers.php`
- [Cart endpoints](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/cart_add.php): `cart_add.php`
- [Cart updates](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/cart_update.php): `cart_update.php`
- [Checkout form](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/checkout.php): `checkout.php`
- [Order creation](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/checkout_function.php): `checkout_function.php`
- [Payment form](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/payment.php): `payment.php`
- [Payment processing](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/payment_function.php): `payment_function.php`
- [Order history & detail](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/orders.php): `orders.php`
- [Order confirmation](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/order_success.php): `order_success.php`

### Administration

- [User administration](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/admin.php): `admin.php`
- [Product administration](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/admin_products.php): `admin_products.php`
- [Order administration](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/admin_orders.php): `admin_orders.php`
- [Admin actions](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/admin_actions.php): `admin_actions.php`
- [Order status actions](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/admin_order_actions.php): `admin_order_actions.php`

### Other components

- **Customer**
- [MySQL database](https://github.com/johnmichaelanadon7-cmd/webdev/blob/main/database/config.php): `database/config.php`

## Connections

- Product storefront → MySQL database: loads products (evidence: `index.php`)
- Product storefront → Cart operations: uses cart (evidence: `index.php`)
- Product storefront → Site navigation: includes navigation (evidence: `index.php`)
- Site navigation → Cart operations: counts items (evidence: `partials/header.php`)
- Cart view → MySQL database: reads products (evidence: `cart.php`)
- Cart view → Cart operations: reads cart (evidence: `cart.php`)
- Cart view → Site navigation: includes navigation (evidence: `cart.php`)
- Cart endpoints → MySQL database: accesses products (evidence: `cart_add.php`)
- Cart endpoints → Cart operations: updates cart (evidence: `cart_add.php`)
- Cart updates → MySQL database: accesses products (evidence: `cart_update.php`)
- Cart updates → Cart operations: updates cart (evidence: `cart_update.php`)
- Checkout form → MySQL database: loads checkout data (evidence: `checkout.php`)
- Checkout form → Cart operations: reads cart (evidence: `checkout.php`)
- Checkout form → Site navigation: includes navigation (evidence: `checkout.php`)
- Order creation → MySQL database: creates order (evidence: `checkout_function.php`)
- Order creation → Cart operations: reads and clears (evidence: `checkout_function.php`)
- Order creation → Error redirects: redirects errors (evidence: `checkout_function.php`)
- Payment form → MySQL database: loads order (evidence: `payment.php`)
- Payment form → Site navigation: includes navigation (evidence: `payment.php`)
- Payment processing → MySQL database: records payment (evidence: `payment_function.php`)
- Payment processing → Error redirects: redirects errors (evidence: `payment_function.php`)
- Order history & detail → MySQL database: loads orders (evidence: `orders.php`)
- Order history & detail → Site navigation: includes navigation (evidence: `orders.php`)
- Order confirmation → MySQL database: loads order (evidence: `order_success.php`)
- Order confirmation → Site navigation: includes navigation (evidence: `order_success.php`)
- Sign-in & registration → Site navigation: includes navigation (evidence: `signup.php`)
- Account handlers → MySQL database: stores account (evidence: `signup_function.php`)
- Account handlers → Input validation: validates input (evidence: `signup_function.php`)
- Account handlers → Error redirects: redirects errors (evidence: `signup_function.php`)
- User administration → MySQL database: loads users (evidence: `admin.php`)
- Product administration → MySQL database: loads products (evidence: `admin_products.php`)
- Order administration → MySQL database: loads orders (evidence: `admin_orders.php`)
- Admin actions → MySQL database: updates users (evidence: `admin_actions.php`)
- Admin actions → Error redirects: redirects errors (evidence: `admin_actions.php`)
- Order status actions → MySQL database: updates orders (evidence: `admin_order_actions.php`)
- Order status actions → Error redirects: redirects errors (evidence: `admin_order_actions.php`)
