# justtrona/school-canteen-inventory-system architecture

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

- Interactive diagram: https://gitdiagram.com/justtrona/school-canteen-inventory-system
- Repository: https://github.com/justtrona/school-canteen-inventory-system

## Overview

This is a Laravel/Inertia inventory and retail-operations application. Staff sign in, manage catalog and suppliers, receive or release stock, and review movement history; superadmins additionally access POS, orders, payments, and sales views. Controllers are the route-dispatched application layer, Eloquent models represent persistent domain state, and Inertia serves the React pages. The source excerpts show key inventory writes and authentication, while operations-controller implementations and frontend details were not sampled; those capabilities are retained from the route index without speculative internal links.

Main entry points: [`backend/routes/web.php`](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/routes/web.php) (Web routes), [`backend/app/Http/Controllers/StockInController.php`](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/StockInController.php) (Stock receiving), [`backend/app/Models/Product.php`](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Models/Product.php) (Products), [`backend/app/Models/StockMovement.php`](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Models/StockMovement.php) (Stock movements)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_routes["Web routes<br/>[web.php]"]
  node_login["Session authentication"]
  node_middleware["Access middleware"]
  node_react["Inertia React pages"]
end

subgraph group_inventory["Inventory management"]
  node_dashboard["Inventory dashboard"]
  node_catalog["Catalog management"]
  node_categories["Category management"]
  node_suppliers["Supplier management"]
  node_stockin["Stock receiving"]
  node_stockout["Stock release"]
  node_history["Stock history"]
end

subgraph group_operations["Retail operations"]
  node_pos["Point of sale<br/>[POSController.php]"]
  node_orders["Order management"]
  node_payments["Payment records"]
  node_sales["Sales reporting"]
end

subgraph group_domain["Domain data"]
  node_products[("Products<br/>[Product.php]")]
  node_category[("Categories<br/>[Category.php]")]
  node_supplier[("Suppliers<br/>[Supplier.php]")]
  node_movement[("Stock movements<br/>[StockMovement.php]")]
  node_receipt[("Receiving receipts<br/>[StockInReceipt.php]")]
  node_ordersdata[("Orders and items<br/>[Order.php]")]
  node_orderitem[("Order items<br/>[OrderItem.php]")]
  node_paymentdata[("Payments<br/>[Payment.php]")]
  node_users[("User accounts<br/>[User.php]")]
end

node_staff(("Staff user"))

node_staff -->|"uses"| node_routes
node_routes -->|"routes login"| node_login
node_login -->|"authenticates"| node_users
node_routes -->|"protects routes"| node_middleware
node_routes -->|"dispatches"| node_dashboard
node_routes -->|"dispatches"| node_catalog
node_routes -->|"dispatches"| node_categories
node_routes -->|"dispatches"| node_suppliers
node_routes -->|"dispatches"| node_stockin
node_routes -->|"dispatches"| node_stockout
node_routes -->|"dispatches"| node_history
node_routes -->|"dispatches"| node_pos
node_routes -->|"dispatches"| node_orders
node_routes -->|"dispatches"| node_payments
node_routes -->|"dispatches"| node_sales
node_login -->|"renders login"| node_react
node_catalog -->|"reads and writes"| node_products
node_catalog -->|"reads"| node_category
node_categories -->|"manages"| node_category
node_suppliers -->|"manages"| node_supplier
node_stockin -->|"updates stock"| node_products
node_stockin -->|"validates supplier"| node_supplier
node_stockin -->|"records"| node_movement
node_stockin -->|"creates receipt"| node_receipt
node_stockout -->|"updates stock"| node_products
node_stockout -->|"records"| node_movement
node_history -->|"queries history"| node_movement
node_dashboard -->|"queries"| node_products
node_dashboard -->|"queries"| node_movement
node_pos -.->|"uses"| node_ordersdata
node_orders -.->|"uses"| node_ordersdata
node_orders -.->|"uses"| node_orderitem
node_payments -.->|"uses"| node_paymentdata
node_sales -.->|"uses"| node_ordersdata
node_sales -.->|"uses"| node_orderitem
node_react -.->|"submits requests"| node_routes

click node_routes "https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/routes/web.php"
click node_login "https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/Auth/AuthenticatedSessionController.php"
click node_middleware "https://github.com/justtrona/school-canteen-inventory-system/tree/main/backend/app/Http/Middleware"
click node_dashboard "https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/InventoryDashboardController.php"
click node_catalog "https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/ProductController.php"
click node_categories "https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/CategoryController.php"
click node_suppliers "https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/SupplierController.php"
click node_stockin "https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/StockInController.php"
click node_stockout "https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/StockOutController.php"
click node_history "https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/StockHistoryController.php"
click node_pos "https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/POSController.php"
click node_orders "https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/OrderController.php"
click node_payments "https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/PaymentController.php"
click node_sales "https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/SalesController.php"
click node_react "https://github.com/justtrona/school-canteen-inventory-system/tree/main/backend/resources/js/Pages"
click node_products "https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Models/Product.php"
click node_category "https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Models/Category.php"
click node_supplier "https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Models/Supplier.php"
click node_movement "https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Models/StockMovement.php"
click node_receipt "https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Models/StockInReceipt.php"
click node_ordersdata "https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Models/Order.php"
click node_orderitem "https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Models/OrderItem.php"
click node_paymentdata "https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Models/Payment.php"
click node_users "https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/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_routes,node_login,node_middleware,node_react,node_staff toneBlue
class node_dashboard,node_catalog,node_categories,node_suppliers,node_stockin,node_stockout,node_history toneAmber
class node_pos,node_orders,node_payments,node_sales toneMint
class node_products,node_category,node_supplier,node_movement,node_receipt,node_ordersdata,node_orderitem,node_paymentdata,node_users toneRose
```

## Components

### Web entry

- [Web routes](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/routes/web.php): `backend/routes/web.php`
- [Session authentication](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/Auth/AuthenticatedSessionController.php): `backend/app/Http/Controllers/Auth/AuthenticatedSessionController.php`
- [Access middleware](https://github.com/justtrona/school-canteen-inventory-system/tree/main/backend/app/Http/Middleware): `backend/app/Http/Middleware`
- [Inertia React pages](https://github.com/justtrona/school-canteen-inventory-system/tree/main/backend/resources/js/Pages): `backend/resources/js/Pages`

### Inventory management

- [Inventory dashboard](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/InventoryDashboardController.php): `backend/app/Http/Controllers/InventoryDashboardController.php`
- [Catalog management](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/ProductController.php): `backend/app/Http/Controllers/ProductController.php`
- [Category management](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/CategoryController.php): `backend/app/Http/Controllers/CategoryController.php`
- [Supplier management](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/SupplierController.php): `backend/app/Http/Controllers/SupplierController.php`
- [Stock receiving](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/StockInController.php): `backend/app/Http/Controllers/StockInController.php`
- [Stock release](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/StockOutController.php): `backend/app/Http/Controllers/StockOutController.php`
- [Stock history](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/StockHistoryController.php): `backend/app/Http/Controllers/StockHistoryController.php`

### Retail operations

- [Point of sale](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/POSController.php): `backend/app/Http/Controllers/POSController.php`
- [Order management](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/OrderController.php): `backend/app/Http/Controllers/OrderController.php`
- [Payment records](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/PaymentController.php): `backend/app/Http/Controllers/PaymentController.php`
- [Sales reporting](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Http/Controllers/SalesController.php): `backend/app/Http/Controllers/SalesController.php`

### Domain data

- [Products](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Models/Product.php): `backend/app/Models/Product.php`
- [Categories](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Models/Category.php): `backend/app/Models/Category.php`
- [Suppliers](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Models/Supplier.php): `backend/app/Models/Supplier.php`
- [Stock movements](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Models/StockMovement.php): `backend/app/Models/StockMovement.php`
- [Receiving receipts](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Models/StockInReceipt.php): `backend/app/Models/StockInReceipt.php`
- [Orders and items](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Models/Order.php): `backend/app/Models/Order.php`
- [Order items](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Models/OrderItem.php): `backend/app/Models/OrderItem.php`
- [Payments](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Models/Payment.php): `backend/app/Models/Payment.php`
- [User accounts](https://github.com/justtrona/school-canteen-inventory-system/blob/main/backend/app/Models/User.php): `backend/app/Models/User.php`

### Other components

- **Staff user**

## Connections

- Staff user → Web routes: uses (evidence: `backend/routes/web.php`)
- Web routes → Session authentication: routes login (evidence: `backend/routes/web.php`)
- Session authentication → User accounts: authenticates (evidence: `backend/app/Http/Controllers/Auth/AuthenticatedSessionController.php`)
- Web routes → Access middleware: protects routes (evidence: `backend/routes/web.php`)
- Web routes → Inventory dashboard: dispatches (evidence: `backend/routes/web.php`)
- Web routes → Catalog management: dispatches (evidence: `backend/routes/web.php`)
- Web routes → Category management: dispatches (evidence: `backend/routes/web.php`)
- Web routes → Supplier management: dispatches (evidence: `backend/routes/web.php`)
- Web routes → Stock receiving: dispatches (evidence: `backend/routes/web.php`)
- Web routes → Stock release: dispatches (evidence: `backend/routes/web.php`)
- Web routes → Stock history: dispatches (evidence: `backend/routes/web.php`)
- Web routes → Point of sale: dispatches (evidence: `backend/routes/web.php`)
- Web routes → Order management: dispatches (evidence: `backend/routes/web.php`)
- Web routes → Payment records: dispatches (evidence: `backend/routes/web.php`)
- Web routes → Sales reporting: dispatches (evidence: `backend/routes/web.php`)
- Session authentication → Inertia React pages: renders login (evidence: `backend/app/Http/Controllers/Auth/AuthenticatedSessionController.php`)
- Catalog management → Products: reads and writes (evidence: `backend/app/Http/Controllers/ProductController.php`)
- Catalog management → Categories: reads (evidence: `backend/app/Http/Controllers/ProductController.php`)
- Category management → Categories: manages (evidence: `backend/app/Http/Controllers/CategoryController.php`)
- Supplier management → Suppliers: manages (evidence: `backend/app/Http/Controllers/SupplierController.php`)
- Stock receiving → Products: updates stock (evidence: `backend/app/Http/Controllers/StockInController.php`)
- Stock receiving → Suppliers: validates supplier (evidence: `backend/app/Http/Controllers/StockInController.php`)
- Stock receiving → Stock movements: records (evidence: `backend/app/Http/Controllers/StockInController.php`)
- Stock receiving → Receiving receipts: creates receipt (evidence: `backend/app/Http/Controllers/StockInController.php`)
- Stock release → Products: updates stock (evidence: `backend/app/Http/Controllers/StockOutController.php`)
- Stock release → Stock movements: records (evidence: `backend/app/Http/Controllers/StockOutController.php`)
- Stock history → Stock movements: queries history (evidence: `backend/app/Http/Controllers/StockHistoryController.php`)
- Inventory dashboard → Products: queries (evidence: `backend/app/Http/Controllers/InventoryDashboardController.php`)
- Inventory dashboard → Stock movements: queries (evidence: `backend/app/Http/Controllers/InventoryDashboardController.php`)
- Point of sale → Orders and items: uses (evidence: `backend/app/Http/Controllers/POSController.php`)
- Order management → Orders and items: uses (evidence: `backend/app/Http/Controllers/OrderController.php`)
- Order management → Order items: uses
- Payment records → Payments: uses (evidence: `backend/app/Http/Controllers/PaymentController.php`)
- Sales reporting → Orders and items: uses (evidence: `backend/app/Http/Controllers/SalesController.php`)
- Sales reporting → Order items: uses (evidence: `backend/app/Http/Controllers/SalesController.php`)
- Inertia React pages → Web routes: submits requests
