# ilhamspryd/point-of-sales architecture

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

- Interactive diagram: https://gitdiagram.com/ilhamspryd/point-of-sales
- Repository: https://github.com/ilhamspryd/point-of-sales

## Overview

This is a multi-tenant restaurant POS and self-ordering application. The principal transaction path accepts cashier, customer-checkout, or channel-order input, then routes orders through TransactionService for validation and transactional persistence, including stock and payment effects. Other major product areas include catalog and modifier management, kitchen display, shifts, reporting, restock forecasts, and tenant provisioning. The graph uses sampled source references for verified calls; several feature areas are represented from the file tree, so their internal links are omitted where implementation evidence was not supplied.

Main entry points: [`app/Services/TransactionService.php`](https://github.com/ilhamspryd/point-of-sales/blob/main/app/Services/TransactionService.php) (Transaction service), [`app/Jobs/ProcessWebhookOrderJob.php`](https://github.com/ilhamspryd/point-of-sales/blob/main/app/Jobs/ProcessWebhookOrderJob.php) (Channel ingestion), [`app/Livewire/Kasir/CreateOrder.php`](https://github.com/ilhamspryd/point-of-sales/blob/main/app/Livewire/Kasir/CreateOrder.php) (Cashier POS), [`app/Http/Controllers/Customer/CheckoutController.php`](https://github.com/ilhamspryd/point-of-sales/blob/main/app/Http/Controllers/Customer/CheckoutController.php) (Customer checkout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orders["Ordering and sales"]
  node_cashier["Cashier POS<br/>[CreateOrder.php]"]
  node_selforder["Customer checkout"]
  node_channels["Channel ingestion"]
  node_webhook["Webhook endpoint"]
  node_transaction["Transaction service"]
  node_ordersdata[("Order records<br/>[Order.php]")]
end

subgraph group_catalog["Catalog and inventory"]
  node_products[("Product catalog<br/>[Product.php]")]
  node_modifiers[("Modifiers<br/>[Modifier.php]")]
  node_ingredients[("Ingredient inventory<br/>[Ingredient.php]")]
  node_ingredienttools["Inventory management"]
end

subgraph group_operations["Store operations"]
  node_kitchen["Kitchen display<br/>[KdsService.php]"]
  node_shifts["Shift management<br/>[ShiftManager.php]"]
  node_analytics["Sales reporting<br/>[ReportService.php]"]
  node_forecast["Restock forecasts"]
end

subgraph group_platform["Tenant platform"]
  node_tenantcontext["Tenant context<br/>[TenantContext.php]"]
  node_tenantmiddleware["Tenant middleware"]
  node_tenants[("Tenant records<br/>[Tenant.php]")]
  node_users[("User accounts<br/>[User.php]")]
  node_provisioning["Tenant provisioning"]
end

node_customer(("Customer"))
node_cashieractor(("Cashier"))
node_channelservice(("Ordering channel"))

node_cashieractor -.->|"enters order"| node_cashier
node_customer -->|"checks out"| node_selforder
node_channelservice -.->|"sends payload"| node_webhook
node_webhook -->|"dispatches job"| node_channels
node_channels -->|"creates order"| node_transaction
node_selforder -->|"creates transaction"| node_transaction
node_cashier -.->|"submits order"| node_transaction
node_transaction -->|"persists order"| node_ordersdata
node_transaction -->|"deducts stock"| node_ingredients
node_channels -->|"resolves mappings"| node_products
node_tenantmiddleware -->|"sets context"| node_tenantcontext
node_tenantcontext -->|"resolves tenant"| node_tenants
node_forecast -->|"reads stock"| node_ingredients

click node_cashier "https://github.com/ilhamspryd/point-of-sales/blob/main/app/Livewire/Kasir/CreateOrder.php"
click node_selforder "https://github.com/ilhamspryd/point-of-sales/blob/main/app/Http/Controllers/Customer/CheckoutController.php"
click node_channels "https://github.com/ilhamspryd/point-of-sales/blob/main/app/Jobs/ProcessWebhookOrderJob.php"
click node_webhook "https://github.com/ilhamspryd/point-of-sales/blob/main/app/Http/Controllers/Api/WebhookController.php"
click node_transaction "https://github.com/ilhamspryd/point-of-sales/blob/main/app/Services/TransactionService.php"
click node_ordersdata "https://github.com/ilhamspryd/point-of-sales/blob/main/app/Models/Order.php"
click node_products "https://github.com/ilhamspryd/point-of-sales/blob/main/app/Models/Product.php"
click node_modifiers "https://github.com/ilhamspryd/point-of-sales/blob/main/app/Models/Modifier.php"
click node_ingredients "https://github.com/ilhamspryd/point-of-sales/blob/main/app/Models/Ingredient.php"
click node_ingredienttools "https://github.com/ilhamspryd/point-of-sales/blob/main/app/Livewire/Inventory/IngredientManager.php"
click node_kitchen "https://github.com/ilhamspryd/point-of-sales/blob/main/app/Services/KdsService.php"
click node_shifts "https://github.com/ilhamspryd/point-of-sales/blob/main/app/Livewire/ShiftManager.php"
click node_analytics "https://github.com/ilhamspryd/point-of-sales/blob/main/app/Services/ReportService.php"
click node_forecast "https://github.com/ilhamspryd/point-of-sales/blob/main/app/Services/Analytics/RestockPredictionService.php"
click node_tenantcontext "https://github.com/ilhamspryd/point-of-sales/blob/main/app/Services/Context/TenantContext.php"
click node_tenantmiddleware "https://github.com/ilhamspryd/point-of-sales/blob/main/app/Http/Middleware/SetTenantContext.php"
click node_tenants "https://github.com/ilhamspryd/point-of-sales/blob/main/app/Models/Tenant.php"
click node_users "https://github.com/ilhamspryd/point-of-sales/blob/main/app/Models/User.php"
click node_provisioning "https://github.com/ilhamspryd/point-of-sales/blob/main/app/Services/ProvisioningService.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_cashier,node_selforder,node_channels,node_webhook,node_transaction,node_ordersdata toneBlue
class node_products,node_modifiers,node_ingredients,node_ingredienttools toneAmber
class node_kitchen,node_shifts,node_analytics,node_forecast toneMint
class node_tenantcontext,node_tenantmiddleware,node_tenants,node_users,node_provisioning toneRose
class node_customer,node_cashieractor,node_channelservice toneIndigo
```

## Components

### Ordering and sales

- [Cashier POS](https://github.com/ilhamspryd/point-of-sales/blob/main/app/Livewire/Kasir/CreateOrder.php): `app/Livewire/Kasir/CreateOrder.php`
- [Customer checkout](https://github.com/ilhamspryd/point-of-sales/blob/main/app/Http/Controllers/Customer/CheckoutController.php): `app/Http/Controllers/Customer/CheckoutController.php`
- [Channel ingestion](https://github.com/ilhamspryd/point-of-sales/blob/main/app/Jobs/ProcessWebhookOrderJob.php): `app/Jobs/ProcessWebhookOrderJob.php`
- [Webhook endpoint](https://github.com/ilhamspryd/point-of-sales/blob/main/app/Http/Controllers/Api/WebhookController.php): `app/Http/Controllers/Api/WebhookController.php`
- [Transaction service](https://github.com/ilhamspryd/point-of-sales/blob/main/app/Services/TransactionService.php): `app/Services/TransactionService.php`
- [Order records](https://github.com/ilhamspryd/point-of-sales/blob/main/app/Models/Order.php): `app/Models/Order.php`

### Catalog and inventory

- [Product catalog](https://github.com/ilhamspryd/point-of-sales/blob/main/app/Models/Product.php): `app/Models/Product.php`
- [Modifiers](https://github.com/ilhamspryd/point-of-sales/blob/main/app/Models/Modifier.php): `app/Models/Modifier.php`
- [Ingredient inventory](https://github.com/ilhamspryd/point-of-sales/blob/main/app/Models/Ingredient.php): `app/Models/Ingredient.php`
- [Inventory management](https://github.com/ilhamspryd/point-of-sales/blob/main/app/Livewire/Inventory/IngredientManager.php): `app/Livewire/Inventory/IngredientManager.php`

### Store operations

- [Kitchen display](https://github.com/ilhamspryd/point-of-sales/blob/main/app/Services/KdsService.php): `app/Services/KdsService.php`
- [Shift management](https://github.com/ilhamspryd/point-of-sales/blob/main/app/Livewire/ShiftManager.php): `app/Livewire/ShiftManager.php`
- [Sales reporting](https://github.com/ilhamspryd/point-of-sales/blob/main/app/Services/ReportService.php): `app/Services/ReportService.php`
- [Restock forecasts](https://github.com/ilhamspryd/point-of-sales/blob/main/app/Services/Analytics/RestockPredictionService.php): `app/Services/Analytics/RestockPredictionService.php`

### Tenant platform

- [Tenant context](https://github.com/ilhamspryd/point-of-sales/blob/main/app/Services/Context/TenantContext.php): `app/Services/Context/TenantContext.php`
- [Tenant middleware](https://github.com/ilhamspryd/point-of-sales/blob/main/app/Http/Middleware/SetTenantContext.php): `app/Http/Middleware/SetTenantContext.php`
- [Tenant records](https://github.com/ilhamspryd/point-of-sales/blob/main/app/Models/Tenant.php): `app/Models/Tenant.php`
- [User accounts](https://github.com/ilhamspryd/point-of-sales/blob/main/app/Models/User.php): `app/Models/User.php`
- [Tenant provisioning](https://github.com/ilhamspryd/point-of-sales/blob/main/app/Services/ProvisioningService.php): `app/Services/ProvisioningService.php`

### Other components

- **Customer**
- **Cashier**
- **Ordering channel**

## Connections

- Cashier → Cashier POS: enters order
- Customer → Customer checkout: checks out (evidence: `app/Http/Controllers/Customer/CheckoutController.php`)
- Ordering channel → Webhook endpoint: sends payload
- Webhook endpoint → Channel ingestion: dispatches job (evidence: `app/Http/Controllers/Api/WebhookController.php`)
- Channel ingestion → Transaction service: creates order (evidence: `app/Jobs/ProcessWebhookOrderJob.php`)
- Customer checkout → Transaction service: creates transaction (evidence: `app/Http/Controllers/Customer/CheckoutController.php`)
- Cashier POS → Transaction service: submits order
- Transaction service → Order records: persists order (evidence: `app/Services/TransactionService.php`)
- Transaction service → Ingredient inventory: deducts stock (evidence: `app/Services/TransactionService.php`)
- Channel ingestion → Product catalog: resolves mappings (evidence: `app/Jobs/ProcessWebhookOrderJob.php`)
- Tenant middleware → Tenant context: sets context (evidence: `app/Http/Middleware/SetTenantContext.php`)
- Tenant context → Tenant records: resolves tenant (evidence: `app/Services/Context/TenantContext.php`)
- Restock forecasts → Ingredient inventory: reads stock (evidence: `app/Services/Analytics/RestockPredictionService.php`)
