# angkosal/laravel-pos architecture

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

- Interactive diagram: https://gitdiagram.com/angkosal/laravel-pos
- Repository: https://github.com/angkosal/laravel-pos

## Overview

This Laravel POS application supports a cashier workflow from product selection and cart management through order creation, stock reduction, and payment recording. It also covers inventory purchases (which can increase stock), product and customer/supplier management, order history, dashboard summaries, and store settings. The graph reflects sampled controller/model behavior and README-described capabilities; some routes and UI wiring were not sampled, so those links are omitted.

Main entry points: [`app/Http/Controllers/Inventory/PurchaseController.php`](https://github.com/angkosal/laravel-pos/blob/master/app/Http/Controllers/Inventory/PurchaseController.php) (Purchase processing), [`app/Http/Controllers/Pos/OrderController.php`](https://github.com/angkosal/laravel-pos/blob/master/app/Http/Controllers/Pos/OrderController.php) (Order checkout), [`app/Models/Product.php`](https://github.com/angkosal/laravel-pos/blob/master/app/Models/Product.php) (Products and stock), [`app/Http/Controllers/Admin/HomeController.php`](https://github.com/angkosal/laravel-pos/blob/master/app/Http/Controllers/Admin/HomeController.php) (Sales dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sales["Sales workflow"]
  node_cart_ui["Sales cart<br/>[Cart.jsx]"]
  node_cart_controller["Cart handling<br/>[CartController.php]"]
  node_order_controller["Order checkout"]
  node_orders[("Orders and payments<br/>[Order.php]")]
  node_order_items[("Order items<br/>[OrderItem.php]")]
  node_payments[("Payments<br/>[Payment.php]")]
  node_order_history["Order history"]
end

subgraph group_inventory["Inventory operations"]
  node_purchase_ui["Purchase cart<br/>[Purchase.jsx]"]
  node_purchase_cart_controller["Purchase cart handling"]
  node_purchase_controller["Purchase processing"]
  node_purchases[("Purchases<br/>[Purchase.php]")]
  node_purchase_items[("Purchase items<br/>[PurchaseItem.php]")]
  node_purchase_receipt["Purchase receipts<br/>[receipt.blade.php]"]
  node_products[("Products and stock<br/>[Product.php]")]
  node_product_management["Product management"]
  node_product_views["Product screens"]
end

subgraph group_management["Business management"]
  node_customers[("Customer records<br/>[Customer.php]")]
  node_customer_controller["Customer management"]
  node_suppliers[("Supplier records<br/>[Supplier.php]")]
  node_supplier_controller["Supplier management"]
  node_dashboard["Sales dashboard<br/>[HomeController.php]"]
  node_settings[("Store settings<br/>[Setting.php]")]
  node_settings_controller["Settings management"]
end

subgraph group_platform["Application and data"]
  node_user[("Staff account<br/>[User.php]")]
  node_laravel_app["Laravel application<br/>[app.php]"]
end

node_cashier(("Cashier"))

node_cashier -.->|"uses"| node_cart_ui
node_cart_ui -.->|"manages cart"| node_cart_controller
node_cart_controller -->|"reads products"| node_products
node_order_controller -->|"creates order"| node_orders
node_order_controller -->|"creates items"| node_order_items
node_order_controller -->|"reduces stock"| node_products
node_order_controller -->|"records payment"| node_payments
node_order_controller -->|"reads cart"| node_user
node_order_history -.->|"displays history"| node_order_controller
node_purchase_ui -.->|"manages cart"| node_purchase_cart_controller
node_purchase_cart_controller -->|"updates cart"| node_products
node_purchase_controller -->|"creates purchases"| node_purchases
node_purchase_controller -->|"creates items"| node_purchase_items
node_purchase_controller -->|"adjusts stock"| node_products
node_purchase_controller -->|"loads suppliers"| node_suppliers
node_purchase_controller -->|"uses purchase cart"| node_user
node_purchase_controller -->|"renders receipt"| node_purchase_receipt
node_product_management -.->|"manages products"| node_products
node_product_views -.->|"presents screens"| node_product_management
node_customer_controller -->|"manages customers"| node_customers
node_supplier_controller -.->|"manages suppliers"| node_suppliers
node_dashboard -->|"summarizes sales"| node_orders
node_dashboard -->|"summarizes products"| node_products
node_dashboard -->|"reads customers"| node_customers
node_settings_controller -->|"manages settings"| node_settings
node_laravel_app -.->|"serves application"| node_user

click node_cart_ui "https://github.com/angkosal/laravel-pos/blob/master/resources/js/components/Cart.jsx"
click node_cart_controller "https://github.com/angkosal/laravel-pos/blob/master/app/Http/Controllers/Pos/CartController.php"
click node_order_controller "https://github.com/angkosal/laravel-pos/blob/master/app/Http/Controllers/Pos/OrderController.php"
click node_orders "https://github.com/angkosal/laravel-pos/blob/master/app/Models/Order.php"
click node_order_items "https://github.com/angkosal/laravel-pos/blob/master/app/Models/OrderItem.php"
click node_payments "https://github.com/angkosal/laravel-pos/blob/master/app/Models/Payment.php"
click node_order_history "https://github.com/angkosal/laravel-pos/tree/master/resources/views/orders"
click node_purchase_ui "https://github.com/angkosal/laravel-pos/blob/master/resources/js/components/Purchase.jsx"
click node_purchase_cart_controller "https://github.com/angkosal/laravel-pos/blob/master/app/Http/Controllers/Inventory/PurchaseCartController.php"
click node_purchase_controller "https://github.com/angkosal/laravel-pos/blob/master/app/Http/Controllers/Inventory/PurchaseController.php"
click node_purchases "https://github.com/angkosal/laravel-pos/blob/master/app/Models/Purchase.php"
click node_purchase_items "https://github.com/angkosal/laravel-pos/blob/master/app/Models/PurchaseItem.php"
click node_purchase_receipt "https://github.com/angkosal/laravel-pos/blob/master/resources/views/purchases/receipt.blade.php"
click node_products "https://github.com/angkosal/laravel-pos/blob/master/app/Models/Product.php"
click node_product_management "https://github.com/angkosal/laravel-pos/blob/master/app/Http/Controllers/Inventory/ProductController.php"
click node_product_views "https://github.com/angkosal/laravel-pos/tree/master/resources/views/products"
click node_customers "https://github.com/angkosal/laravel-pos/blob/master/app/Models/Customer.php"
click node_customer_controller "https://github.com/angkosal/laravel-pos/blob/master/app/Http/Controllers/Management/CustomerController.php"
click node_suppliers "https://github.com/angkosal/laravel-pos/blob/master/app/Models/Supplier.php"
click node_supplier_controller "https://github.com/angkosal/laravel-pos/blob/master/app/Http/Controllers/Management/SupplierController.php"
click node_dashboard "https://github.com/angkosal/laravel-pos/blob/master/app/Http/Controllers/Admin/HomeController.php"
click node_settings "https://github.com/angkosal/laravel-pos/blob/master/app/Models/Setting.php"
click node_settings_controller "https://github.com/angkosal/laravel-pos/blob/master/app/Http/Controllers/Settings/SettingController.php"
click node_user "https://github.com/angkosal/laravel-pos/blob/master/app/Models/User.php"
click node_laravel_app "https://github.com/angkosal/laravel-pos/blob/master/bootstrap/app.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_cart_ui,node_cart_controller,node_order_controller,node_orders,node_order_items,node_payments,node_order_history toneBlue
class node_purchase_ui,node_purchase_cart_controller,node_purchase_controller,node_purchases,node_purchase_items,node_purchase_receipt,node_products,node_product_management,node_product_views toneAmber
class node_customers,node_customer_controller,node_suppliers,node_supplier_controller,node_dashboard,node_settings,node_settings_controller toneMint
class node_user,node_laravel_app toneRose
class node_cashier toneIndigo
```

## Components

### Sales workflow

- [Sales cart](https://github.com/angkosal/laravel-pos/blob/master/resources/js/components/Cart.jsx): `resources/js/components/Cart.jsx`
- [Cart handling](https://github.com/angkosal/laravel-pos/blob/master/app/Http/Controllers/Pos/CartController.php): `app/Http/Controllers/Pos/CartController.php`
- [Order checkout](https://github.com/angkosal/laravel-pos/blob/master/app/Http/Controllers/Pos/OrderController.php): `app/Http/Controllers/Pos/OrderController.php`
- [Orders and payments](https://github.com/angkosal/laravel-pos/blob/master/app/Models/Order.php): `app/Models/Order.php`
- [Order items](https://github.com/angkosal/laravel-pos/blob/master/app/Models/OrderItem.php): `app/Models/OrderItem.php`
- [Payments](https://github.com/angkosal/laravel-pos/blob/master/app/Models/Payment.php): `app/Models/Payment.php`
- [Order history](https://github.com/angkosal/laravel-pos/tree/master/resources/views/orders): `resources/views/orders`

### Inventory operations

- [Purchase cart](https://github.com/angkosal/laravel-pos/blob/master/resources/js/components/Purchase.jsx): `resources/js/components/Purchase.jsx`
- [Purchase cart handling](https://github.com/angkosal/laravel-pos/blob/master/app/Http/Controllers/Inventory/PurchaseCartController.php): `app/Http/Controllers/Inventory/PurchaseCartController.php`
- [Purchase processing](https://github.com/angkosal/laravel-pos/blob/master/app/Http/Controllers/Inventory/PurchaseController.php): `app/Http/Controllers/Inventory/PurchaseController.php`
- [Purchases](https://github.com/angkosal/laravel-pos/blob/master/app/Models/Purchase.php): `app/Models/Purchase.php`
- [Purchase items](https://github.com/angkosal/laravel-pos/blob/master/app/Models/PurchaseItem.php): `app/Models/PurchaseItem.php`
- [Purchase receipts](https://github.com/angkosal/laravel-pos/blob/master/resources/views/purchases/receipt.blade.php): `resources/views/purchases/receipt.blade.php`
- [Products and stock](https://github.com/angkosal/laravel-pos/blob/master/app/Models/Product.php): `app/Models/Product.php`
- [Product management](https://github.com/angkosal/laravel-pos/blob/master/app/Http/Controllers/Inventory/ProductController.php): `app/Http/Controllers/Inventory/ProductController.php`
- [Product screens](https://github.com/angkosal/laravel-pos/tree/master/resources/views/products): `resources/views/products`

### Business management

- [Customer records](https://github.com/angkosal/laravel-pos/blob/master/app/Models/Customer.php): `app/Models/Customer.php`
- [Customer management](https://github.com/angkosal/laravel-pos/blob/master/app/Http/Controllers/Management/CustomerController.php): `app/Http/Controllers/Management/CustomerController.php`
- [Supplier records](https://github.com/angkosal/laravel-pos/blob/master/app/Models/Supplier.php): `app/Models/Supplier.php`
- [Supplier management](https://github.com/angkosal/laravel-pos/blob/master/app/Http/Controllers/Management/SupplierController.php): `app/Http/Controllers/Management/SupplierController.php`
- [Sales dashboard](https://github.com/angkosal/laravel-pos/blob/master/app/Http/Controllers/Admin/HomeController.php): `app/Http/Controllers/Admin/HomeController.php`
- [Store settings](https://github.com/angkosal/laravel-pos/blob/master/app/Models/Setting.php): `app/Models/Setting.php`
- [Settings management](https://github.com/angkosal/laravel-pos/blob/master/app/Http/Controllers/Settings/SettingController.php): `app/Http/Controllers/Settings/SettingController.php`

### Application and data

- [Staff account](https://github.com/angkosal/laravel-pos/blob/master/app/Models/User.php): `app/Models/User.php`
- [Laravel application](https://github.com/angkosal/laravel-pos/blob/master/bootstrap/app.php): `bootstrap/app.php`

### Other components

- **Cashier**

## Connections

- Cashier → Sales cart: uses
- Sales cart → Cart handling: manages cart
- Cart handling → Products and stock: reads products (evidence: `app/Http/Controllers/Pos/CartController.php`)
- Order checkout → Orders and payments: creates order (evidence: `app/Http/Controllers/Pos/OrderController.php`)
- Order checkout → Order items: creates items (evidence: `app/Http/Controllers/Pos/OrderController.php`)
- Order checkout → Products and stock: reduces stock (evidence: `app/Http/Controllers/Pos/OrderController.php`)
- Order checkout → Payments: records payment (evidence: `app/Http/Controllers/Pos/OrderController.php`)
- Order checkout → Staff account: reads cart (evidence: `app/Http/Controllers/Pos/OrderController.php`)
- Order history → Order checkout: displays history
- Purchase cart → Purchase cart handling: manages cart
- Purchase cart handling → Products and stock: updates cart (evidence: `app/Http/Controllers/Inventory/PurchaseCartController.php`)
- Purchase processing → Purchases: creates purchases (evidence: `app/Http/Controllers/Inventory/PurchaseController.php`)
- Purchase processing → Purchase items: creates items (evidence: `app/Http/Controllers/Inventory/PurchaseController.php`)
- Purchase processing → Products and stock: adjusts stock (evidence: `app/Http/Controllers/Inventory/PurchaseController.php`)
- Purchase processing → Supplier records: loads suppliers (evidence: `app/Http/Controllers/Inventory/PurchaseController.php`)
- Purchase processing → Staff account: uses purchase cart (evidence: `app/Http/Controllers/Inventory/PurchaseController.php`)
- Purchase processing → Purchase receipts: renders receipt (evidence: `app/Http/Controllers/Inventory/PurchaseController.php`)
- Product management → Products and stock: manages products
- Product screens → Product management: presents screens
- Customer management → Customer records: manages customers (evidence: `app/Http/Controllers/Management/CustomerController.php`)
- Supplier management → Supplier records: manages suppliers
- Sales dashboard → Orders and payments: summarizes sales (evidence: `app/Http/Controllers/Admin/HomeController.php`)
- Sales dashboard → Products and stock: summarizes products (evidence: `app/Http/Controllers/Admin/HomeController.php`)
- Sales dashboard → Customer records: reads customers (evidence: `app/Http/Controllers/Admin/HomeController.php`)
- Settings management → Store settings: manages settings (evidence: `app/Http/Controllers/Settings/SettingController.php`)
- Laravel application → Staff account: serves application
