# zholaman03/gmcosmo architecture

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

- Interactive diagram: https://gitdiagram.com/zholaman03/gmcosmo
- Repository: https://github.com/zholaman03/gmcosmo

## Overview

This is a Laravel cosmetics-store application: shoppers browse products, manage a browser-side cart, and place orders; payment creation and payment-status webhooks form a separate checkout stage. Admin capabilities include product and category management, bulk product import, orders, delivery methods, and sales. Edges follow shown controller/model references and the route references in the source index; API routing and some front-end wiring were not sampled, so uncertain connections are omitted.

Main entry points: [`routes/web.php`](https://github.com/zholaman03/gmcosmo/blob/main/routes/web.php) (Web routes), [`app/Models/Product.php`](https://github.com/zholaman03/gmcosmo/blob/main/app/Models/Product.php) (Products), [`app/Models/Order.php`](https://github.com/zholaman03/gmcosmo/blob/main/app/Models/Order.php) (Orders), [`app/Http/Controllers/Api/ApiOrderController.php`](https://github.com/zholaman03/gmcosmo/blob/main/app/Http/Controllers/Api/ApiOrderController.php) (Order placement)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shop["Storefront"]
  node_web_routes["Web routes<br/>[web.php]"]
  node_catalog["Product catalog"]
end

subgraph group_checkout["Orders and payments"]
  node_order_api["Order placement"]
  node_payment_api["Payment status"]
  node_payment_webhook["Payment webhook"]
  node_apipay_service["ApiPay client<br/>[ApiPayService.php]"]
end

subgraph group_admin["Administration"]
  node_orders_admin["Order administration"]
  node_admin_products["Product management"]
  node_product_import["Product import"]
  node_import_parser["Import processing<br/>[ProductsImport.php]"]
  node_sales_admin["Sales management<br/>[SaleController.php]"]
  node_delivery_admin["Delivery settings"]
  node_login["Admin login"]
end

subgraph group_domain["Domain data"]
  node_products[("Products<br/>[Product.php]")]
  node_categories[("Categories<br/>[Category.php]")]
  node_orders[("Orders<br/>[Order.php]")]
  node_payments[("Payments<br/>[Payment.php]")]
  node_delivery_methods[("Delivery methods<br/>[DeliveryMethod.php]")]
  node_sales[("Sales<br/>[Sale.php]")]
  node_users[("Users<br/>[User.php]")]
end

subgraph group_frontend["Browser interface"]
  node_cart["Cart state<br/>[app.js]"]
  node_modal_api["Modal API<br/>[api.js]"]
  node_modal_ui["Modal handlers<br/>[showmodal.js]"]
end

node_customer(("Shopper"))
node_apipay{{"ApiPay"}}

node_customer -->|"requests pages"| node_web_routes
node_web_routes -->|"routes to"| node_catalog
node_catalog -->|"queries"| node_products
node_catalog -->|"loads"| node_categories
node_catalog -->|"loads active"| node_delivery_methods
node_customer -.->|"manages items"| node_cart
node_modal_ui -->|"imports"| node_modal_api
node_modal_ui -->|"imports"| node_cart
node_order_api -->|"reads products"| node_products
node_order_api -->|"creates orders"| node_orders
node_order_api -->|"checks delivery"| node_delivery_methods
node_order_api -->|"requests invoice"| node_apipay_service
node_apipay_service -->|"creates QR invoice"| node_apipay
node_payment_api -->|"reads order"| node_orders
node_payment_api -->|"reads payment"| node_payments
node_payment_api -->|"uses client"| node_apipay_service
node_apipay -.->|"sends status"| node_payment_webhook
node_payment_webhook -->|"finds and updates"| node_payments
node_payment_webhook -->|"decrements stock"| node_products
node_web_routes -->|"routes to"| node_admin_products
node_web_routes -->|"routes to"| node_product_import
node_web_routes -->|"routes to"| node_orders_admin
node_web_routes -->|"routes to"| node_sales_admin
node_web_routes -->|"routes to"| node_delivery_admin
node_web_routes -->|"routes to"| node_login
node_admin_products -->|"manages"| node_products
node_admin_products -->|"loads categories"| node_categories
node_product_import -->|"invokes"| node_import_parser
node_import_parser -->|"imports records"| node_products
node_import_parser -->|"resolves categories"| node_categories
node_orders_admin -->|"manages"| node_orders
node_sales_admin -->|"manages"| node_sales
node_delivery_admin -->|"manages"| node_delivery_methods
node_products -->|"belongs to"| node_categories
node_products -->|"associated with"| node_sales
node_orders -->|"references"| node_delivery_methods
node_orders -->|"has payments"| node_payments

click node_web_routes "https://github.com/zholaman03/gmcosmo/blob/main/routes/web.php"
click node_catalog "https://github.com/zholaman03/gmcosmo/blob/main/app/Http/Controllers/ProductController.php"
click node_cart "https://github.com/zholaman03/gmcosmo/blob/main/resources/js/app.js"
click node_modal_api "https://github.com/zholaman03/gmcosmo/blob/main/resources/js/api.js"
click node_modal_ui "https://github.com/zholaman03/gmcosmo/blob/main/resources/js/showmodal.js"
click node_order_api "https://github.com/zholaman03/gmcosmo/blob/main/app/Http/Controllers/Api/ApiOrderController.php"
click node_orders_admin "https://github.com/zholaman03/gmcosmo/blob/main/app/Http/Controllers/Admin/OrderController.php"
click node_payment_api "https://github.com/zholaman03/gmcosmo/blob/main/app/Http/Controllers/Api/PaymentController.php"
click node_payment_webhook "https://github.com/zholaman03/gmcosmo/blob/main/app/Http/Controllers/Api/ApiPayWebhookController.php"
click node_apipay_service "https://github.com/zholaman03/gmcosmo/blob/main/app/Services/ApiPayService.php"
click node_admin_products "https://github.com/zholaman03/gmcosmo/blob/main/app/Http/Controllers/Admin/AdminController.php"
click node_product_import "https://github.com/zholaman03/gmcosmo/blob/main/app/Http/Controllers/Admin/ImportController.php"
click node_import_parser "https://github.com/zholaman03/gmcosmo/blob/main/app/Imports/ProductsImport.php"
click node_sales_admin "https://github.com/zholaman03/gmcosmo/blob/main/app/Http/Controllers/Admin/SaleController.php"
click node_delivery_admin "https://github.com/zholaman03/gmcosmo/blob/main/app/Http/Controllers/Admin/DeliveryController.php"
click node_login "https://github.com/zholaman03/gmcosmo/blob/main/app/Http/Controllers/Auth/LoginController.php"
click node_products "https://github.com/zholaman03/gmcosmo/blob/main/app/Models/Product.php"
click node_categories "https://github.com/zholaman03/gmcosmo/blob/main/app/Models/Category.php"
click node_orders "https://github.com/zholaman03/gmcosmo/blob/main/app/Models/Order.php"
click node_payments "https://github.com/zholaman03/gmcosmo/blob/main/app/Models/Payment.php"
click node_delivery_methods "https://github.com/zholaman03/gmcosmo/blob/main/app/Models/DeliveryMethod.php"
click node_sales "https://github.com/zholaman03/gmcosmo/blob/main/app/Models/Sale.php"
click node_users "https://github.com/zholaman03/gmcosmo/blob/main/app/Models/User.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_routes,node_catalog toneBlue
class node_order_api,node_payment_api,node_payment_webhook,node_apipay_service toneAmber
class node_orders_admin,node_admin_products,node_product_import,node_import_parser,node_sales_admin,node_delivery_admin,node_login,node_apipay toneMint
class node_products,node_categories,node_orders,node_payments,node_delivery_methods,node_sales,node_users toneRose
class node_cart,node_modal_api,node_modal_ui,node_customer toneIndigo
```

## Components

### Storefront

- [Web routes](https://github.com/zholaman03/gmcosmo/blob/main/routes/web.php): `routes/web.php`
- [Product catalog](https://github.com/zholaman03/gmcosmo/blob/main/app/Http/Controllers/ProductController.php): `app/Http/Controllers/ProductController.php`

### Orders and payments

- [Order placement](https://github.com/zholaman03/gmcosmo/blob/main/app/Http/Controllers/Api/ApiOrderController.php): `app/Http/Controllers/Api/ApiOrderController.php`
- [Payment status](https://github.com/zholaman03/gmcosmo/blob/main/app/Http/Controllers/Api/PaymentController.php): `app/Http/Controllers/Api/PaymentController.php`
- [Payment webhook](https://github.com/zholaman03/gmcosmo/blob/main/app/Http/Controllers/Api/ApiPayWebhookController.php): `app/Http/Controllers/Api/ApiPayWebhookController.php`
- [ApiPay client](https://github.com/zholaman03/gmcosmo/blob/main/app/Services/ApiPayService.php): `app/Services/ApiPayService.php`

### Administration

- [Order administration](https://github.com/zholaman03/gmcosmo/blob/main/app/Http/Controllers/Admin/OrderController.php): `app/Http/Controllers/Admin/OrderController.php`
- [Product management](https://github.com/zholaman03/gmcosmo/blob/main/app/Http/Controllers/Admin/AdminController.php): `app/Http/Controllers/Admin/AdminController.php`
- [Product import](https://github.com/zholaman03/gmcosmo/blob/main/app/Http/Controllers/Admin/ImportController.php): `app/Http/Controllers/Admin/ImportController.php`
- [Import processing](https://github.com/zholaman03/gmcosmo/blob/main/app/Imports/ProductsImport.php): `app/Imports/ProductsImport.php`
- [Sales management](https://github.com/zholaman03/gmcosmo/blob/main/app/Http/Controllers/Admin/SaleController.php): `app/Http/Controllers/Admin/SaleController.php`
- [Delivery settings](https://github.com/zholaman03/gmcosmo/blob/main/app/Http/Controllers/Admin/DeliveryController.php): `app/Http/Controllers/Admin/DeliveryController.php`
- [Admin login](https://github.com/zholaman03/gmcosmo/blob/main/app/Http/Controllers/Auth/LoginController.php): `app/Http/Controllers/Auth/LoginController.php`

### Domain data

- [Products](https://github.com/zholaman03/gmcosmo/blob/main/app/Models/Product.php): `app/Models/Product.php`
- [Categories](https://github.com/zholaman03/gmcosmo/blob/main/app/Models/Category.php): `app/Models/Category.php`
- [Orders](https://github.com/zholaman03/gmcosmo/blob/main/app/Models/Order.php): `app/Models/Order.php`
- [Payments](https://github.com/zholaman03/gmcosmo/blob/main/app/Models/Payment.php): `app/Models/Payment.php`
- [Delivery methods](https://github.com/zholaman03/gmcosmo/blob/main/app/Models/DeliveryMethod.php): `app/Models/DeliveryMethod.php`
- [Sales](https://github.com/zholaman03/gmcosmo/blob/main/app/Models/Sale.php): `app/Models/Sale.php`
- [Users](https://github.com/zholaman03/gmcosmo/blob/main/app/Models/User.php): `app/Models/User.php`

### Browser interface

- [Cart state](https://github.com/zholaman03/gmcosmo/blob/main/resources/js/app.js): `resources/js/app.js`
- [Modal API](https://github.com/zholaman03/gmcosmo/blob/main/resources/js/api.js): `resources/js/api.js`
- [Modal handlers](https://github.com/zholaman03/gmcosmo/blob/main/resources/js/showmodal.js): `resources/js/showmodal.js`

### Other components

- **Shopper**
- **ApiPay**

## Connections

- Shopper → Web routes: requests pages (evidence: `routes/web.php`)
- Web routes → Product catalog: routes to (evidence: `routes/web.php`)
- Product catalog → Products: queries (evidence: `app/Http/Controllers/ProductController.php`)
- Product catalog → Categories: loads (evidence: `app/Http/Controllers/ProductController.php`)
- Product catalog → Delivery methods: loads active (evidence: `app/Http/Controllers/ProductController.php`)
- Shopper → Cart state: manages items
- Modal handlers → Modal API: imports (evidence: `resources/js/showmodal.js`)
- Modal handlers → Cart state: imports (evidence: `resources/js/showmodal.js`)
- Order placement → Products: reads products (evidence: `app/Http/Controllers/Api/ApiOrderController.php`)
- Order placement → Orders: creates orders (evidence: `app/Http/Controllers/Api/ApiOrderController.php`)
- Order placement → Delivery methods: checks delivery (evidence: `app/Http/Controllers/Api/ApiOrderController.php`)
- Order placement → ApiPay client: requests invoice (evidence: `app/Http/Controllers/Api/ApiOrderController.php`)
- ApiPay client → ApiPay: creates QR invoice (evidence: `app/Services/ApiPayService.php`)
- Payment status → Orders: reads order (evidence: `app/Http/Controllers/Api/PaymentController.php`)
- Payment status → Payments: reads payment (evidence: `app/Http/Controllers/Api/PaymentController.php`)
- Payment status → ApiPay client: uses client (evidence: `app/Http/Controllers/Api/PaymentController.php`)
- ApiPay → Payment webhook: sends status
- Payment webhook → Payments: finds and updates (evidence: `app/Http/Controllers/Api/ApiPayWebhookController.php`)
- Payment webhook → Products: decrements stock (evidence: `app/Http/Controllers/Api/ApiPayWebhookController.php`)
- Web routes → Product management: routes to (evidence: `routes/web.php`)
- Web routes → Product import: routes to (evidence: `routes/web.php`)
- Web routes → Order administration: routes to (evidence: `routes/web.php`)
- Web routes → Sales management: routes to (evidence: `routes/web.php`)
- Web routes → Delivery settings: routes to (evidence: `routes/web.php`)
- Web routes → Admin login: routes to (evidence: `routes/web.php`)
- Product management → Products: manages (evidence: `app/Http/Controllers/Admin/AdminController.php`)
- Product management → Categories: loads categories (evidence: `app/Http/Controllers/Admin/AdminController.php`)
- Product import → Import processing: invokes (evidence: `app/Http/Controllers/Admin/ImportController.php`)
- Import processing → Products: imports records (evidence: `app/Imports/ProductsImport.php`)
- Import processing → Categories: resolves categories (evidence: `app/Imports/ProductsImport.php`)
- Order administration → Orders: manages (evidence: `app/Http/Controllers/Admin/OrderController.php`)
- Sales management → Sales: manages (evidence: `app/Http/Controllers/Admin/SaleController.php`)
- Delivery settings → Delivery methods: manages (evidence: `app/Http/Controllers/Admin/DeliveryController.php`)
- Products → Categories: belongs to (evidence: `app/Models/Product.php`)
- Products → Sales: associated with (evidence: `app/Models/Product.php`)
- Orders → Delivery methods: references (evidence: `app/Models/Order.php`)
- Orders → Payments: has payments (evidence: `app/Models/Order.php`)
