# faizaldevs/restopos architecture

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

- Interactive diagram: https://gitdiagram.com/faizaldevs/restopos
- Repository: https://github.com/faizaldevs/restopos

## Overview

RestoPOS is a multi-tenant restaurant billing and management SaaS. A staff member works through the Vue interface to manage catalog and stock, create dine-in/takeaway/delivery or pre-booked orders, record payments, and follow kitchen tickets; managers also use reports and administration. Laravel API controllers implement business operations over Eloquent domain models, while Stancl Tenancy isolates tenants and Passport supports API authentication. The README documents several capabilities whose detailed source was not sampled, so those links are documented relationships rather than claims about specific controller calls.

Main entry points: [`app/Http/Controllers/API/V1/SaleController.php`](https://github.com/faizaldevs/restopos/blob/main/app/Http/Controllers/API/V1/SaleController.php) (Sales processing), [`resources/js/routes.js`](https://github.com/faizaldevs/restopos/blob/main/resources/js/routes.js) (Operations screens), [`app/Models/Account.php`](https://github.com/faizaldevs/restopos/blob/main/app/Models/Account.php) (Accounts), [`app/Http/Controllers/API/V1/ReportController.php`](https://github.com/faizaldevs/restopos/blob/main/app/Http/Controllers/API/V1/ReportController.php) (Reports)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Staff interface"]
  node_vue["Vue application<br/>[app.js]"]
  node_ui_routes["Operations screens<br/>[routes.js]"]
  node_sales_ui["POS and orders<br/>[Add.vue]"]
end

subgraph group_commerce["Restaurant operations"]
  node_backend["Laravel API<br/>[BaseController.php]"]
  node_sales_api["Sales processing<br/>[SaleController.php]"]
  node_sale_records[("Sales and payments<br/>[Sale.php]")]
  node_customers[("Customer records<br/>[Customer.php]")]
  node_menu[("Food and recipes<br/>[Food.php]")]
  node_stock[("Products and stock<br/>[Product.php]")]
  node_locations[("Locations<br/>[Location.php]")]
  node_kitchen["Kitchen tickets<br/>[KOT_Order.vue]"]
end

subgraph group_management["Business management"]
  node_purchases["Purchasing"]
  node_expenses["Expenses"]
  node_employees["Employees"]
  node_accounts[("Accounts<br/>[Account.php]")]
  node_reports["Reports"]
end

subgraph group_platform["SaaS platform"]
  node_tenant_admin["Tenant administration<br/>[HomeController.php]"]
  node_tenancy["Tenant isolation"]
  node_tenant_data[("Tenant identity<br/>[Tenant.php]")]
  node_auth[("API authentication<br/>[User.php]")]
end

node_staff(("Restaurant staff"))

node_staff -->|"uses"| node_vue
node_vue -->|"loads routes"| node_ui_routes
node_ui_routes -->|"routes orders"| node_sales_ui
node_sales_ui -.->|"submits orders"| node_sales_api
node_backend -.->|"dispatches API"| node_sales_api
node_sales_api -->|"creates sales"| node_sale_records
node_sales_api -->|"loads customers"| node_customers
node_sales_api -->|"deducts stock"| node_stock
node_sales_api -->|"reads recipes"| node_menu
node_sales_api -->|"records payments"| node_accounts
node_sales_api -->|"prints tickets"| node_kitchen
node_purchases -.->|"receives stock"| node_stock
node_sales_api -->|"uses location stock"| node_locations
node_expenses -.->|"tracks expenses"| node_accounts
node_employees -.->|"has screens"| node_ui_routes
node_reports -.->|"reports sales"| node_sale_records
node_reports -.->|"reports accounts"| node_accounts
node_tenant_admin -->|"manages tenants"| node_tenant_data
node_tenancy -.->|"isolates tenants"| node_tenant_data
node_auth -.->|"authenticates API"| node_sales_api

click node_vue "https://github.com/faizaldevs/restopos/blob/main/resources/js/app.js"
click node_ui_routes "https://github.com/faizaldevs/restopos/blob/main/resources/js/routes.js"
click node_sales_ui "https://github.com/faizaldevs/restopos/blob/main/resources/js/components/sale/Add.vue"
click node_backend "https://github.com/faizaldevs/restopos/blob/main/app/Http/Controllers/API/V1/BaseController.php"
click node_sales_api "https://github.com/faizaldevs/restopos/blob/main/app/Http/Controllers/API/V1/SaleController.php"
click node_sale_records "https://github.com/faizaldevs/restopos/blob/main/app/Models/Sale.php"
click node_customers "https://github.com/faizaldevs/restopos/blob/main/app/Models/Customer.php"
click node_menu "https://github.com/faizaldevs/restopos/blob/main/app/Models/Food.php"
click node_stock "https://github.com/faizaldevs/restopos/blob/main/app/Models/Product.php"
click node_locations "https://github.com/faizaldevs/restopos/blob/main/app/Models/Location.php"
click node_kitchen "https://github.com/faizaldevs/restopos/blob/main/resources/js/components/sale/KOT_Order.vue"
click node_purchases "https://github.com/faizaldevs/restopos/blob/main/app/Http/Controllers/API/V1/PurchaseController.php"
click node_expenses "https://github.com/faizaldevs/restopos/blob/main/app/Http/Controllers/API/V1/ExpenseController.php"
click node_employees "https://github.com/faizaldevs/restopos/blob/main/app/Http/Controllers/API/V1/EmployeeController.php"
click node_accounts "https://github.com/faizaldevs/restopos/blob/main/app/Models/Account.php"
click node_reports "https://github.com/faizaldevs/restopos/blob/main/app/Http/Controllers/API/V1/ReportController.php"
click node_tenant_admin "https://github.com/faizaldevs/restopos/blob/main/app/Http/Controllers/HomeController.php"
click node_tenancy "https://github.com/faizaldevs/restopos/blob/main/app/Providers/TenancyServiceProvider.php"
click node_tenant_data "https://github.com/faizaldevs/restopos/blob/main/app/Models/Tenant.php"
click node_auth "https://github.com/faizaldevs/restopos/blob/main/app/Models/User.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_vue,node_ui_routes,node_sales_ui toneBlue
class node_backend,node_sales_api,node_sale_records,node_customers,node_menu,node_stock,node_locations,node_kitchen toneAmber
class node_purchases,node_expenses,node_employees,node_accounts,node_reports toneMint
class node_tenant_admin,node_tenancy,node_tenant_data,node_auth toneRose
class node_staff toneIndigo
```

## Components

### Staff interface

- [Vue application](https://github.com/faizaldevs/restopos/blob/main/resources/js/app.js): `resources/js/app.js`
- [Operations screens](https://github.com/faizaldevs/restopos/blob/main/resources/js/routes.js): `resources/js/routes.js`
- [POS and orders](https://github.com/faizaldevs/restopos/blob/main/resources/js/components/sale/Add.vue): `resources/js/components/sale/Add.vue`

### Restaurant operations

- [Laravel API](https://github.com/faizaldevs/restopos/blob/main/app/Http/Controllers/API/V1/BaseController.php): `app/Http/Controllers/API/V1/BaseController.php`
- [Sales processing](https://github.com/faizaldevs/restopos/blob/main/app/Http/Controllers/API/V1/SaleController.php): `app/Http/Controllers/API/V1/SaleController.php`
- [Sales and payments](https://github.com/faizaldevs/restopos/blob/main/app/Models/Sale.php): `app/Models/Sale.php`
- [Customer records](https://github.com/faizaldevs/restopos/blob/main/app/Models/Customer.php): `app/Models/Customer.php`
- [Food and recipes](https://github.com/faizaldevs/restopos/blob/main/app/Models/Food.php): `app/Models/Food.php`
- [Products and stock](https://github.com/faizaldevs/restopos/blob/main/app/Models/Product.php): `app/Models/Product.php`
- [Locations](https://github.com/faizaldevs/restopos/blob/main/app/Models/Location.php): `app/Models/Location.php`
- [Kitchen tickets](https://github.com/faizaldevs/restopos/blob/main/resources/js/components/sale/KOT_Order.vue): `resources/js/components/sale/KOT_Order.vue`

### Business management

- [Purchasing](https://github.com/faizaldevs/restopos/blob/main/app/Http/Controllers/API/V1/PurchaseController.php): `app/Http/Controllers/API/V1/PurchaseController.php`
- [Expenses](https://github.com/faizaldevs/restopos/blob/main/app/Http/Controllers/API/V1/ExpenseController.php): `app/Http/Controllers/API/V1/ExpenseController.php`
- [Employees](https://github.com/faizaldevs/restopos/blob/main/app/Http/Controllers/API/V1/EmployeeController.php): `app/Http/Controllers/API/V1/EmployeeController.php`
- [Accounts](https://github.com/faizaldevs/restopos/blob/main/app/Models/Account.php): `app/Models/Account.php`
- [Reports](https://github.com/faizaldevs/restopos/blob/main/app/Http/Controllers/API/V1/ReportController.php): `app/Http/Controllers/API/V1/ReportController.php`

### SaaS platform

- [Tenant administration](https://github.com/faizaldevs/restopos/blob/main/app/Http/Controllers/HomeController.php): `app/Http/Controllers/HomeController.php`
- [Tenant isolation](https://github.com/faizaldevs/restopos/blob/main/app/Providers/TenancyServiceProvider.php): `app/Providers/TenancyServiceProvider.php`
- [Tenant identity](https://github.com/faizaldevs/restopos/blob/main/app/Models/Tenant.php): `app/Models/Tenant.php`
- [API authentication](https://github.com/faizaldevs/restopos/blob/main/app/Models/User.php): `app/Models/User.php`

### Other components

- **Restaurant staff**

## Connections

- Restaurant staff → Vue application: uses
- Vue application → Operations screens: loads routes (evidence: `resources/js/app.js`)
- Operations screens → POS and orders: routes orders (evidence: `resources/js/routes.js`)
- POS and orders → Sales processing: submits orders
- Laravel API → Sales processing: dispatches API (evidence: `app/Http/Controllers/API/V1/SaleController.php`)
- Sales processing → Sales and payments: creates sales (evidence: `app/Http/Controllers/API/V1/SaleController.php`)
- Sales processing → Customer records: loads customers (evidence: `app/Http/Controllers/API/V1/SaleController.php`)
- Sales processing → Products and stock: deducts stock (evidence: `app/Http/Controllers/API/V1/SaleController.php`)
- Sales processing → Food and recipes: reads recipes (evidence: `app/Http/Controllers/API/V1/SaleController.php`)
- Sales processing → Accounts: records payments (evidence: `app/Http/Controllers/API/V1/SaleController.php`)
- Sales processing → Kitchen tickets: prints tickets (evidence: `app/Http/Controllers/API/V1/SaleController.php`)
- Purchasing → Products and stock: receives stock
- Sales processing → Locations: uses location stock (evidence: `app/Http/Controllers/API/V1/SaleController.php`)
- Expenses → Accounts: tracks expenses
- Employees → Operations screens: has screens
- Reports → Sales and payments: reports sales
- Reports → Accounts: reports accounts
- Tenant administration → Tenant identity: manages tenants (evidence: `app/Http/Controllers/HomeController.php`)
- Tenant isolation → Tenant identity: isolates tenants
- API authentication → Sales processing: authenticates API
