# ezzademir/quackmaster architecture

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

- Interactive diagram: https://gitdiagram.com/ezzademir/quackmaster
- Repository: https://github.com/ezzademir/quackmaster

## Overview

This is a restaurant operations application for managing procurement, production, inventory, outlet distribution, sales, and operational oversight. Users enter through authenticated routes, then work in domain pages that read or update Supabase-backed data; production and distribution services also apply workflow rules and record ledger activity. The graph preserves the major operational and reporting areas present in the route map and source tree. Relationships for unsampled pages are limited to documented routing or imports; their internal behavior is not inferred.

Main entry points: [`src/App.tsx`](https://github.com/ezzademir/quackmaster/blob/main/src/App.tsx) (Application routes), [`src/utils/supabase.ts`](https://github.com/ezzademir/quackmaster/blob/main/src/utils/supabase.ts) (Supabase client), [`src/pages/Production.tsx`](https://github.com/ezzademir/quackmaster/blob/main/src/pages/Production.tsx) (Production), [`src/utils/productionService.ts`](https://github.com/ezzademir/quackmaster/blob/main/src/utils/productionService.ts) (Production workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and navigation"]
  node_app["Application routes<br/>[App.tsx]"]
  node_auth["Authentication<br/>[auth.tsx]"]
  node_layout["Application layout<br/>[Layout.tsx]"]
end

subgraph group_supply["Supply and production"]
  node_procurement["Procurement<br/>[Procurement.tsx]"]
  node_production["Production<br/>[Production.tsx]"]
  node_production_service["Production workflow"]
  node_planning["Production planning"]
end

subgraph group_inventory["Inventory and distribution"]
  node_inventory_page["Inventory<br/>[Inventory.tsx]"]
  node_stocktake["Stock take<br/>[StockTake.tsx]"]
  node_outlet_stocktake["Outlet stock take"]
  node_distribution["Distribution<br/>[Distribution.tsx]"]
  node_distribution_service["Distribution workflow"]
  node_par["Outlet reorder suggestions<br/>[parService.ts]"]
end

subgraph group_oversight["Sales and oversight"]
  node_sales["Sales<br/>[Sales.tsx]"]
  node_pos["POS comparison<br/>[PosCompare.tsx]"]
  node_overview["Overview dashboard<br/>[Overview.tsx]"]
  node_reconciliation["Reconciliation<br/>[Reconciliation.tsx]"]
  node_genealogy["Lot genealogy<br/>[Genealogy.tsx]"]
  node_ledger_page["Audit ledger<br/>[Ledger.tsx]"]
end

subgraph group_data["Data and workflow services"]
  node_ledger_service["Ledger service<br/>[ledger.ts]"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
  node_datefilter["Date filtering<br/>[DateFilter.tsx]"]
  node_daterange["Date range logic<br/>[dateRange.ts]"]
end

node_operator(("Staff or admin"))
node_supabase_store[("Supabase data service")]

node_operator -->|"opens"| node_app
node_app -->|"provides auth"| node_auth
node_app -->|"routes through"| node_layout
node_app -->|"routes to"| node_procurement
node_app -->|"routes to"| node_production
node_app -->|"routes to"| node_inventory_page
node_app -->|"routes to"| node_distribution
node_app -->|"routes to"| node_sales
node_app -->|"routes to"| node_pos
node_app -->|"routes to"| node_overview
node_app -->|"routes to"| node_stocktake
node_app -->|"routes to"| node_reconciliation
node_app -->|"routes to"| node_genealogy
node_app -->|"routes to"| node_ledger_page
node_auth -->|"uses"| node_supabase_client
node_supabase_client -->|"connects to"| node_supabase_store
node_procurement -->|"reads and writes"| node_supabase_client
node_production -->|"invokes"| node_production_service
node_production -->|"renders"| node_planning
node_production_service -->|"updates data"| node_supabase_client
node_production_service -->|"records events"| node_ledger_service
node_distribution -->|"invokes"| node_distribution_service
node_distribution -->|"uses suggestions"| node_par
node_distribution_service -->|"updates data"| node_supabase_client
node_distribution_service -->|"records events"| node_ledger_service
node_par -->|"reads inventory"| node_supabase_client
node_outlet_stocktake -->|"reads and writes"| node_supabase_client
node_datefilter -->|"uses"| node_daterange
node_ledger_service -->|"writes entries"| node_supabase_client

click node_app "https://github.com/ezzademir/quackmaster/blob/main/src/App.tsx"
click node_auth "https://github.com/ezzademir/quackmaster/blob/main/src/utils/auth.tsx"
click node_layout "https://github.com/ezzademir/quackmaster/blob/main/src/components/Layout.tsx"
click node_procurement "https://github.com/ezzademir/quackmaster/blob/main/src/pages/Procurement.tsx"
click node_production "https://github.com/ezzademir/quackmaster/blob/main/src/pages/Production.tsx"
click node_production_service "https://github.com/ezzademir/quackmaster/blob/main/src/utils/productionService.ts"
click node_planning "https://github.com/ezzademir/quackmaster/blob/main/src/components/ProductionPlanningPanel.tsx"
click node_inventory_page "https://github.com/ezzademir/quackmaster/blob/main/src/pages/Inventory.tsx"
click node_stocktake "https://github.com/ezzademir/quackmaster/blob/main/src/pages/StockTake.tsx"
click node_outlet_stocktake "https://github.com/ezzademir/quackmaster/blob/main/src/components/outletStockTake/OutletStockTakeTab.tsx"
click node_distribution "https://github.com/ezzademir/quackmaster/blob/main/src/pages/Distribution.tsx"
click node_distribution_service "https://github.com/ezzademir/quackmaster/blob/main/src/utils/distributionService.ts"
click node_par "https://github.com/ezzademir/quackmaster/blob/main/src/utils/parService.ts"
click node_sales "https://github.com/ezzademir/quackmaster/blob/main/src/pages/Sales.tsx"
click node_pos "https://github.com/ezzademir/quackmaster/blob/main/src/pages/PosCompare.tsx"
click node_overview "https://github.com/ezzademir/quackmaster/blob/main/src/pages/Overview.tsx"
click node_reconciliation "https://github.com/ezzademir/quackmaster/blob/main/src/pages/Reconciliation.tsx"
click node_genealogy "https://github.com/ezzademir/quackmaster/blob/main/src/pages/Genealogy.tsx"
click node_ledger_page "https://github.com/ezzademir/quackmaster/blob/main/src/pages/Ledger.tsx"
click node_ledger_service "https://github.com/ezzademir/quackmaster/blob/main/src/utils/ledger.ts"
click node_supabase_client "https://github.com/ezzademir/quackmaster/blob/main/src/utils/supabase.ts"
click node_datefilter "https://github.com/ezzademir/quackmaster/blob/main/src/components/DateFilter.tsx"
click node_daterange "https://github.com/ezzademir/quackmaster/blob/main/src/utils/dateRange.ts"

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_app,node_auth,node_layout toneBlue
class node_procurement,node_production,node_production_service,node_planning,node_supabase_store toneAmber
class node_inventory_page,node_stocktake,node_outlet_stocktake,node_distribution,node_distribution_service,node_par toneMint
class node_sales,node_pos,node_overview,node_reconciliation,node_genealogy,node_ledger_page toneRose
class node_ledger_service,node_supabase_client,node_datefilter,node_daterange,node_operator toneIndigo
```

## Components

### Access and navigation

- [Application routes](https://github.com/ezzademir/quackmaster/blob/main/src/App.tsx): `src/App.tsx`
- [Authentication](https://github.com/ezzademir/quackmaster/blob/main/src/utils/auth.tsx): `src/utils/auth.tsx`
- [Application layout](https://github.com/ezzademir/quackmaster/blob/main/src/components/Layout.tsx): `src/components/Layout.tsx`

### Supply and production

- [Procurement](https://github.com/ezzademir/quackmaster/blob/main/src/pages/Procurement.tsx): `src/pages/Procurement.tsx`
- [Production](https://github.com/ezzademir/quackmaster/blob/main/src/pages/Production.tsx): `src/pages/Production.tsx`
- [Production workflow](https://github.com/ezzademir/quackmaster/blob/main/src/utils/productionService.ts): `src/utils/productionService.ts`
- [Production planning](https://github.com/ezzademir/quackmaster/blob/main/src/components/ProductionPlanningPanel.tsx): `src/components/ProductionPlanningPanel.tsx`

### Inventory and distribution

- [Inventory](https://github.com/ezzademir/quackmaster/blob/main/src/pages/Inventory.tsx): `src/pages/Inventory.tsx`
- [Stock take](https://github.com/ezzademir/quackmaster/blob/main/src/pages/StockTake.tsx): `src/pages/StockTake.tsx`
- [Outlet stock take](https://github.com/ezzademir/quackmaster/blob/main/src/components/outletStockTake/OutletStockTakeTab.tsx): `src/components/outletStockTake/OutletStockTakeTab.tsx`
- [Distribution](https://github.com/ezzademir/quackmaster/blob/main/src/pages/Distribution.tsx): `src/pages/Distribution.tsx`
- [Distribution workflow](https://github.com/ezzademir/quackmaster/blob/main/src/utils/distributionService.ts): `src/utils/distributionService.ts`
- [Outlet reorder suggestions](https://github.com/ezzademir/quackmaster/blob/main/src/utils/parService.ts): `src/utils/parService.ts`

### Sales and oversight

- [Sales](https://github.com/ezzademir/quackmaster/blob/main/src/pages/Sales.tsx): `src/pages/Sales.tsx`
- [POS comparison](https://github.com/ezzademir/quackmaster/blob/main/src/pages/PosCompare.tsx): `src/pages/PosCompare.tsx`
- [Overview dashboard](https://github.com/ezzademir/quackmaster/blob/main/src/pages/Overview.tsx): `src/pages/Overview.tsx`
- [Reconciliation](https://github.com/ezzademir/quackmaster/blob/main/src/pages/Reconciliation.tsx): `src/pages/Reconciliation.tsx`
- [Lot genealogy](https://github.com/ezzademir/quackmaster/blob/main/src/pages/Genealogy.tsx): `src/pages/Genealogy.tsx`
- [Audit ledger](https://github.com/ezzademir/quackmaster/blob/main/src/pages/Ledger.tsx): `src/pages/Ledger.tsx`

### Data and workflow services

- [Ledger service](https://github.com/ezzademir/quackmaster/blob/main/src/utils/ledger.ts): `src/utils/ledger.ts`
- [Supabase client](https://github.com/ezzademir/quackmaster/blob/main/src/utils/supabase.ts): `src/utils/supabase.ts`
- [Date filtering](https://github.com/ezzademir/quackmaster/blob/main/src/components/DateFilter.tsx): `src/components/DateFilter.tsx`
- [Date range logic](https://github.com/ezzademir/quackmaster/blob/main/src/utils/dateRange.ts): `src/utils/dateRange.ts`

### Other components

- **Staff or admin**
- **Supabase data service**

## Connections

- Staff or admin → Application routes: opens (evidence: `src/App.tsx`)
- Application routes → Authentication: provides auth (evidence: `src/App.tsx`)
- Application routes → Application layout: routes through (evidence: `src/App.tsx`)
- Application routes → Procurement: routes to (evidence: `src/App.tsx`)
- Application routes → Production: routes to (evidence: `src/App.tsx`)
- Application routes → Inventory: routes to (evidence: `src/App.tsx`)
- Application routes → Distribution: routes to (evidence: `src/App.tsx`)
- Application routes → Sales: routes to (evidence: `src/App.tsx`)
- Application routes → POS comparison: routes to (evidence: `src/App.tsx`)
- Application routes → Overview dashboard: routes to (evidence: `src/App.tsx`)
- Application routes → Stock take: routes to (evidence: `src/App.tsx`)
- Application routes → Reconciliation: routes to (evidence: `src/App.tsx`)
- Application routes → Lot genealogy: routes to (evidence: `src/App.tsx`)
- Application routes → Audit ledger: routes to (evidence: `src/App.tsx`)
- Authentication → Supabase client: uses (evidence: `src/utils/auth.tsx`)
- Supabase client → Supabase data service: connects to (evidence: `src/utils/supabase.ts`)
- Procurement → Supabase client: reads and writes (evidence: `src/pages/Procurement.tsx`)
- Production → Production workflow: invokes (evidence: `src/pages/Production.tsx`)
- Production → Production planning: renders (evidence: `src/pages/Production.tsx`)
- Production workflow → Supabase client: updates data (evidence: `src/utils/productionService.ts`)
- Production workflow → Ledger service: records events (evidence: `src/utils/productionService.ts`)
- Distribution → Distribution workflow: invokes (evidence: `src/pages/Distribution.tsx`)
- Distribution → Outlet reorder suggestions: uses suggestions (evidence: `src/pages/Distribution.tsx`)
- Distribution workflow → Supabase client: updates data (evidence: `src/utils/distributionService.ts`)
- Distribution workflow → Ledger service: records events (evidence: `src/utils/distributionService.ts`)
- Outlet reorder suggestions → Supabase client: reads inventory (evidence: `src/utils/parService.ts`)
- Outlet stock take → Supabase client: reads and writes (evidence: `src/components/outletStockTake/OutletStockTakeTab.tsx`)
- Date filtering → Date range logic: uses (evidence: `src/components/DateFilter.tsx`)
- Ledger service → Supabase client: writes entries (evidence: `src/utils/ledger.ts`)
