# trunghieu104/sneaker-square architecture

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

- Interactive diagram: https://gitdiagram.com/trunghieu104/sneaker-square
- Repository: https://github.com/trunghieu104/sneaker-square

## Overview

Sneaker Square is a Laravel sneaker-commerce application with a customer storefront and an administrative CMS. The principal customer journey is browsing and filtering products, managing a cart and coupon, placing an order, paying through MoMo or VNPay, and following delivery. Separate capabilities include account and social login, editorial content, admin inventory and order operations, and business reporting. The map reflects README capabilities and the supplied source excerpts; unsampled subsystem wiring is shown only where the product workflow is documented.

Main entry points: [`app/Models`](https://github.com/trunghieu104/sneaker-square/tree/main/app/Models) (Commerce Data), [`app/Actions/PlaceOrderAction.php`](https://github.com/trunghieu104/sneaker-square/blob/main/app/Actions/PlaceOrderAction.php) (Order Placement), [`app/Services/CartService.php`](https://github.com/trunghieu104/sneaker-square/blob/main/app/Services/CartService.php) (Cart and Pricing), [`app/Http/Requests/Frontend/CheckoutRequest.php`](https://github.com/trunghieu104/sneaker-square/blob/main/app/Http/Requests/Frontend/CheckoutRequest.php) (Checkout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shopping["Storefront Shopping"]
  node_catalog["Catalog and Search"]
  node_cart["Cart and Pricing<br/>[CartService.php]"]
  node_checkout["Checkout"]
  node_coupons["Coupon Validation"]
end

subgraph group_fulfillment["Order Fulfillment"]
  node_orders["Order Placement"]
  node_payment_callback["Payment Callback"]
  node_payment_manager["Gateway Selection"]
  node_shipping["Shipping Service"]
  node_shipment_updates["Shipment Updates"]
  node_order_data[("Commerce Data")]
end

subgraph group_accounts["Accounts and Content"]
  node_accounts["Customer Accounts"]
  node_social_login["Social Login<br/>[LoginGoogle.php]"]
  node_content["Blog and CMS<br/>[BlogController.php]"]
end

subgraph group_administration["Administration and Reporting"]
  node_admin_ops["Store Management"]
  node_admin_orders["Order Management"]
  node_reporting["Statistics and Export"]
end

subgraph group_integrations["External Integrations"]
  node_payment_gateways["MoMo and VNPay"]
  node_carrier["GHN Carrier<br/>[GhnCarrier.php]"]
  node_mail["Queued Email<br/>[OrderMailer.php]"]
  node_mail_service["Mail Service"]
end

node_customer(("Customer"))
node_admin(("Administrator"))

node_customer -->|"browses"| node_catalog
node_customer -->|"manages cart"| node_cart
node_cart -->|"validates coupon"| node_coupons
node_customer -->|"submits checkout"| node_checkout
node_checkout -->|"places order"| node_orders
node_orders -->|"writes order"| node_order_data
node_customer -->|"returns from payment"| node_payment_callback
node_payment_callback -->|"verifies callback"| node_payment_manager
node_payment_manager -->|"dispatches verification"| node_payment_gateways
node_payment_gateways -->|"updates payment"| node_order_data
node_admin -->|"manages catalog"| node_admin_ops
node_admin -->|"manages orders"| node_admin_orders
node_admin_orders -->|"reads and updates"| node_order_data
node_admin -->|"views reports"| node_reporting
node_admin -->|"manages content"| node_content
node_customer -->|"registers and signs in"| node_accounts
node_customer -.->|"uses social login"| node_social_login
node_customer -->|"reads content"| node_content
node_shipping -->|"books shipment"| node_carrier
node_carrier -->|"sends status"| node_shipment_updates
node_shipment_updates -->|"records events"| node_order_data
node_orders -->|"requests confirmation"| node_mail
node_mail -->|"queues email"| node_mail_service

click node_catalog "https://github.com/trunghieu104/sneaker-square/blob/main/app/Http/Controllers/Frontend/ProductController.php"
click node_cart "https://github.com/trunghieu104/sneaker-square/blob/main/app/Services/CartService.php"
click node_checkout "https://github.com/trunghieu104/sneaker-square/blob/main/app/Http/Requests/Frontend/CheckoutRequest.php"
click node_coupons "https://github.com/trunghieu104/sneaker-square/blob/main/app/Http/Controllers/Frontend/ProductController.php"
click node_orders "https://github.com/trunghieu104/sneaker-square/blob/main/app/Actions/PlaceOrderAction.php"
click node_payment_callback "https://github.com/trunghieu104/sneaker-square/blob/main/app/Http/Controllers/Frontend/PaymentCallbackController.php"
click node_payment_manager "https://github.com/trunghieu104/sneaker-square/blob/main/app/Services/Payment/PaymentGatewayManager.php"
click node_payment_gateways "https://github.com/trunghieu104/sneaker-square/tree/main/app/Services/Payment"
click node_shipping "https://github.com/trunghieu104/sneaker-square/blob/main/app/Services/ShippingService.php"
click node_carrier "https://github.com/trunghieu104/sneaker-square/blob/main/app/Services/Shipping/GhnCarrier.php"
click node_shipment_updates "https://github.com/trunghieu104/sneaker-square/blob/main/app/Http/Controllers/Frontend/ShippingWebhookController.php"
click node_order_data "https://github.com/trunghieu104/sneaker-square/tree/main/app/Models"
click node_accounts "https://github.com/trunghieu104/sneaker-square/blob/main/app/Http/Controllers/Frontend/AuthUserController.php"
click node_social_login "https://github.com/trunghieu104/sneaker-square/blob/main/app/Http/Controllers/Frontend/LoginGoogle.php"
click node_content "https://github.com/trunghieu104/sneaker-square/blob/main/app/Http/Controllers/Frontend/BlogController.php"
click node_admin_ops "https://github.com/trunghieu104/sneaker-square/blob/main/app/Http/Controllers/Backend/ProductAdminController.php"
click node_admin_orders "https://github.com/trunghieu104/sneaker-square/blob/main/app/Http/Controllers/Backend/OrderAdminController.php"
click node_reporting "https://github.com/trunghieu104/sneaker-square/blob/main/app/Services/DashboardStatisticsService.php"
click node_mail "https://github.com/trunghieu104/sneaker-square/blob/main/app/Services/OrderMailer.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_cart,node_checkout,node_coupons toneBlue
class node_orders,node_payment_callback,node_payment_manager,node_shipping,node_shipment_updates,node_order_data toneAmber
class node_accounts,node_social_login,node_content toneMint
class node_admin_ops,node_admin_orders,node_reporting toneRose
class node_payment_gateways,node_carrier,node_mail,node_mail_service,node_customer,node_admin toneIndigo
```

## Components

### Storefront Shopping

- [Catalog and Search](https://github.com/trunghieu104/sneaker-square/blob/main/app/Http/Controllers/Frontend/ProductController.php): `app/Http/Controllers/Frontend/ProductController.php`
- [Cart and Pricing](https://github.com/trunghieu104/sneaker-square/blob/main/app/Services/CartService.php): `app/Services/CartService.php`
- [Checkout](https://github.com/trunghieu104/sneaker-square/blob/main/app/Http/Requests/Frontend/CheckoutRequest.php): `app/Http/Requests/Frontend/CheckoutRequest.php`
- [Coupon Validation](https://github.com/trunghieu104/sneaker-square/blob/main/app/Http/Controllers/Frontend/ProductController.php): `app/Http/Controllers/Frontend/ProductController.php`

### Order Fulfillment

- [Order Placement](https://github.com/trunghieu104/sneaker-square/blob/main/app/Actions/PlaceOrderAction.php): `app/Actions/PlaceOrderAction.php`
- [Payment Callback](https://github.com/trunghieu104/sneaker-square/blob/main/app/Http/Controllers/Frontend/PaymentCallbackController.php): `app/Http/Controllers/Frontend/PaymentCallbackController.php`
- [Gateway Selection](https://github.com/trunghieu104/sneaker-square/blob/main/app/Services/Payment/PaymentGatewayManager.php): `app/Services/Payment/PaymentGatewayManager.php`
- [Shipping Service](https://github.com/trunghieu104/sneaker-square/blob/main/app/Services/ShippingService.php): `app/Services/ShippingService.php`
- [Shipment Updates](https://github.com/trunghieu104/sneaker-square/blob/main/app/Http/Controllers/Frontend/ShippingWebhookController.php): `app/Http/Controllers/Frontend/ShippingWebhookController.php`
- [Commerce Data](https://github.com/trunghieu104/sneaker-square/tree/main/app/Models): `app/Models`

### Accounts and Content

- [Customer Accounts](https://github.com/trunghieu104/sneaker-square/blob/main/app/Http/Controllers/Frontend/AuthUserController.php): `app/Http/Controllers/Frontend/AuthUserController.php`
- [Social Login](https://github.com/trunghieu104/sneaker-square/blob/main/app/Http/Controllers/Frontend/LoginGoogle.php): `app/Http/Controllers/Frontend/LoginGoogle.php`
- [Blog and CMS](https://github.com/trunghieu104/sneaker-square/blob/main/app/Http/Controllers/Frontend/BlogController.php): `app/Http/Controllers/Frontend/BlogController.php`

### Administration and Reporting

- [Store Management](https://github.com/trunghieu104/sneaker-square/blob/main/app/Http/Controllers/Backend/ProductAdminController.php): `app/Http/Controllers/Backend/ProductAdminController.php`
- [Order Management](https://github.com/trunghieu104/sneaker-square/blob/main/app/Http/Controllers/Backend/OrderAdminController.php): `app/Http/Controllers/Backend/OrderAdminController.php`
- [Statistics and Export](https://github.com/trunghieu104/sneaker-square/blob/main/app/Services/DashboardStatisticsService.php): `app/Services/DashboardStatisticsService.php`

### External Integrations

- [MoMo and VNPay](https://github.com/trunghieu104/sneaker-square/tree/main/app/Services/Payment): `app/Services/Payment`
- [GHN Carrier](https://github.com/trunghieu104/sneaker-square/blob/main/app/Services/Shipping/GhnCarrier.php): `app/Services/Shipping/GhnCarrier.php`
- [Queued Email](https://github.com/trunghieu104/sneaker-square/blob/main/app/Services/OrderMailer.php): `app/Services/OrderMailer.php`
- **Mail Service**

### Other components

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

## Connections

- Customer → Catalog and Search: browses
- Customer → Cart and Pricing: manages cart
- Cart and Pricing → Coupon Validation: validates coupon
- Customer → Checkout: submits checkout
- Checkout → Order Placement: places order
- Order Placement → Commerce Data: writes order
- Customer → Payment Callback: returns from payment
- Payment Callback → Gateway Selection: verifies callback
- Gateway Selection → MoMo and VNPay: dispatches verification
- MoMo and VNPay → Commerce Data: updates payment
- Administrator → Store Management: manages catalog
- Administrator → Order Management: manages orders
- Order Management → Commerce Data: reads and updates
- Administrator → Statistics and Export: views reports
- Administrator → Blog and CMS: manages content
- Customer → Customer Accounts: registers and signs in
- Customer → Social Login: uses social login
- Customer → Blog and CMS: reads content
- Shipping Service → GHN Carrier: books shipment
- GHN Carrier → Shipment Updates: sends status
- Shipment Updates → Commerce Data: records events
- Order Placement → Queued Email: requests confirmation
- Queued Email → Mail Service: queues email
