# xfcvw/inventoryflow architecture

> Architecture diagram of the GitHub repository xfcvw/inventoryflow, 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/xfcvw/inventoryflow
- Repository: https://github.com/xfcvw/inventoryflow

## Overview

InventoryFlow is a multi-tenant inventory and sales SaaS. A user enters through the browser, authenticates and selects a workspace, then uses API-backed product, stock and order workflows; processing or cancelling an order adjusts warehouse stock. Separate branches cover team invitations, plans and limits, reporting, dashboard, notifications and audit. The graph preserves documented capabilities whose controller internals were not sampled; those links are shown only where the README or SOURCE INDEX supports them.

Main entry points: [`routes/api.php`](https://github.com/xfcvw/inventoryflow/blob/main/routes/api.php) (API routes), [`app/Services/StockService.php`](https://github.com/xfcvw/inventoryflow/blob/main/app/Services/StockService.php) (Stock operations), [`app/Services/PlanService.php`](https://github.com/xfcvw/inventoryflow/blob/main/app/Services/PlanService.php) (Plans and limits), [`app/Http/Controllers/Api/ProductController.php`](https://github.com/xfcvw/inventoryflow/blob/main/app/Http/Controllers/Api/ProductController.php) (Product catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and identity"]
  node_web["Web routes<br/>[web.php]"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_registration["Registration"]
  node_api["API routes<br/>[api.php]"]
end

subgraph group_tenant["Workspace and SaaS"]
  node_workspace["Workspace management"]
  node_team["Team and invitations"]
  node_plans["Plans and limits<br/>[PlanService.php]"]
end

subgraph group_operations["Inventory and sales"]
  node_product["Product catalog"]
  node_warehouse["Warehouse management"]
  node_inventory["Stock operations<br/>[StockService.php]"]
  node_orders["Order processing"]
end

subgraph group_insight["Insights and governance"]
  node_dashboard["Dashboard"]
  node_reports["Sales and inventory reports"]
  node_audit["Audit logging<br/>[AuditService.php]"]
  node_notifications["Low-stock notices"]
end

subgraph group_persistence["Domain persistence"]
  node_user[("User and membership<br/>[User.php]")]
  node_workspace_model[("Workspace record<br/>[Workspace.php]")]
  node_product_model[("Product record<br/>[Product.php]")]
  node_warehouse_model[("Warehouse record<br/>[Warehouse.php]")]
  node_stock_model[("Warehouse stock")]
  node_movement[("Inventory movement")]
  node_order_model[("Order and items<br/>[Order.php]")]
  node_category[("Category<br/>[Category.php]")]
  node_supplier[("Supplier<br/>[Supplier.php]")]
  node_customer[("Customer<br/>[Customer.php]")]
  node_invitation[("Invitation record<br/>[Invitation.php]")]
  node_subscription[("Subscription record<br/>[Subscription.php]")]
end

node_browser(("Browser user"))
node_postgres[("PostgreSQL")]

node_browser -->|"opens"| node_web
node_web -->|"routes to"| node_auth
node_browser -->|"uses"| node_api
node_api -->|"dispatches"| node_workspace
node_api -->|"dispatches"| node_team
node_api -->|"dispatches"| node_product
node_api -->|"dispatches"| node_warehouse
node_api -->|"dispatches"| node_orders
node_api -->|"dispatches"| node_dashboard
node_api -->|"dispatches"| node_reports
node_api -->|"dispatches"| node_audit
node_registration -->|"creates"| node_user
node_registration -->|"creates"| node_workspace_model
node_registration -->|"creates"| node_subscription
node_workspace -->|"checks limits"| node_plans
node_team -->|"checks limits"| node_plans
node_team -->|"uses"| node_invitation
node_product -->|"checks limits"| node_plans
node_product -->|"reads and writes"| node_product_model
node_product -->|"records actions"| node_audit
node_warehouse -->|"checks limits"| node_plans
node_orders -->|"creates and updates"| node_order_model
node_orders -->|"moves stock"| node_inventory
node_orders -->|"records actions"| node_audit
node_inventory -->|"updates quantities"| node_stock_model
node_inventory -->|"creates movements"| node_movement
node_inventory -->|"updates total stock"| node_product_model
node_inventory -->|"notifies on low stock"| node_notifications
node_audit -->|"writes audit log"| node_workspace_model
node_plans -->|"reads plan"| node_workspace_model
node_workspace_model -->|"persists"| node_postgres
node_user -->|"persists"| node_postgres
node_product_model -->|"persists"| node_postgres
node_warehouse_model -->|"persists"| node_postgres
node_stock_model -->|"persists"| node_postgres
node_movement -->|"persists"| node_postgres
node_order_model -->|"persists"| node_postgres
node_category -->|"persists"| node_postgres
node_supplier -->|"persists"| node_postgres
node_customer -->|"persists"| node_postgres
node_invitation -->|"persists"| node_postgres
node_subscription -->|"persists"| node_postgres

click node_web "https://github.com/xfcvw/inventoryflow/blob/main/routes/web.php"
click node_auth "https://github.com/xfcvw/inventoryflow/blob/main/app/Http/Controllers/AuthController.php"
click node_registration "https://github.com/xfcvw/inventoryflow/blob/main/app/Http/Controllers/RegistrationController.php"
click node_api "https://github.com/xfcvw/inventoryflow/blob/main/routes/api.php"
click node_workspace "https://github.com/xfcvw/inventoryflow/blob/main/app/Http/Controllers/Api/WorkspaceController.php"
click node_team "https://github.com/xfcvw/inventoryflow/blob/main/app/Http/Controllers/Api/InvitationController.php"
click node_plans "https://github.com/xfcvw/inventoryflow/blob/main/app/Services/PlanService.php"
click node_product "https://github.com/xfcvw/inventoryflow/blob/main/app/Http/Controllers/Api/ProductController.php"
click node_warehouse "https://github.com/xfcvw/inventoryflow/blob/main/app/Http/Controllers/Api/WarehouseController.php"
click node_inventory "https://github.com/xfcvw/inventoryflow/blob/main/app/Services/StockService.php"
click node_orders "https://github.com/xfcvw/inventoryflow/blob/main/app/Http/Controllers/Api/OrderController.php"
click node_dashboard "https://github.com/xfcvw/inventoryflow/blob/main/app/Http/Controllers/Api/DashboardController.php"
click node_reports "https://github.com/xfcvw/inventoryflow/blob/main/app/Http/Controllers/Api/ReportController.php"
click node_audit "https://github.com/xfcvw/inventoryflow/blob/main/app/Services/AuditService.php"
click node_notifications "https://github.com/xfcvw/inventoryflow/blob/main/app/Notifications/LowStockNotification.php"
click node_user "https://github.com/xfcvw/inventoryflow/blob/main/app/Models/User.php"
click node_workspace_model "https://github.com/xfcvw/inventoryflow/blob/main/app/Models/Workspace.php"
click node_product_model "https://github.com/xfcvw/inventoryflow/blob/main/app/Models/Product.php"
click node_warehouse_model "https://github.com/xfcvw/inventoryflow/blob/main/app/Models/Warehouse.php"
click node_stock_model "https://github.com/xfcvw/inventoryflow/blob/main/app/Models/ProductWarehouseStock.php"
click node_movement "https://github.com/xfcvw/inventoryflow/blob/main/app/Models/InventoryMovement.php"
click node_order_model "https://github.com/xfcvw/inventoryflow/blob/main/app/Models/Order.php"
click node_category "https://github.com/xfcvw/inventoryflow/blob/main/app/Models/Category.php"
click node_supplier "https://github.com/xfcvw/inventoryflow/blob/main/app/Models/Supplier.php"
click node_customer "https://github.com/xfcvw/inventoryflow/blob/main/app/Models/Customer.php"
click node_invitation "https://github.com/xfcvw/inventoryflow/blob/main/app/Models/Invitation.php"
click node_subscription "https://github.com/xfcvw/inventoryflow/blob/main/app/Models/Subscription.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,node_auth,node_registration,node_api,node_browser toneBlue
class node_workspace,node_team,node_plans,node_postgres toneAmber
class node_product,node_warehouse,node_inventory,node_orders toneMint
class node_dashboard,node_reports,node_audit,node_notifications toneRose
class node_user,node_workspace_model,node_product_model,node_warehouse_model,node_stock_model,node_movement,node_order_model,node_category,node_supplier,node_customer,node_invitation,node_subscription toneIndigo
```

## Components

### Entry and identity

- [Web routes](https://github.com/xfcvw/inventoryflow/blob/main/routes/web.php): `routes/web.php`
- [Authentication](https://github.com/xfcvw/inventoryflow/blob/main/app/Http/Controllers/AuthController.php): `app/Http/Controllers/AuthController.php`
- [Registration](https://github.com/xfcvw/inventoryflow/blob/main/app/Http/Controllers/RegistrationController.php): `app/Http/Controllers/RegistrationController.php`
- [API routes](https://github.com/xfcvw/inventoryflow/blob/main/routes/api.php): `routes/api.php`

### Workspace and SaaS

- [Workspace management](https://github.com/xfcvw/inventoryflow/blob/main/app/Http/Controllers/Api/WorkspaceController.php): `app/Http/Controllers/Api/WorkspaceController.php`
- [Team and invitations](https://github.com/xfcvw/inventoryflow/blob/main/app/Http/Controllers/Api/InvitationController.php): `app/Http/Controllers/Api/InvitationController.php`
- [Plans and limits](https://github.com/xfcvw/inventoryflow/blob/main/app/Services/PlanService.php): `app/Services/PlanService.php`

### Inventory and sales

- [Product catalog](https://github.com/xfcvw/inventoryflow/blob/main/app/Http/Controllers/Api/ProductController.php): `app/Http/Controllers/Api/ProductController.php`
- [Warehouse management](https://github.com/xfcvw/inventoryflow/blob/main/app/Http/Controllers/Api/WarehouseController.php): `app/Http/Controllers/Api/WarehouseController.php`
- [Stock operations](https://github.com/xfcvw/inventoryflow/blob/main/app/Services/StockService.php): `app/Services/StockService.php`
- [Order processing](https://github.com/xfcvw/inventoryflow/blob/main/app/Http/Controllers/Api/OrderController.php): `app/Http/Controllers/Api/OrderController.php`

### Insights and governance

- [Dashboard](https://github.com/xfcvw/inventoryflow/blob/main/app/Http/Controllers/Api/DashboardController.php): `app/Http/Controllers/Api/DashboardController.php`
- [Sales and inventory reports](https://github.com/xfcvw/inventoryflow/blob/main/app/Http/Controllers/Api/ReportController.php): `app/Http/Controllers/Api/ReportController.php`
- [Audit logging](https://github.com/xfcvw/inventoryflow/blob/main/app/Services/AuditService.php): `app/Services/AuditService.php`
- [Low-stock notices](https://github.com/xfcvw/inventoryflow/blob/main/app/Notifications/LowStockNotification.php): `app/Notifications/LowStockNotification.php`

### Domain persistence

- [User and membership](https://github.com/xfcvw/inventoryflow/blob/main/app/Models/User.php): `app/Models/User.php`
- [Workspace record](https://github.com/xfcvw/inventoryflow/blob/main/app/Models/Workspace.php): `app/Models/Workspace.php`
- [Product record](https://github.com/xfcvw/inventoryflow/blob/main/app/Models/Product.php): `app/Models/Product.php`
- [Warehouse record](https://github.com/xfcvw/inventoryflow/blob/main/app/Models/Warehouse.php): `app/Models/Warehouse.php`
- [Warehouse stock](https://github.com/xfcvw/inventoryflow/blob/main/app/Models/ProductWarehouseStock.php): `app/Models/ProductWarehouseStock.php`
- [Inventory movement](https://github.com/xfcvw/inventoryflow/blob/main/app/Models/InventoryMovement.php): `app/Models/InventoryMovement.php`
- [Order and items](https://github.com/xfcvw/inventoryflow/blob/main/app/Models/Order.php): `app/Models/Order.php`
- [Category](https://github.com/xfcvw/inventoryflow/blob/main/app/Models/Category.php): `app/Models/Category.php`
- [Supplier](https://github.com/xfcvw/inventoryflow/blob/main/app/Models/Supplier.php): `app/Models/Supplier.php`
- [Customer](https://github.com/xfcvw/inventoryflow/blob/main/app/Models/Customer.php): `app/Models/Customer.php`
- [Invitation record](https://github.com/xfcvw/inventoryflow/blob/main/app/Models/Invitation.php): `app/Models/Invitation.php`
- [Subscription record](https://github.com/xfcvw/inventoryflow/blob/main/app/Models/Subscription.php): `app/Models/Subscription.php`

### Other components

- **Browser user**
- **PostgreSQL**

## Connections

- Browser user → Web routes: opens (evidence: `README.md`)
- Web routes → Authentication: routes to (evidence: `README.md`)
- Browser user → API routes: uses (evidence: `README.md`)
- API routes → Workspace management: dispatches (evidence: `routes/api.php`)
- API routes → Team and invitations: dispatches (evidence: `routes/api.php`)
- API routes → Product catalog: dispatches (evidence: `routes/api.php`)
- API routes → Warehouse management: dispatches (evidence: `routes/api.php`)
- API routes → Order processing: dispatches (evidence: `routes/api.php`)
- API routes → Dashboard: dispatches (evidence: `routes/api.php`)
- API routes → Sales and inventory reports: dispatches (evidence: `routes/api.php`)
- API routes → Audit logging: dispatches (evidence: `routes/api.php`)
- Registration → User and membership: creates (evidence: `app/Http/Controllers/RegistrationController.php`)
- Registration → Workspace record: creates (evidence: `app/Http/Controllers/RegistrationController.php`)
- Registration → Subscription record: creates (evidence: `app/Http/Controllers/RegistrationController.php`)
- Workspace management → Plans and limits: checks limits (evidence: `app/Http/Controllers/Api/WorkspaceController.php`)
- Team and invitations → Plans and limits: checks limits (evidence: `app/Http/Controllers/Api/InvitationController.php`)
- Team and invitations → Invitation record: uses (evidence: `app/Http/Controllers/Api/InvitationController.php`)
- Product catalog → Plans and limits: checks limits (evidence: `app/Http/Controllers/Api/ProductController.php`)
- Product catalog → Product record: reads and writes (evidence: `app/Http/Controllers/Api/ProductController.php`)
- Product catalog → Audit logging: records actions (evidence: `app/Http/Controllers/Api/ProductController.php`)
- Warehouse management → Plans and limits: checks limits (evidence: `app/Http/Controllers/Api/WarehouseController.php`)
- Order processing → Order and items: creates and updates (evidence: `app/Http/Controllers/Api/OrderController.php`)
- Order processing → Stock operations: moves stock (evidence: `app/Http/Controllers/Api/OrderController.php`)
- Order processing → Audit logging: records actions (evidence: `app/Http/Controllers/Api/OrderController.php`)
- Stock operations → Warehouse stock: updates quantities (evidence: `app/Services/StockService.php`)
- Stock operations → Inventory movement: creates movements (evidence: `app/Services/StockService.php`)
- Stock operations → Product record: updates total stock (evidence: `app/Services/StockService.php`)
- Stock operations → Low-stock notices: notifies on low stock (evidence: `app/Services/StockService.php`)
- Audit logging → Workspace record: writes audit log (evidence: `app/Services/AuditService.php`)
- Plans and limits → Workspace record: reads plan (evidence: `app/Services/PlanService.php`)
- Workspace record → PostgreSQL: persists (evidence: `README.md`)
- User and membership → PostgreSQL: persists (evidence: `README.md`)
- Product record → PostgreSQL: persists (evidence: `README.md`)
- Warehouse record → PostgreSQL: persists (evidence: `README.md`)
- Warehouse stock → PostgreSQL: persists (evidence: `README.md`)
- Inventory movement → PostgreSQL: persists (evidence: `README.md`)
- Order and items → PostgreSQL: persists (evidence: `README.md`)
- Category → PostgreSQL: persists (evidence: `README.md`)
- Supplier → PostgreSQL: persists (evidence: `README.md`)
- Customer → PostgreSQL: persists (evidence: `README.md`)
- Invitation record → PostgreSQL: persists (evidence: `README.md`)
- Subscription record → PostgreSQL: persists (evidence: `README.md`)
