# panha-koeun-web-dev/prey-lang-coffee-pos-system architecture

> Architecture diagram of the GitHub repository panha-koeun-web-dev/prey-lang-coffee-pos-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/panha-koeun-web-dev/prey-lang-coffee-pos-system
- Repository: https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system

## Overview

Prey Lang Coffee POS is a restaurant point-of-sale system with staff management screens and a customer-facing menu and ordering flow. Users enter through the React application; its API service communicates with Laravel, which routes requests to domain controllers and persists operational records in MySQL. The map includes the documented catalog, order, inventory, finance, analytics, receipt, settings, and staff capabilities. Source excerpts are incomplete, so some subsystem links are supported by the route index or README rather than inspected controller implementations.

Main entry points: [`backend/routes/api.php`](https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/routes/api.php) (API routes), [`backend/app/Http/Controllers/Api/OrderController.php`](https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Http/Controllers/Api/OrderController.php) (Order endpoints), [`frontend/src/App.jsx`](https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/frontend/src/App.jsx) (App and routing), [`backend/app/Http/Controllers/Api/ProductController.php`](https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Http/Controllers/Api/ProductController.php) (Product catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["React application"]
  node_spa["App and routing<br/>[App.jsx]"]
  node_admin_views["Operations screens"]
  node_customer_menu["Customer menu flow"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_api["Laravel API"]
  node_routes["API routes<br/>[api.php]"]
  node_base_controller["API base controller<br/>[BaseController.php]"]
end

subgraph group_operations["Restaurant operations"]
  node_orders["Order endpoints"]
  node_order_service["Order processing<br/>[OrderService.php]"]
  node_order_model["Order records<br/>[Order.php]"]
  node_tables_model["Dining tables<br/>[DiningTable.php]"]
  node_catalog["Product catalog"]
  node_product_model["Product records<br/>[Product.php]"]
  node_recipes["Recipes and logs"]
end

subgraph group_management["Business management"]
  node_inventory["Stock and purchasing"]
  node_finance["Finance and expenses"]
  node_insights["Dashboard and analytics"]
  node_receipts["Receipts"]
  node_staff_admin["Staff and access"]
  node_settings["Application settings<br/>[AppSettings.php]"]
end

node_staff(("Staff user"))
node_customer(("Customer"))
node_mysql[("MySQL database")]

node_staff -->|"uses"| node_spa
node_customer -->|"uses"| node_spa
node_spa -->|"routes to"| node_admin_views
node_spa -->|"routes to"| node_customer_menu
node_admin_views -.->|"requests data"| node_api_client
node_customer_menu -.->|"requests data"| node_api_client
node_api_client -->|"sends API requests"| node_routes
node_routes -->|"dispatches"| node_orders
node_routes -->|"dispatches"| node_catalog
node_routes -->|"dispatches"| node_recipes
node_routes -->|"dispatches"| node_inventory
node_routes -->|"dispatches"| node_finance
node_routes -->|"dispatches"| node_insights
node_routes -->|"dispatches"| node_receipts
node_routes -->|"dispatches"| node_staff_admin
node_orders -->|"delegates to"| node_order_service
node_orders -->|"queries and updates"| node_order_model
node_orders -->|"reads payment settings"| node_settings
node_order_service -->|"creates and updates"| node_order_model
node_order_model -->|"belongs to"| node_tables_model
node_catalog -->|"queries and updates"| node_product_model
node_base_controller -.->|"supports"| node_catalog
node_orders -.->|"persists records"| node_mysql
node_catalog -.->|"persists records"| node_mysql
node_recipes -.->|"persists records"| node_mysql
node_inventory -.->|"persists records"| node_mysql
node_finance -.->|"persists records"| node_mysql
node_insights -.->|"reads business data"| node_mysql
node_receipts -.->|"reads order data"| node_mysql
node_staff_admin -.->|"persists staff data"| node_mysql

click node_spa "https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/frontend/src/App.jsx"
click node_admin_views "https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/tree/main/frontend/src/pages"
click node_customer_menu "https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/tree/main/frontend/src/pages"
click node_api_client "https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/frontend/src/services/api.ts"
click node_routes "https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/routes/api.php"
click node_base_controller "https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Http/Controllers/Api/BaseController.php"
click node_orders "https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Http/Controllers/Api/OrderController.php"
click node_order_service "https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Services/OrderService.php"
click node_order_model "https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Models/Order.php"
click node_tables_model "https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Models/DiningTable.php"
click node_catalog "https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Http/Controllers/Api/ProductController.php"
click node_product_model "https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Models/Product.php"
click node_recipes "https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Http/Controllers/Api/RecipeController.php"
click node_inventory "https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Http/Controllers/Api/IngredientController.php"
click node_finance "https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Http/Controllers/Api/FinanceController.php"
click node_insights "https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Http/Controllers/Api/DashboardController.php"
click node_receipts "https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Http/Controllers/Api/ReceiptController.php"
click node_staff_admin "https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Http/Controllers/Api/StaffController.php"
click node_settings "https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Support/AppSettings.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_spa,node_admin_views,node_customer_menu,node_api_client,node_staff toneBlue
class node_routes,node_base_controller,node_mysql toneAmber
class node_orders,node_order_service,node_order_model,node_tables_model,node_catalog,node_product_model,node_recipes toneMint
class node_inventory,node_finance,node_insights,node_receipts,node_staff_admin,node_settings toneRose
class node_customer toneIndigo
```

## Components

### React application

- [App and routing](https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Operations screens](https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/tree/main/frontend/src/pages): `frontend/src/pages`
- [Customer menu flow](https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/tree/main/frontend/src/pages): `frontend/src/pages`
- [API client](https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`

### Laravel API

- [API routes](https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/routes/api.php): `backend/routes/api.php`
- [API base controller](https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Http/Controllers/Api/BaseController.php): `backend/app/Http/Controllers/Api/BaseController.php`

### Restaurant operations

- [Order endpoints](https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Http/Controllers/Api/OrderController.php): `backend/app/Http/Controllers/Api/OrderController.php`
- [Order processing](https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Services/OrderService.php): `backend/app/Services/OrderService.php`
- [Order records](https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Models/Order.php): `backend/app/Models/Order.php`
- [Dining tables](https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Models/DiningTable.php): `backend/app/Models/DiningTable.php`
- [Product catalog](https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Http/Controllers/Api/ProductController.php): `backend/app/Http/Controllers/Api/ProductController.php`
- [Product records](https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Models/Product.php): `backend/app/Models/Product.php`
- [Recipes and logs](https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Http/Controllers/Api/RecipeController.php): `backend/app/Http/Controllers/Api/RecipeController.php`

### Business management

- [Stock and purchasing](https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Http/Controllers/Api/IngredientController.php): `backend/app/Http/Controllers/Api/IngredientController.php`
- [Finance and expenses](https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Http/Controllers/Api/FinanceController.php): `backend/app/Http/Controllers/Api/FinanceController.php`
- [Dashboard and analytics](https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Http/Controllers/Api/DashboardController.php): `backend/app/Http/Controllers/Api/DashboardController.php`
- [Receipts](https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Http/Controllers/Api/ReceiptController.php): `backend/app/Http/Controllers/Api/ReceiptController.php`
- [Staff and access](https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Http/Controllers/Api/StaffController.php): `backend/app/Http/Controllers/Api/StaffController.php`
- [Application settings](https://github.com/panha-koeun-web-dev/prey-lang-coffee-pos-system/blob/main/backend/app/Support/AppSettings.php): `backend/app/Support/AppSettings.php`

### Other components

- **Staff user**
- **Customer**
- **MySQL database**

## Connections

- Staff user → App and routing: uses (evidence: `frontend/src/App.jsx`)
- Customer → App and routing: uses (evidence: `frontend/src/App.jsx`)
- App and routing → Operations screens: routes to (evidence: `frontend/src/App.jsx`)
- App and routing → Customer menu flow: routes to (evidence: `frontend/src/App.jsx`)
- Operations screens → API client: requests data
- Customer menu flow → API client: requests data
- API client → API routes: sends API requests (evidence: `README.md`)
- API routes → Order endpoints: dispatches (evidence: `backend/routes/api.php`)
- API routes → Product catalog: dispatches (evidence: `backend/routes/api.php`)
- API routes → Recipes and logs: dispatches (evidence: `backend/routes/api.php`)
- API routes → Stock and purchasing: dispatches (evidence: `backend/routes/api.php`)
- API routes → Finance and expenses: dispatches (evidence: `backend/routes/api.php`)
- API routes → Dashboard and analytics: dispatches (evidence: `backend/routes/api.php`)
- API routes → Receipts: dispatches (evidence: `backend/routes/api.php`)
- API routes → Staff and access: dispatches (evidence: `backend/routes/api.php`)
- Order endpoints → Order processing: delegates to (evidence: `backend/app/Http/Controllers/Api/OrderController.php`)
- Order endpoints → Order records: queries and updates (evidence: `backend/app/Http/Controllers/Api/OrderController.php`)
- Order endpoints → Application settings: reads payment settings (evidence: `backend/app/Http/Controllers/Api/OrderController.php`)
- Order processing → Order records: creates and updates (evidence: `backend/app/Services/OrderService.php`)
- Order records → Dining tables: belongs to (evidence: `backend/app/Models/Order.php`)
- Product catalog → Product records: queries and updates (evidence: `backend/app/Http/Controllers/Api/ProductController.php`)
- API base controller → Product catalog: supports (evidence: `backend/app/Http/Controllers/Api/ProductController.php`)
- Order endpoints → MySQL database: persists records
- Product catalog → MySQL database: persists records
- Recipes and logs → MySQL database: persists records
- Stock and purchasing → MySQL database: persists records
- Finance and expenses → MySQL database: persists records
- Dashboard and analytics → MySQL database: reads business data
- Receipts → MySQL database: reads order data
- Staff and access → MySQL database: persists staff data
