# oobitoe/pos architecture

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

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

## Overview

Point of Sales is a Laravel, Inertia, and React retail operations application. Its principal workflow is cashier checkout: manage a cart, apply pricing and tax rules, take payment, and record the transaction; related capabilities include inventory, purchasing, finance, CRM, reporting, and administration. The graph preserves these major README-described domains. Source excerpts are limited, so only documented or indexed relationships are drawn; several domain nodes represent unsampled controller and model subsystems by their exact directories.

Main entry points: [`app/Services/Payments/PaymentGatewayManager.php`](https://github.com/oobitoe/pos/blob/main/app/Services/Payments/PaymentGatewayManager.php) (Payment Routing), [`app/Models/Transaction.php`](https://github.com/oobitoe/pos/blob/main/app/Models/Transaction.php) (Sales Records), [`app/Http/Controllers/Apps/TransactionController.php`](https://github.com/oobitoe/pos/blob/main/app/Http/Controllers/Apps/TransactionController.php) (Sales Transactions), [`app/Services/CrmAutomationService.php`](https://github.com/oobitoe/pos/blob/main/app/Services/CrmAutomationService.php) (CRM Campaigns)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_checkout["Checkout and Sales"]
  node_pos_ui["POS Interface<br/>[index.jsx]"]
  node_pos_api["POS API"]
  node_sales["Sales Transactions"]
  node_pricing["Pricing Rules<br/>[PricingService.php]"]
  node_sales_data[("Sales Records<br/>[Transaction.php]")]
end

subgraph group_stock["Inventory and Purchasing"]
  node_inventory["Inventory Control"]
  node_products[("Products and Stock<br/>[Product.php]")]
  node_purchasing["Purchasing"]
end

subgraph group_finance["Finance and Payments"]
  node_finance["Receivables and Payables"]
  node_gateway_manager["Payment Routing"]
  node_midtrans["Midtrans Gateway"]
  node_xendit["Xendit Gateway<br/>[XenditGateway.php]"]
  node_webhook["Payment Webhooks"]
end

subgraph group_crm["CRM and Loyalty"]
  node_crm["CRM Campaigns"]
  node_loyalty["Loyalty and Vouchers<br/>[LoyaltyService.php]"]
  node_customers[("Customer Records<br/>[Customer.php]")]
  node_whatsapp["WhatsApp Gateway<br/>[server.js]"]
end

subgraph group_operations["Reporting and Administration"]
  node_reports["Reports and Documents"]
  node_admin["Access and Audit"]
end

node_cashier(("Cashier"))

node_cashier -->|"uses"| node_pos_ui
node_pos_ui -.->|"mobile API flow"| node_pos_api
node_pos_api -.->|"records sales"| node_sales_data
node_sales -.->|"applies promotions"| node_pricing
node_sales -.->|"initiates gateway payment"| node_gateway_manager
node_gateway_manager -->|"dispatches"| node_midtrans
node_gateway_manager -->|"dispatches"| node_xendit
node_webhook -.->|"updates payment"| node_sales_data
node_inventory -.->|"manages stock"| node_products
node_purchasing -.->|"receives goods"| node_products
node_crm -->|"segments customers"| node_customers
node_crm -.->|"sends messages"| node_whatsapp
node_loyalty -.->|"tracks rewards"| node_customers
node_reports -.->|"analyzes sales"| node_sales_data

click node_pos_ui "https://github.com/oobitoe/pos/blob/main/resources/js/Components/POS/index.jsx"
click node_pos_api "https://github.com/oobitoe/pos/blob/main/app/Http/Controllers/Api/PosApiController.php"
click node_sales "https://github.com/oobitoe/pos/blob/main/app/Http/Controllers/Apps/TransactionController.php"
click node_pricing "https://github.com/oobitoe/pos/blob/main/app/Services/PricingService.php"
click node_sales_data "https://github.com/oobitoe/pos/blob/main/app/Models/Transaction.php"
click node_inventory "https://github.com/oobitoe/pos/tree/main/app/Http/Controllers/Apps"
click node_products "https://github.com/oobitoe/pos/blob/main/app/Models/Product.php"
click node_purchasing "https://github.com/oobitoe/pos/tree/main/app/Http/Controllers/Apps"
click node_finance "https://github.com/oobitoe/pos/tree/main/app/Http/Controllers/Apps"
click node_gateway_manager "https://github.com/oobitoe/pos/blob/main/app/Services/Payments/PaymentGatewayManager.php"
click node_midtrans "https://github.com/oobitoe/pos/blob/main/app/Services/Payments/MidtransGateway.php"
click node_xendit "https://github.com/oobitoe/pos/blob/main/app/Services/Payments/XenditGateway.php"
click node_webhook "https://github.com/oobitoe/pos/blob/main/app/Http/Controllers/Api/PaymentWebhookController.php"
click node_crm "https://github.com/oobitoe/pos/blob/main/app/Services/CrmAutomationService.php"
click node_loyalty "https://github.com/oobitoe/pos/blob/main/app/Services/LoyaltyService.php"
click node_customers "https://github.com/oobitoe/pos/blob/main/app/Models/Customer.php"
click node_whatsapp "https://github.com/oobitoe/pos/blob/main/whatsapp-service/server.js"
click node_reports "https://github.com/oobitoe/pos/tree/main/app/Http/Controllers/Reports"
click node_admin "https://github.com/oobitoe/pos/tree/main/app/Http/Controllers"

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_pos_ui,node_pos_api,node_sales,node_pricing,node_sales_data toneBlue
class node_inventory,node_products,node_purchasing toneAmber
class node_finance,node_gateway_manager,node_midtrans,node_xendit,node_webhook toneMint
class node_crm,node_loyalty,node_customers,node_whatsapp toneRose
class node_reports,node_admin,node_cashier toneIndigo
```

## Components

### Checkout and Sales

- [POS Interface](https://github.com/oobitoe/pos/blob/main/resources/js/Components/POS/index.jsx): `resources/js/Components/POS/index.jsx`
- [POS API](https://github.com/oobitoe/pos/blob/main/app/Http/Controllers/Api/PosApiController.php): `app/Http/Controllers/Api/PosApiController.php`
- [Sales Transactions](https://github.com/oobitoe/pos/blob/main/app/Http/Controllers/Apps/TransactionController.php): `app/Http/Controllers/Apps/TransactionController.php`
- [Pricing Rules](https://github.com/oobitoe/pos/blob/main/app/Services/PricingService.php): `app/Services/PricingService.php`
- [Sales Records](https://github.com/oobitoe/pos/blob/main/app/Models/Transaction.php): `app/Models/Transaction.php`

### Inventory and Purchasing

- [Inventory Control](https://github.com/oobitoe/pos/tree/main/app/Http/Controllers/Apps): `app/Http/Controllers/Apps`
- [Products and Stock](https://github.com/oobitoe/pos/blob/main/app/Models/Product.php): `app/Models/Product.php`
- [Purchasing](https://github.com/oobitoe/pos/tree/main/app/Http/Controllers/Apps): `app/Http/Controllers/Apps`

### Finance and Payments

- [Receivables and Payables](https://github.com/oobitoe/pos/tree/main/app/Http/Controllers/Apps): `app/Http/Controllers/Apps`
- [Payment Routing](https://github.com/oobitoe/pos/blob/main/app/Services/Payments/PaymentGatewayManager.php): `app/Services/Payments/PaymentGatewayManager.php`
- [Midtrans Gateway](https://github.com/oobitoe/pos/blob/main/app/Services/Payments/MidtransGateway.php): `app/Services/Payments/MidtransGateway.php`
- [Xendit Gateway](https://github.com/oobitoe/pos/blob/main/app/Services/Payments/XenditGateway.php): `app/Services/Payments/XenditGateway.php`
- [Payment Webhooks](https://github.com/oobitoe/pos/blob/main/app/Http/Controllers/Api/PaymentWebhookController.php): `app/Http/Controllers/Api/PaymentWebhookController.php`

### CRM and Loyalty

- [CRM Campaigns](https://github.com/oobitoe/pos/blob/main/app/Services/CrmAutomationService.php): `app/Services/CrmAutomationService.php`
- [Loyalty and Vouchers](https://github.com/oobitoe/pos/blob/main/app/Services/LoyaltyService.php): `app/Services/LoyaltyService.php`
- [Customer Records](https://github.com/oobitoe/pos/blob/main/app/Models/Customer.php): `app/Models/Customer.php`
- [WhatsApp Gateway](https://github.com/oobitoe/pos/blob/main/whatsapp-service/server.js): `whatsapp-service/server.js`

### Reporting and Administration

- [Reports and Documents](https://github.com/oobitoe/pos/tree/main/app/Http/Controllers/Reports): `app/Http/Controllers/Reports`
- [Access and Audit](https://github.com/oobitoe/pos/tree/main/app/Http/Controllers): `app/Http/Controllers`

### Other components

- **Cashier**

## Connections

- Cashier → POS Interface: uses
- POS Interface → POS API: mobile API flow
- POS API → Sales Records: records sales (evidence: `app/Http/Controllers/Api/PosApiController.php`)
- Sales Transactions → Pricing Rules: applies promotions (evidence: `app/Http/Controllers/Apps/TransactionController.php`)
- Sales Transactions → Payment Routing: initiates gateway payment (evidence: `app/Http/Controllers/Apps/TransactionController.php`)
- Payment Routing → Midtrans Gateway: dispatches (evidence: `app/Services/Payments/PaymentGatewayManager.php`)
- Payment Routing → Xendit Gateway: dispatches (evidence: `app/Services/Payments/PaymentGatewayManager.php`)
- Payment Webhooks → Sales Records: updates payment
- Inventory Control → Products and Stock: manages stock (evidence: `app/Http/Controllers/Apps/TransactionController.php`)
- Purchasing → Products and Stock: receives goods (evidence: `app/Http/Controllers/Apps/TransactionController.php`)
- CRM Campaigns → Customer Records: segments customers (evidence: `app/Services/CrmAutomationService.php`)
- CRM Campaigns → WhatsApp Gateway: sends messages
- Loyalty and Vouchers → Customer Records: tracks rewards (evidence: `app/Services/LoyaltyService.php`)
- Reports and Documents → Sales Records: analyzes sales (evidence: `app/Http/Controllers/Reports/AdvancedSalesInsightsController.php`)
