# fuadvk824/bk_pos architecture

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

- Interactive diagram: https://gitdiagram.com/fuadvk824/bk_pos
- Repository: https://github.com/fuadvk824/bk_pos

## Overview

This is a multi-store point-of-sale and inventory application, with a Laravel backend and React/Inertia web interface plus API endpoints. The main workflow is cashiering: users browse store-specific products, assemble a sale with customer and payment details, and the server records transaction items, adjusts stock, and updates customer points. Separate transaction screens support history, reporting, and backorder stock mutations. The tree also shows product, customer, store, user, location, and account-security features. Source excerpts are partial and the README is empty, so some subsystem wiring is intentionally omitted.

Main entry points: [`routes/web.php`](https://github.com/fuadvk824/bk_pos/blob/main/routes/web.php) (Web routes), [`routes/api.php`](https://github.com/fuadvk824/bk_pos/blob/main/routes/api.php) (API routes), [`app/Http/Controllers/Web/CashierController.php`](https://github.com/fuadvk824/bk_pos/blob/main/app/Http/Controllers/Web/CashierController.php) (Web cashier), [`app/Http/Controllers/Api/CashierController.php`](https://github.com/fuadvk824/bk_pos/blob/main/app/Http/Controllers/Api/CashierController.php) (API cashier)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web POS"]
  node_web_routes["Web routes<br/>[web.php]"]
  node_cashier_ui["Cashier screen<br/>[index.tsx]"]
  node_product_ui["Product screens<br/>[index.tsx]"]
  node_transaction_ui["Transaction screens<br/>[index.tsx]"]
  node_report_ui["Reports<br/>[index.tsx]"]
  node_web_cashier["Web cashier"]
  node_web_product["Web products"]
  node_web_transaction["Web transactions"]
end

subgraph group_api["API"]
  node_api_routes["API routes<br/>[api.php]"]
  node_api_cashier["API cashier"]
  node_api_product["API products"]
  node_api_auth["API auth<br/>[AuthController.php]"]
  node_api_customers["API customers"]
  node_api_transactions["API transactions"]
  node_api_admin["API administration<br/>[UserController.php]"]
end

subgraph group_domain["Sales and inventory"]
  node_catalog[("Product catalog<br/>[Product.php]")]
  node_store_stock[("Store stock and pricing<br/>[ProductStore.php]")]
  node_sale[("Sales and payments<br/>[Transaction.php]")]
  node_customer[("Customer and points<br/>[Customer.php]")]
  node_stock_history[("Stock mutation history")]
end

subgraph group_accounts["Accounts"]
  node_account_pages["Account settings<br/>[profile.tsx]"]
  node_account_controller["Profile and security"]
  node_user_model[("User and access<br/>[User.php]")]
  node_bmp_auth["BMP identity service<br/>[BmpAuthService.php]"]
end

node_user(("Cashier or manager"))
node_bmp(("BMP service"))

node_user -->|"uses"| node_cashier_ui
node_cashier_ui -->|"submits sale"| node_web_routes
node_web_routes -->|"dispatches"| node_web_cashier
node_web_cashier -->|"reads products"| node_catalog
node_web_cashier -->|"checks and decrements"| node_store_stock
node_web_cashier -->|"finds and updates"| node_customer
node_web_cashier -->|"records sale"| node_sale
node_user -->|"browses"| node_product_ui
node_product_ui -->|"requests products"| node_web_routes
node_web_routes -->|"dispatches"| node_web_product
node_web_product -->|"reads catalog"| node_catalog
node_web_product -->|"reads store data"| node_store_stock
node_user -->|"reviews sales"| node_transaction_ui
node_transaction_ui -->|"requests transactions"| node_web_routes
node_web_routes -->|"dispatches"| node_web_transaction
node_web_transaction -->|"reads and deletes"| node_sale
node_web_transaction -->|"transfers stock"| node_store_stock
node_web_transaction -->|"records mutations"| node_stock_history
node_user -->|"views reports"| node_report_ui
node_report_ui -->|"requests reports"| node_web_routes
node_web_routes -->|"routes API requests"| node_api_routes
node_api_routes -->|"dispatches"| node_api_cashier
node_api_routes -->|"dispatches"| node_api_product
node_api_routes -->|"dispatches"| node_api_auth
node_api_routes -->|"dispatches"| node_api_customers
node_api_routes -->|"dispatches"| node_api_transactions
node_api_routes -->|"dispatches"| node_api_admin
node_api_cashier -->|"reads products"| node_catalog
node_api_cashier -->|"checks stock"| node_store_stock
node_api_cashier -->|"finds and updates"| node_customer
node_api_cashier -->|"records sale"| node_sale
node_api_product -->|"queries products"| node_catalog
node_api_product -->|"reads store stock"| node_store_stock
node_account_pages -->|"requests settings"| node_web_routes
node_web_routes -->|"dispatches"| node_account_controller
node_account_controller -->|"updates profile"| node_user_model
node_api_auth -.->|"verifies credentials"| node_bmp_auth
node_bmp_auth -.->|"sends request"| node_bmp

click node_web_routes "https://github.com/fuadvk824/bk_pos/blob/main/routes/web.php"
click node_cashier_ui "https://github.com/fuadvk824/bk_pos/blob/main/resources/js/pages/cashier/index.tsx"
click node_product_ui "https://github.com/fuadvk824/bk_pos/blob/main/resources/js/pages/product/index.tsx"
click node_transaction_ui "https://github.com/fuadvk824/bk_pos/blob/main/resources/js/pages/transaction/index.tsx"
click node_report_ui "https://github.com/fuadvk824/bk_pos/blob/main/resources/js/pages/report/index.tsx"
click node_web_cashier "https://github.com/fuadvk824/bk_pos/blob/main/app/Http/Controllers/Web/CashierController.php"
click node_web_product "https://github.com/fuadvk824/bk_pos/blob/main/app/Http/Controllers/Web/ProductController.php"
click node_web_transaction "https://github.com/fuadvk824/bk_pos/blob/main/app/Http/Controllers/Web/TransactionController.php"
click node_api_routes "https://github.com/fuadvk824/bk_pos/blob/main/routes/api.php"
click node_api_cashier "https://github.com/fuadvk824/bk_pos/blob/main/app/Http/Controllers/Api/CashierController.php"
click node_api_product "https://github.com/fuadvk824/bk_pos/blob/main/app/Http/Controllers/Api/ProductController.php"
click node_api_auth "https://github.com/fuadvk824/bk_pos/blob/main/app/Http/Controllers/Api/AuthController.php"
click node_api_customers "https://github.com/fuadvk824/bk_pos/blob/main/app/Http/Controllers/Api/CustomerController.php"
click node_api_transactions "https://github.com/fuadvk824/bk_pos/blob/main/app/Http/Controllers/Api/TransactionController.php"
click node_api_admin "https://github.com/fuadvk824/bk_pos/blob/main/app/Http/Controllers/Api/UserController.php"
click node_catalog "https://github.com/fuadvk824/bk_pos/blob/main/app/Models/Product.php"
click node_store_stock "https://github.com/fuadvk824/bk_pos/blob/main/app/Models/ProductStore.php"
click node_sale "https://github.com/fuadvk824/bk_pos/blob/main/app/Models/Transaction.php"
click node_customer "https://github.com/fuadvk824/bk_pos/blob/main/app/Models/Customer.php"
click node_stock_history "https://github.com/fuadvk824/bk_pos/blob/main/app/Models/StockMutationHistory.php"
click node_account_pages "https://github.com/fuadvk824/bk_pos/blob/main/resources/js/pages/settings/profile.tsx"
click node_account_controller "https://github.com/fuadvk824/bk_pos/blob/main/app/Http/Controllers/Settings/ProfileController.php"
click node_user_model "https://github.com/fuadvk824/bk_pos/blob/main/app/Models/User.php"
click node_bmp_auth "https://github.com/fuadvk824/bk_pos/blob/main/app/Services/BmpAuthService.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_cashier_ui,node_product_ui,node_transaction_ui,node_report_ui,node_web_cashier,node_web_product,node_web_transaction toneBlue
class node_api_routes,node_api_cashier,node_api_product,node_api_auth,node_api_customers,node_api_transactions,node_api_admin toneAmber
class node_catalog,node_store_stock,node_sale,node_customer,node_stock_history toneMint
class node_account_pages,node_account_controller,node_user_model,node_bmp_auth toneRose
class node_user,node_bmp toneIndigo
```

## Components

### Web POS

- [Web routes](https://github.com/fuadvk824/bk_pos/blob/main/routes/web.php): `routes/web.php`
- [Cashier screen](https://github.com/fuadvk824/bk_pos/blob/main/resources/js/pages/cashier/index.tsx): `resources/js/pages/cashier/index.tsx`
- [Product screens](https://github.com/fuadvk824/bk_pos/blob/main/resources/js/pages/product/index.tsx): `resources/js/pages/product/index.tsx`
- [Transaction screens](https://github.com/fuadvk824/bk_pos/blob/main/resources/js/pages/transaction/index.tsx): `resources/js/pages/transaction/index.tsx`
- [Reports](https://github.com/fuadvk824/bk_pos/blob/main/resources/js/pages/report/index.tsx): `resources/js/pages/report/index.tsx`
- [Web cashier](https://github.com/fuadvk824/bk_pos/blob/main/app/Http/Controllers/Web/CashierController.php): `app/Http/Controllers/Web/CashierController.php`
- [Web products](https://github.com/fuadvk824/bk_pos/blob/main/app/Http/Controllers/Web/ProductController.php): `app/Http/Controllers/Web/ProductController.php`
- [Web transactions](https://github.com/fuadvk824/bk_pos/blob/main/app/Http/Controllers/Web/TransactionController.php): `app/Http/Controllers/Web/TransactionController.php`

### API

- [API routes](https://github.com/fuadvk824/bk_pos/blob/main/routes/api.php): `routes/api.php`
- [API cashier](https://github.com/fuadvk824/bk_pos/blob/main/app/Http/Controllers/Api/CashierController.php): `app/Http/Controllers/Api/CashierController.php`
- [API products](https://github.com/fuadvk824/bk_pos/blob/main/app/Http/Controllers/Api/ProductController.php): `app/Http/Controllers/Api/ProductController.php`
- [API auth](https://github.com/fuadvk824/bk_pos/blob/main/app/Http/Controllers/Api/AuthController.php): `app/Http/Controllers/Api/AuthController.php`
- [API customers](https://github.com/fuadvk824/bk_pos/blob/main/app/Http/Controllers/Api/CustomerController.php): `app/Http/Controllers/Api/CustomerController.php`
- [API transactions](https://github.com/fuadvk824/bk_pos/blob/main/app/Http/Controllers/Api/TransactionController.php): `app/Http/Controllers/Api/TransactionController.php`
- [API administration](https://github.com/fuadvk824/bk_pos/blob/main/app/Http/Controllers/Api/UserController.php): `app/Http/Controllers/Api/UserController.php`

### Sales and inventory

- [Product catalog](https://github.com/fuadvk824/bk_pos/blob/main/app/Models/Product.php): `app/Models/Product.php`
- [Store stock and pricing](https://github.com/fuadvk824/bk_pos/blob/main/app/Models/ProductStore.php): `app/Models/ProductStore.php`
- [Sales and payments](https://github.com/fuadvk824/bk_pos/blob/main/app/Models/Transaction.php): `app/Models/Transaction.php`
- [Customer and points](https://github.com/fuadvk824/bk_pos/blob/main/app/Models/Customer.php): `app/Models/Customer.php`
- [Stock mutation history](https://github.com/fuadvk824/bk_pos/blob/main/app/Models/StockMutationHistory.php): `app/Models/StockMutationHistory.php`

### Accounts

- [Account settings](https://github.com/fuadvk824/bk_pos/blob/main/resources/js/pages/settings/profile.tsx): `resources/js/pages/settings/profile.tsx`
- [Profile and security](https://github.com/fuadvk824/bk_pos/blob/main/app/Http/Controllers/Settings/ProfileController.php): `app/Http/Controllers/Settings/ProfileController.php`
- [User and access](https://github.com/fuadvk824/bk_pos/blob/main/app/Models/User.php): `app/Models/User.php`
- [BMP identity service](https://github.com/fuadvk824/bk_pos/blob/main/app/Services/BmpAuthService.php): `app/Services/BmpAuthService.php`

### Other components

- **Cashier or manager**
- **BMP service**

## Connections

- Cashier or manager → Cashier screen: uses
- Cashier screen → Web routes: submits sale
- Web routes → Web cashier: dispatches
- Web cashier → Product catalog: reads products
- Web cashier → Store stock and pricing: checks and decrements
- Web cashier → Customer and points: finds and updates
- Web cashier → Sales and payments: records sale
- Cashier or manager → Product screens: browses
- Product screens → Web routes: requests products
- Web routes → Web products: dispatches
- Web products → Product catalog: reads catalog
- Web products → Store stock and pricing: reads store data
- Cashier or manager → Transaction screens: reviews sales
- Transaction screens → Web routes: requests transactions
- Web routes → Web transactions: dispatches
- Web transactions → Sales and payments: reads and deletes
- Web transactions → Store stock and pricing: transfers stock
- Web transactions → Stock mutation history: records mutations
- Cashier or manager → Reports: views reports
- Reports → Web routes: requests reports
- Web routes → API routes: routes API requests
- API routes → API cashier: dispatches
- API routes → API products: dispatches
- API routes → API auth: dispatches
- API routes → API customers: dispatches
- API routes → API transactions: dispatches
- API routes → API administration: dispatches
- API cashier → Product catalog: reads products
- API cashier → Store stock and pricing: checks stock
- API cashier → Customer and points: finds and updates
- API cashier → Sales and payments: records sale
- API products → Product catalog: queries products
- API products → Store stock and pricing: reads store stock
- Account settings → Web routes: requests settings
- Web routes → Profile and security: dispatches
- Profile and security → User and access: updates profile
- API auth → BMP identity service: verifies credentials
- BMP identity service → BMP service: sends request
