# mandlamthethwa/one-stop architecture

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

- Interactive diagram: https://gitdiagram.com/mandlamthethwa/one-stop
- Repository: https://github.com/mandlamthethwa/one-stop

## Overview

This is a Laravel storefront with product browsing and administration, user registration, a per-user cart, and PayGate checkout. The main purchase flow runs from web routes through the payment controller: it reads cart and product data, initiates an external payment, verifies the callback, records transaction status, and sends purchase emails. Product and authentication paths are also shown. The excerpts establish these controller actions and calls; unsampled route details and framework wiring limit some connections, so uncertain links are omitted.

Main entry points: [`app/Http/Controllers/PaymentController.php`](https://github.com/mandlamthethwa/one-stop/blob/main/app/Http/Controllers/PaymentController.php) (Payment controller), [`routes/web.php`](https://github.com/mandlamthethwa/one-stop/blob/main/routes/web.php) (Web routes), [`app/Http/Controllers/ProductController.php`](https://github.com/mandlamthethwa/one-stop/blob/main/app/Http/Controllers/ProductController.php) (Catalog controller), [`app/Http/Controllers/Auth/RegisterController.php`](https://github.com/mandlamthethwa/one-stop/blob/main/app/Http/Controllers/Auth/RegisterController.php) (Registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web and identity"]
  node_web_routes["Web routes<br/>[web.php]"]
  node_http_kernel["HTTP kernel<br/>[Kernel.php]"]
  node_route_provider["Route provider"]
  node_registration["Registration"]
  node_user_model["User account<br/>[User.php]"]
end

subgraph group_catalog["Product catalog"]
  node_catalog_controller["Catalog controller"]
  node_product_model["Product model<br/>[Product.php]"]
  node_product_views["Product views<br/>[index.blade.php]"]
end

subgraph group_checkout["Cart and checkout"]
  node_payment_controller["Payment controller"]
  node_cart_model["Cart model<br/>[Cart.php]"]
  node_transaction_model["Transaction model<br/>[Transaction.php]"]
  node_payment_views["Payment views<br/>[form.blade.php]"]
end

subgraph group_messaging["Purchase messaging"]
  node_purchase_notification["Purchase notification"]
  node_admin_email["Admin purchase email"]
  node_user_email["User purchase email"]
end

node_shopper(("Shopper"))
node_paygate["PayGate"]

node_shopper -->|"browses"| node_web_routes
node_web_routes -->|"routes to"| node_catalog_controller
node_web_routes -->|"routes to"| node_payment_controller
node_shopper -.->|"registers"| node_registration
node_registration -->|"creates account"| node_user_model
node_catalog_controller -->|"reads and saves"| node_product_model
node_catalog_controller -->|"renders"| node_product_views
node_payment_controller -->|"reads and updates"| node_cart_model
node_payment_controller -->|"reads prices"| node_product_model
node_payment_controller -->|"records status"| node_transaction_model
node_payment_controller -->|"initiates and verifies"| node_paygate
node_paygate -->|"sends callback"| node_payment_controller
node_payment_controller -->|"renders"| node_payment_views
node_payment_controller -->|"sends"| node_admin_email
node_payment_controller -->|"sends"| node_user_email
node_http_kernel -.->|"registers routes"| node_route_provider

click node_web_routes "https://github.com/mandlamthethwa/one-stop/blob/main/routes/web.php"
click node_http_kernel "https://github.com/mandlamthethwa/one-stop/blob/main/app/Http/Kernel.php"
click node_route_provider "https://github.com/mandlamthethwa/one-stop/blob/main/app/Providers/RouteServiceProvider.php"
click node_registration "https://github.com/mandlamthethwa/one-stop/blob/main/app/Http/Controllers/Auth/RegisterController.php"
click node_user_model "https://github.com/mandlamthethwa/one-stop/blob/main/app/Models/User.php"
click node_catalog_controller "https://github.com/mandlamthethwa/one-stop/blob/main/app/Http/Controllers/ProductController.php"
click node_product_model "https://github.com/mandlamthethwa/one-stop/blob/main/app/Models/Product.php"
click node_product_views "https://github.com/mandlamthethwa/one-stop/blob/main/resources/views/products/index.blade.php"
click node_payment_controller "https://github.com/mandlamthethwa/one-stop/blob/main/app/Http/Controllers/PaymentController.php"
click node_cart_model "https://github.com/mandlamthethwa/one-stop/blob/main/app/Models/Cart.php"
click node_transaction_model "https://github.com/mandlamthethwa/one-stop/blob/main/app/Models/Transaction.php"
click node_payment_views "https://github.com/mandlamthethwa/one-stop/blob/main/resources/views/payment/form.blade.php"
click node_purchase_notification "https://github.com/mandlamthethwa/one-stop/blob/main/app/Notifications/PurchasedItemsNotification.php"
click node_admin_email "https://github.com/mandlamthethwa/one-stop/blob/main/app/Mail/AdminPurchaseNotification.php"
click node_user_email "https://github.com/mandlamthethwa/one-stop/blob/main/app/Mail/UserPurchaseNotification.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_http_kernel,node_route_provider,node_registration,node_user_model toneBlue
class node_catalog_controller,node_product_model,node_product_views toneAmber
class node_payment_controller,node_cart_model,node_transaction_model,node_payment_views toneMint
class node_purchase_notification,node_admin_email,node_user_email toneRose
class node_shopper,node_paygate toneIndigo
```

## Components

### Web and identity

- [Web routes](https://github.com/mandlamthethwa/one-stop/blob/main/routes/web.php): `routes/web.php`
- [HTTP kernel](https://github.com/mandlamthethwa/one-stop/blob/main/app/Http/Kernel.php): `app/Http/Kernel.php`
- [Route provider](https://github.com/mandlamthethwa/one-stop/blob/main/app/Providers/RouteServiceProvider.php): `app/Providers/RouteServiceProvider.php`
- [Registration](https://github.com/mandlamthethwa/one-stop/blob/main/app/Http/Controllers/Auth/RegisterController.php): `app/Http/Controllers/Auth/RegisterController.php`
- [User account](https://github.com/mandlamthethwa/one-stop/blob/main/app/Models/User.php): `app/Models/User.php`

### Product catalog

- [Catalog controller](https://github.com/mandlamthethwa/one-stop/blob/main/app/Http/Controllers/ProductController.php): `app/Http/Controllers/ProductController.php`
- [Product model](https://github.com/mandlamthethwa/one-stop/blob/main/app/Models/Product.php): `app/Models/Product.php`
- [Product views](https://github.com/mandlamthethwa/one-stop/blob/main/resources/views/products/index.blade.php): `resources/views/products/index.blade.php`

### Cart and checkout

- [Payment controller](https://github.com/mandlamthethwa/one-stop/blob/main/app/Http/Controllers/PaymentController.php): `app/Http/Controllers/PaymentController.php`
- [Cart model](https://github.com/mandlamthethwa/one-stop/blob/main/app/Models/Cart.php): `app/Models/Cart.php`
- [Transaction model](https://github.com/mandlamthethwa/one-stop/blob/main/app/Models/Transaction.php): `app/Models/Transaction.php`
- [Payment views](https://github.com/mandlamthethwa/one-stop/blob/main/resources/views/payment/form.blade.php): `resources/views/payment/form.blade.php`

### Purchase messaging

- [Purchase notification](https://github.com/mandlamthethwa/one-stop/blob/main/app/Notifications/PurchasedItemsNotification.php): `app/Notifications/PurchasedItemsNotification.php`
- [Admin purchase email](https://github.com/mandlamthethwa/one-stop/blob/main/app/Mail/AdminPurchaseNotification.php): `app/Mail/AdminPurchaseNotification.php`
- [User purchase email](https://github.com/mandlamthethwa/one-stop/blob/main/app/Mail/UserPurchaseNotification.php): `app/Mail/UserPurchaseNotification.php`

### Other components

- **Shopper**
- **PayGate**

## Connections

- Shopper → Web routes: browses (evidence: `routes/web.php`)
- Web routes → Catalog controller: routes to (evidence: `routes/web.php`)
- Web routes → Payment controller: routes to (evidence: `routes/web.php`)
- Shopper → Registration: registers
- Registration → User account: creates account (evidence: `app/Http/Controllers/Auth/RegisterController.php`)
- Catalog controller → Product model: reads and saves (evidence: `app/Http/Controllers/ProductController.php`)
- Catalog controller → Product views: renders (evidence: `app/Http/Controllers/ProductController.php`)
- Payment controller → Cart model: reads and updates (evidence: `app/Http/Controllers/PaymentController.php`)
- Payment controller → Product model: reads prices (evidence: `app/Http/Controllers/PaymentController.php`)
- Payment controller → Transaction model: records status (evidence: `app/Http/Controllers/PaymentController.php`)
- Payment controller → PayGate: initiates and verifies (evidence: `app/Http/Controllers/PaymentController.php`)
- PayGate → Payment controller: sends callback (evidence: `app/Http/Controllers/PaymentController.php`)
- Payment controller → Payment views: renders (evidence: `app/Http/Controllers/PaymentController.php`)
- Payment controller → Admin purchase email: sends (evidence: `app/Http/Controllers/PaymentController.php`)
- Payment controller → User purchase email: sends (evidence: `app/Http/Controllers/PaymentController.php`)
- HTTP kernel → Route provider: registers routes
