# mhabuesa/sunnah architecture

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

- Interactive diagram: https://gitdiagram.com/mhabuesa/sunnah
- Repository: https://github.com/mhabuesa/sunnah

## Overview

This is a Laravel storefront and commerce back office. Customers browse and search products, manage a cart, place and track orders, and use accounts and reviews; administrators manage catalog, promotions, orders, delivery settings, and communications. The graph reflects the tree and sampled controller behavior; unsampled controllers and routes limit certainty about checkout internals and integration dispatch, so those links are omitted where unsupported.

Main entry points: [`app/Models/Order.php`](https://github.com/mhabuesa/sunnah/blob/main/app/Models/Order.php) (Order records), [`app/Http/Controllers/Frontend/ReviewController.php`](https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/Frontend/ReviewController.php) (Product reviews), [`app/Models/Product.php`](https://github.com/mhabuesa/sunnah/blob/main/app/Models/Product.php) (Product records), [`app/Http/Controllers/Frontend/ProductController.php`](https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/Frontend/ProductController.php) (Product browsing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shop["Customer storefront"]
  node_storefront["Storefront pages<br/>[HomeController.php]"]
  node_catalog["Product browsing"]
  node_auth["Customer accounts<br/>[AuthController.php]"]
  node_reviews["Product reviews"]
end

subgraph group_commerce["Commerce operations"]
  node_cart["Cart operations<br/>[CartController.php]"]
  node_cartservice["Cart service<br/>[CartService.php]"]
  node_checkout["Order placement"]
  node_tracking["Order tracking"]
  node_customerorders["Customer order history"]
  node_delivery["Courier services<br/>[PathaoService.php]"]
  node_sms["SMS service<br/>[SmsService.php]"]
end

subgraph group_admin["Back office"]
  node_catalogadmin["Catalog management"]
  node_orderadmin["Order management"]
  node_promotions["Promotions"]
  node_deliveryadmin["Delivery configuration"]
  node_smsadmin["SMS campaigns"]
end

subgraph group_data["Domain data"]
  node_productdata[("Product records<br/>[Product.php]")]
  node_cartdata[("Cart records<br/>[Cart.php]")]
  node_orderdata[("Order records<br/>[Order.php]")]
  node_reviewdata[("Review records<br/>[Review.php]")]
end

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

node_customer -->|"visits"| node_storefront
node_customer -->|"browses"| node_catalog
node_customer -->|"signs in"| node_auth
node_customer -->|"manages cart"| node_cart
node_customer -->|"places order"| node_checkout
node_customer -->|"tracks order"| node_tracking
node_customer -->|"views orders"| node_customerorders
node_customer -->|"submits review"| node_reviews
node_catalog -->|"queries"| node_productdata
node_cart -->|"uses"| node_cartservice
node_cartservice -->|"reads/writes"| node_cartdata
node_checkout -->|"creates order"| node_orderdata
node_tracking -->|"reads status"| node_orderdata
node_customerorders -->|"loads history"| node_orderdata
node_reviews -->|"loads product"| node_productdata
node_reviews -->|"reads/writes"| node_reviewdata
node_admin -->|"manages catalog"| node_catalogadmin
node_admin -->|"manages orders"| node_orderadmin
node_admin -->|"manages promotions"| node_promotions
node_admin -->|"configures delivery"| node_deliveryadmin
node_admin -->|"manages campaigns"| node_smsadmin
node_catalogadmin -->|"maintains"| node_productdata
node_orderadmin -->|"updates"| node_orderdata
node_deliveryadmin -->|"configures"| node_delivery
node_smsadmin -->|"uses"| node_sms

click node_storefront "https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/Frontend/HomeController.php"
click node_catalog "https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/Frontend/ProductController.php"
click node_auth "https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/Customer/AuthController.php"
click node_cart "https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/Frontend/CartController.php"
click node_cartservice "https://github.com/mhabuesa/sunnah/blob/main/app/Services/CartService.php"
click node_checkout "https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/Frontend/OrderController.php"
click node_tracking "https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/Frontend/OrderTrackingController.php"
click node_customerorders "https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/Customer/DashboardController.php"
click node_reviews "https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/Frontend/ReviewController.php"
click node_catalogadmin "https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/ProductController.php"
click node_orderadmin "https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/OrderController.php"
click node_promotions "https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/CampaignController.php"
click node_deliveryadmin "https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/DeliveryController.php"
click node_smsadmin "https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/SmsCampaignController.php"
click node_delivery "https://github.com/mhabuesa/sunnah/blob/main/app/Services/PathaoService.php"
click node_sms "https://github.com/mhabuesa/sunnah/blob/main/app/Services/SmsService.php"
click node_productdata "https://github.com/mhabuesa/sunnah/blob/main/app/Models/Product.php"
click node_cartdata "https://github.com/mhabuesa/sunnah/blob/main/app/Models/Cart.php"
click node_orderdata "https://github.com/mhabuesa/sunnah/blob/main/app/Models/Order.php"
click node_reviewdata "https://github.com/mhabuesa/sunnah/blob/main/app/Models/Review.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_storefront,node_catalog,node_auth,node_reviews toneBlue
class node_cart,node_cartservice,node_checkout,node_tracking,node_customerorders,node_delivery,node_sms toneAmber
class node_catalogadmin,node_orderadmin,node_promotions,node_deliveryadmin,node_smsadmin toneMint
class node_productdata,node_cartdata,node_orderdata,node_reviewdata toneRose
class node_customer,node_admin toneIndigo
```

## Components

### Customer storefront

- [Storefront pages](https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/Frontend/HomeController.php): `app/Http/Controllers/Frontend/HomeController.php`
- [Product browsing](https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/Frontend/ProductController.php): `app/Http/Controllers/Frontend/ProductController.php`
- [Customer accounts](https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/Customer/AuthController.php): `app/Http/Controllers/Customer/AuthController.php`
- [Product reviews](https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/Frontend/ReviewController.php): `app/Http/Controllers/Frontend/ReviewController.php`

### Commerce operations

- [Cart operations](https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/Frontend/CartController.php): `app/Http/Controllers/Frontend/CartController.php`
- [Cart service](https://github.com/mhabuesa/sunnah/blob/main/app/Services/CartService.php): `app/Services/CartService.php`
- [Order placement](https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/Frontend/OrderController.php): `app/Http/Controllers/Frontend/OrderController.php`
- [Order tracking](https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/Frontend/OrderTrackingController.php): `app/Http/Controllers/Frontend/OrderTrackingController.php`
- [Customer order history](https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/Customer/DashboardController.php): `app/Http/Controllers/Customer/DashboardController.php`
- [Courier services](https://github.com/mhabuesa/sunnah/blob/main/app/Services/PathaoService.php): `app/Services/PathaoService.php`
- [SMS service](https://github.com/mhabuesa/sunnah/blob/main/app/Services/SmsService.php): `app/Services/SmsService.php`

### Back office

- [Catalog management](https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/ProductController.php): `app/Http/Controllers/ProductController.php`
- [Order management](https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/OrderController.php): `app/Http/Controllers/OrderController.php`
- [Promotions](https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/CampaignController.php): `app/Http/Controllers/CampaignController.php`
- [Delivery configuration](https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/DeliveryController.php): `app/Http/Controllers/DeliveryController.php`
- [SMS campaigns](https://github.com/mhabuesa/sunnah/blob/main/app/Http/Controllers/SmsCampaignController.php): `app/Http/Controllers/SmsCampaignController.php`

### Domain data

- [Product records](https://github.com/mhabuesa/sunnah/blob/main/app/Models/Product.php): `app/Models/Product.php`
- [Cart records](https://github.com/mhabuesa/sunnah/blob/main/app/Models/Cart.php): `app/Models/Cart.php`
- [Order records](https://github.com/mhabuesa/sunnah/blob/main/app/Models/Order.php): `app/Models/Order.php`
- [Review records](https://github.com/mhabuesa/sunnah/blob/main/app/Models/Review.php): `app/Models/Review.php`

### Other components

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

## Connections

- Customer → Storefront pages: visits
- Customer → Product browsing: browses
- Customer → Customer accounts: signs in
- Customer → Cart operations: manages cart
- Customer → Order placement: places order
- Customer → Order tracking: tracks order
- Customer → Customer order history: views orders
- Customer → Product reviews: submits review
- Product browsing → Product records: queries
- Cart operations → Cart service: uses
- Cart service → Cart records: reads/writes
- Order placement → Order records: creates order
- Order tracking → Order records: reads status
- Customer order history → Order records: loads history
- Product reviews → Product records: loads product
- Product reviews → Review records: reads/writes
- Administrator → Catalog management: manages catalog
- Administrator → Order management: manages orders
- Administrator → Promotions: manages promotions
- Administrator → Delivery configuration: configures delivery
- Administrator → SMS campaigns: manages campaigns
- Catalog management → Product records: maintains
- Order management → Order records: updates
- Delivery configuration → Courier services: configures
- SMS campaigns → SMS service: uses
