# ashleyfactor1-cpu/meathub architecture

> Architecture diagram of the GitHub repository ashleyfactor1-cpu/meathub, 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/ashleyfactor1-cpu/meathub
- Repository: https://github.com/ashleyfactor1-cpu/meathub

## Overview

MeatHub is a Laravel marketplace whose main customer journey runs from product discovery and cart checkout through pending-order creation, GCash proof submission, and order-status tracking. Administrators manage listings and producers, verify payment, manage order status, and review marketplace metrics. The graph distinguishes those domain stages from the models and notification observer that support them. Several Filament resources and storefront views are present in the tree but were not sampled; their capabilities and connections are included only where documented by the README or visible in sampled routing.

Main entry points: [`app/Models/Order.php`](https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Models/Order.php) (Order Records), [`app/Http/Controllers/OrderController.php`](https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Http/Controllers/OrderController.php) (Order Workflow), [`app/Models/Product.php`](https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Models/Product.php) (Products), [`routes/web.php`](https://github.com/ashleyfactor1-cpu/meathub/blob/main/routes/web.php) (Browse Catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_catalog["Browse Catalog<br/>[web.php]"]
  node_storefront_view["Storefront UI<br/>[home.blade.php]"]
  node_cart["Cart and Checkout UI<br/>[app.js]"]
end

subgraph group_orders["Ordering and Accounts"]
  node_order_controller["Order Workflow"]
  node_order_view["Order and Payment View<br/>[show.blade.php]"]
  node_accounts["Customer Accounts"]
  node_account_view["Order History View<br/>[orders.blade.php]"]
  node_notification_bell["Notification Bell"]
end

subgraph group_admin["Marketplace Admin"]
  node_product_admin["Product Listings"]
  node_producer_admin["Producer Profiles"]
  node_dashboard["Admin Dashboard"]
  node_order_admin["Order Verification<br/>[OrderResource.php]"]
  node_order_pages["Order List Page<br/>[ListOrders.php]"]
end

subgraph group_core["Domain and Notifications"]
  node_order_model["Order Records<br/>[Order.php]"]
  node_item_model["Order Items<br/>[OrderItem.php]"]
  node_product_model["Products<br/>[Product.php]"]
  node_producer_model["Producers<br/>[Producer.php]"]
  node_user_model["Users<br/>[User.php]"]
  node_order_observer["Order Observer<br/>[OrderObserver.php]"]
  node_status_notification["Status Notification"]
end

node_customer(("Customer"))
node_admin_user(("Administrator"))

node_customer -->|"browses"| node_catalog
node_catalog -->|"queries products"| node_product_model
node_catalog -->|"queries producers"| node_producer_model
node_catalog -->|"renders"| node_storefront_view
node_customer -->|"adds items"| node_cart
node_cart -.->|"submits checkout"| node_order_controller
node_order_controller -->|"locks and deducts stock"| node_product_model
node_order_controller -->|"creates order"| node_order_model
node_order_controller -->|"creates items"| node_item_model
node_order_controller -->|"renders order"| node_order_view
node_customer -->|"submits payment proof"| node_order_controller
node_customer -->|"manages account"| node_accounts
node_accounts -->|"creates and authenticates"| node_user_model
node_accounts -->|"loads order history"| node_order_model
node_accounts -->|"renders history"| node_account_view
node_customer -->|"checks updates"| node_notification_bell
node_admin_user -->|"manages listings"| node_product_admin
node_admin_user -->|"manages profiles"| node_producer_admin
node_admin_user -->|"verifies orders"| node_order_admin
node_order_admin -->|"updates status"| node_order_model
node_order_admin -->|"releases stock"| node_product_model
node_order_pages -->|"uses resource"| node_order_admin
node_admin_user -->|"reviews metrics"| node_dashboard
node_dashboard -->|"summarizes orders"| node_order_model
node_dashboard -->|"checks inventory"| node_product_model
node_order_model -->|"has items"| node_item_model
node_product_model -->|"belongs to producer"| node_producer_model
node_user_model -->|"has orders"| node_order_model
node_order_observer -->|"dispatches"| node_status_notification
node_order_observer -->|"observes changes"| node_order_model

click node_catalog "https://github.com/ashleyfactor1-cpu/meathub/blob/main/routes/web.php"
click node_storefront_view "https://github.com/ashleyfactor1-cpu/meathub/blob/main/resources/views/home.blade.php"
click node_cart "https://github.com/ashleyfactor1-cpu/meathub/blob/main/resources/js/app.js"
click node_product_admin "https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Filament/Resources/ProductResource.php"
click node_producer_admin "https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Filament/Resources/ProducerResource.php"
click node_dashboard "https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Filament/Widgets/MeatHubStatsOverview.php"
click node_order_admin "https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Filament/Resources/OrderResource.php"
click node_order_pages "https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Filament/Resources/OrderResource/Pages/ListOrders.php"
click node_order_controller "https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Http/Controllers/OrderController.php"
click node_order_view "https://github.com/ashleyfactor1-cpu/meathub/blob/main/resources/views/orders/show.blade.php"
click node_accounts "https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Http/Controllers/CustomerAccountController.php"
click node_account_view "https://github.com/ashleyfactor1-cpu/meathub/blob/main/resources/views/account/orders.blade.php"
click node_notification_bell "https://github.com/ashleyfactor1-cpu/meathub/blob/main/resources/views/components/customer-notification-bell.blade.php"
click node_order_model "https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Models/Order.php"
click node_item_model "https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Models/OrderItem.php"
click node_product_model "https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Models/Product.php"
click node_producer_model "https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Models/Producer.php"
click node_user_model "https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Models/User.php"
click node_order_observer "https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Observers/OrderObserver.php"
click node_status_notification "https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Notifications/OrderStatusChangedNotification.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_catalog,node_storefront_view,node_cart toneBlue
class node_order_controller,node_order_view,node_accounts,node_account_view,node_notification_bell toneAmber
class node_product_admin,node_producer_admin,node_dashboard,node_order_admin,node_order_pages toneMint
class node_order_model,node_item_model,node_product_model,node_producer_model,node_user_model,node_order_observer,node_status_notification toneRose
class node_customer,node_admin_user toneIndigo
```

## Components

### Storefront

- [Browse Catalog](https://github.com/ashleyfactor1-cpu/meathub/blob/main/routes/web.php): `routes/web.php`
- [Storefront UI](https://github.com/ashleyfactor1-cpu/meathub/blob/main/resources/views/home.blade.php): `resources/views/home.blade.php`
- [Cart and Checkout UI](https://github.com/ashleyfactor1-cpu/meathub/blob/main/resources/js/app.js): `resources/js/app.js`

### Ordering and Accounts

- [Order Workflow](https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Http/Controllers/OrderController.php): `app/Http/Controllers/OrderController.php`
- [Order and Payment View](https://github.com/ashleyfactor1-cpu/meathub/blob/main/resources/views/orders/show.blade.php): `resources/views/orders/show.blade.php`
- [Customer Accounts](https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Http/Controllers/CustomerAccountController.php): `app/Http/Controllers/CustomerAccountController.php`
- [Order History View](https://github.com/ashleyfactor1-cpu/meathub/blob/main/resources/views/account/orders.blade.php): `resources/views/account/orders.blade.php`
- [Notification Bell](https://github.com/ashleyfactor1-cpu/meathub/blob/main/resources/views/components/customer-notification-bell.blade.php): `resources/views/components/customer-notification-bell.blade.php`

### Marketplace Admin

- [Product Listings](https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Filament/Resources/ProductResource.php): `app/Filament/Resources/ProductResource.php`
- [Producer Profiles](https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Filament/Resources/ProducerResource.php): `app/Filament/Resources/ProducerResource.php`
- [Admin Dashboard](https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Filament/Widgets/MeatHubStatsOverview.php): `app/Filament/Widgets/MeatHubStatsOverview.php`
- [Order Verification](https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Filament/Resources/OrderResource.php): `app/Filament/Resources/OrderResource.php`
- [Order List Page](https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Filament/Resources/OrderResource/Pages/ListOrders.php): `app/Filament/Resources/OrderResource/Pages/ListOrders.php`

### Domain and Notifications

- [Order Records](https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Models/Order.php): `app/Models/Order.php`
- [Order Items](https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Models/OrderItem.php): `app/Models/OrderItem.php`
- [Products](https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Models/Product.php): `app/Models/Product.php`
- [Producers](https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Models/Producer.php): `app/Models/Producer.php`
- [Users](https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Models/User.php): `app/Models/User.php`
- [Order Observer](https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Observers/OrderObserver.php): `app/Observers/OrderObserver.php`
- [Status Notification](https://github.com/ashleyfactor1-cpu/meathub/blob/main/app/Notifications/OrderStatusChangedNotification.php): `app/Notifications/OrderStatusChangedNotification.php`

### Other components

- **Customer**
- **Administrator**

## Connections

- Customer → Browse Catalog: browses (evidence: `README.md`)
- Browse Catalog → Products: queries products (evidence: `routes/web.php`)
- Browse Catalog → Producers: queries producers (evidence: `routes/web.php`)
- Browse Catalog → Storefront UI: renders (evidence: `routes/web.php`)
- Customer → Cart and Checkout UI: adds items (evidence: `README.md`)
- Cart and Checkout UI → Order Workflow: submits checkout
- Order Workflow → Products: locks and deducts stock (evidence: `app/Http/Controllers/OrderController.php`)
- Order Workflow → Order Records: creates order (evidence: `app/Http/Controllers/OrderController.php`)
- Order Workflow → Order Items: creates items (evidence: `app/Http/Controllers/OrderController.php`)
- Order Workflow → Order and Payment View: renders order (evidence: `app/Http/Controllers/OrderController.php`)
- Customer → Order Workflow: submits payment proof (evidence: `README.md`)
- Customer → Customer Accounts: manages account
- Customer Accounts → Users: creates and authenticates (evidence: `app/Http/Controllers/CustomerAccountController.php`)
- Customer Accounts → Order Records: loads order history (evidence: `app/Http/Controllers/CustomerAccountController.php`)
- Customer Accounts → Order History View: renders history (evidence: `app/Http/Controllers/CustomerAccountController.php`)
- Customer → Notification Bell: checks updates (evidence: `README.md`)
- Administrator → Product Listings: manages listings (evidence: `README.md`)
- Administrator → Producer Profiles: manages profiles (evidence: `README.md`)
- Administrator → Order Verification: verifies orders (evidence: `README.md`)
- Order Verification → Order Records: updates status (evidence: `app/Filament/Resources/OrderResource.php`)
- Order Verification → Products: releases stock (evidence: `app/Filament/Resources/OrderResource.php`)
- Order List Page → Order Verification: uses resource (evidence: `app/Filament/Resources/OrderResource/Pages/ListOrders.php`)
- Administrator → Admin Dashboard: reviews metrics (evidence: `README.md`)
- Admin Dashboard → Order Records: summarizes orders (evidence: `app/Filament/Widgets/MeatHubStatsOverview.php`)
- Admin Dashboard → Products: checks inventory (evidence: `app/Filament/Widgets/MeatHubStatsOverview.php`)
- Order Records → Order Items: has items (evidence: `app/Models/Order.php`)
- Products → Producers: belongs to producer (evidence: `app/Models/Product.php`)
- Users → Order Records: has orders (evidence: `app/Models/User.php`)
- Order Observer → Status Notification: dispatches (evidence: `app/Observers/OrderObserver.php`)
- Order Observer → Order Records: observes changes (evidence: `app/Providers/AppServiceProvider.php`)
