# puifai-tt/wasteless architecture

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

- Interactive diagram: https://gitdiagram.com/puifai-tt/wasteless
- Repository: https://github.com/puifai-tt/wasteless

## Overview

Wasteless is a client-side restaurant operations dashboard. Managers use it to review performance and risks, forecast dish demand from POS history and contextual factors, translate forecasts and recipes into supplier reorder advice, and mitigate near-expiry surplus with promotions. Inventory, recipes, CSV exchange, the Gemini assistant, Store TV preview, and daily briefings are additional documented capabilities. The tree provides no source excerpts, so implementation nodes point to the available HTML entry point; relationships are based on README descriptions only.

Main entry points: [`index.html`](https://github.com/puifai-tt/wasteless/blob/main/index.html) (Inventory management), [`inventory.csv`](https://github.com/puifai-tt/wasteless/blob/main/inventory.csv) (Inventory batches), [`recipes.csv`](https://github.com/puifai-tt/wasteless/blob/main/recipes.csv) (Recipe formulations), [`menu.csv`](https://github.com/puifai-tt/wasteless/blob/main/menu.csv) (Menu items)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operations["Operations dashboard"]
  node_dashboard["Executive analytics<br/>[index.html]"]
  node_alerts["Expiry alerts<br/>[index.html]"]
  node_inventory["Inventory management<br/>[index.html]"]
  node_inventory_data["Inventory batches<br/>[inventory.csv]"]
  node_recipe_data["Recipe formulations<br/>[recipes.csv]"]
  node_menu_data["Menu items<br/>[menu.csv]"]
  node_assistant["Gemini assistant<br/>[index.html]"]
  node_signage["Store TV preview<br/>[index.html]"]
  node_briefing["Daily briefings<br/>[index.html]"]
end

subgraph group_planning["Forecast and planning"]
  node_sales_data["POS history<br/>[pos_sales.csv]"]
  node_context["Weather and events"]
  node_forecast["Demand forecasting<br/>[index.html]"]
  node_procurement["BOM procurement<br/>[index.html]"]
end

subgraph group_mitigation["Waste mitigation"]
  node_waste["Waste mitigation<br/>[index.html]"]
  node_promotions["Promotional campaigns<br/>[index.html]"]
end

node_manager(("Store manager"))
node_gemini["Google Gemini API"]

node_manager -->|"reviews"| node_dashboard
node_dashboard -->|"shows alerts"| node_alerts
node_dashboard -->|"shows backtests"| node_forecast
node_sales_data -->|"provides history"| node_forecast
node_context -->|"informs demand"| node_forecast
node_forecast -->|"supplies projections"| node_procurement
node_recipe_data -->|"supplies formulations"| node_procurement
node_inventory_data -->|"supplies stock levels"| node_procurement
node_inventory -->|"tracks batches"| node_inventory_data
node_menu_data -->|"supports formulation management"| node_inventory
node_inventory -->|"tracks shelf life"| node_alerts
node_inventory -->|"identifies surplus"| node_waste
node_waste -->|"recommends pricing"| node_promotions
node_manager -->|"queries operations"| node_assistant
node_assistant -->|"uses API"| node_gemini
node_manager -->|"previews displays"| node_signage
node_manager -->|"receives summaries"| node_briefing

click node_dashboard "https://github.com/puifai-tt/wasteless/blob/main/index.html"
click node_alerts "https://github.com/puifai-tt/wasteless/blob/main/index.html"
click node_inventory "https://github.com/puifai-tt/wasteless/blob/main/index.html"
click node_inventory_data "https://github.com/puifai-tt/wasteless/blob/main/inventory.csv"
click node_recipe_data "https://github.com/puifai-tt/wasteless/blob/main/recipes.csv"
click node_menu_data "https://github.com/puifai-tt/wasteless/blob/main/menu.csv"
click node_sales_data "https://github.com/puifai-tt/wasteless/blob/main/pos_sales.csv"
click node_forecast "https://github.com/puifai-tt/wasteless/blob/main/index.html"
click node_procurement "https://github.com/puifai-tt/wasteless/blob/main/index.html"
click node_waste "https://github.com/puifai-tt/wasteless/blob/main/index.html"
click node_promotions "https://github.com/puifai-tt/wasteless/blob/main/index.html"
click node_assistant "https://github.com/puifai-tt/wasteless/blob/main/index.html"
click node_signage "https://github.com/puifai-tt/wasteless/blob/main/index.html"
click node_briefing "https://github.com/puifai-tt/wasteless/blob/main/index.html"

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_dashboard,node_alerts,node_inventory,node_inventory_data,node_recipe_data,node_menu_data,node_assistant,node_signage,node_briefing toneBlue
class node_sales_data,node_context,node_forecast,node_procurement toneAmber
class node_waste,node_promotions,node_gemini toneMint
class node_manager toneIndigo
```

## Components

### Operations dashboard

- [Executive analytics](https://github.com/puifai-tt/wasteless/blob/main/index.html): `index.html`
- [Expiry alerts](https://github.com/puifai-tt/wasteless/blob/main/index.html): `index.html`
- [Inventory management](https://github.com/puifai-tt/wasteless/blob/main/index.html): `index.html`
- [Inventory batches](https://github.com/puifai-tt/wasteless/blob/main/inventory.csv): `inventory.csv`
- [Recipe formulations](https://github.com/puifai-tt/wasteless/blob/main/recipes.csv): `recipes.csv`
- [Menu items](https://github.com/puifai-tt/wasteless/blob/main/menu.csv): `menu.csv`
- [Gemini assistant](https://github.com/puifai-tt/wasteless/blob/main/index.html): `index.html`
- [Store TV preview](https://github.com/puifai-tt/wasteless/blob/main/index.html): `index.html`
- [Daily briefings](https://github.com/puifai-tt/wasteless/blob/main/index.html): `index.html`

### Forecast and planning

- [POS history](https://github.com/puifai-tt/wasteless/blob/main/pos_sales.csv): `pos_sales.csv`
- **Weather and events**
- [Demand forecasting](https://github.com/puifai-tt/wasteless/blob/main/index.html): `index.html`
- [BOM procurement](https://github.com/puifai-tt/wasteless/blob/main/index.html): `index.html`

### Waste mitigation

- [Waste mitigation](https://github.com/puifai-tt/wasteless/blob/main/index.html): `index.html`
- [Promotional campaigns](https://github.com/puifai-tt/wasteless/blob/main/index.html): `index.html`

### Other components

- **Store manager**
- **Google Gemini API**

## Connections

- Store manager → Executive analytics: reviews (evidence: `README.md`)
- Executive analytics → Expiry alerts: shows alerts (evidence: `README.md`)
- Executive analytics → Demand forecasting: shows backtests (evidence: `README.md`)
- POS history → Demand forecasting: provides history (evidence: `README.md`)
- Weather and events → Demand forecasting: informs demand (evidence: `README.md`)
- Demand forecasting → BOM procurement: supplies projections (evidence: `README.md`)
- Recipe formulations → BOM procurement: supplies formulations (evidence: `README.md`)
- Inventory batches → BOM procurement: supplies stock levels (evidence: `README.md`)
- Inventory management → Inventory batches: tracks batches (evidence: `README.md`)
- Menu items → Inventory management: supports formulation management (evidence: `README.md`)
- Inventory management → Expiry alerts: tracks shelf life (evidence: `README.md`)
- Inventory management → Waste mitigation: identifies surplus (evidence: `README.md`)
- Waste mitigation → Promotional campaigns: recommends pricing (evidence: `README.md`)
- Store manager → Gemini assistant: queries operations (evidence: `README.md`)
- Gemini assistant → Google Gemini API: uses API (evidence: `README.md`)
- Store manager → Store TV preview: previews displays (evidence: `README.md`)
- Store manager → Daily briefings: receives summaries (evidence: `README.md`)
