# patrickbotarick/guigs-stock architecture

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

- Interactive diagram: https://gitdiagram.com/patrickbotarick/guigs-stock
- Repository: https://github.com/patrickbotarick/guigs-stock

## Overview

This repository is a browser-based stock-management dashboard. Users work with inventory, fridge operations, product images, and reports through the dashboard’s UI modules. The excerpts show the dashboard wiring those modules, plus report and image-library requests to Supabase. Inventory counting and fridge allocation/replenishment are distinct domain workflows, but their detailed orchestration is not fully shown. The graph focuses on demonstrated runtime modules and calls; it omits build and homologation tooling.

Main entry points: [`cloud-dashboard.js`](https://github.com/patrickbotarick/guigs-stock/blob/main/cloud-dashboard.js) (Dashboard shell), [`fridges.js`](https://github.com/patrickbotarick/guigs-stock/blob/main/fridges.js) (Fridge operations), [`reports.js`](https://github.com/patrickbotarick/guigs-stock/blob/main/reports.js) (Reports), [`image-library.js`](https://github.com/patrickbotarick/guigs-stock/blob/main/image-library.js) (Image library)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard UI"]
  node_dashboard["Dashboard shell<br/>[cloud-dashboard.js]"]
end

subgraph group_operations["Stock Operations"]
  node_inventory["Inventory counts<br/>[inventory.js]"]
  node_fridges["Fridge operations<br/>[fridges.js]"]
  node_reports["Reports<br/>[reports.js]"]
end

subgraph group_media["Product Images"]
  node_images["Image library<br/>[image-library.js]"]
end

node_user(("Dashboard user"))
node_supabase[("Supabase backend")]

node_user -->|"uses"| node_dashboard
node_dashboard -->|"creates UI"| node_inventory
node_dashboard -->|"creates UI"| node_fridges
node_dashboard -->|"creates UI"| node_reports
node_fridges -->|"uses library"| node_images
node_fridges -->|"calls RPCs"| node_supabase
node_fridges -->|"uploads images"| node_supabase
node_reports -->|"fetches reports"| node_supabase
node_images -->|"reads and writes"| node_supabase

click node_dashboard "https://github.com/patrickbotarick/guigs-stock/blob/main/cloud-dashboard.js"
click node_inventory "https://github.com/patrickbotarick/guigs-stock/blob/main/inventory.js"
click node_fridges "https://github.com/patrickbotarick/guigs-stock/blob/main/fridges.js"
click node_reports "https://github.com/patrickbotarick/guigs-stock/blob/main/reports.js"
click node_images "https://github.com/patrickbotarick/guigs-stock/blob/main/image-library.js"

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_user toneBlue
class node_inventory,node_fridges,node_reports,node_supabase toneAmber
class node_images toneMint
```

## Components

### Dashboard UI

- [Dashboard shell](https://github.com/patrickbotarick/guigs-stock/blob/main/cloud-dashboard.js): `cloud-dashboard.js`

### Stock Operations

- [Inventory counts](https://github.com/patrickbotarick/guigs-stock/blob/main/inventory.js): `inventory.js`
- [Fridge operations](https://github.com/patrickbotarick/guigs-stock/blob/main/fridges.js): `fridges.js`
- [Reports](https://github.com/patrickbotarick/guigs-stock/blob/main/reports.js): `reports.js`

### Product Images

- [Image library](https://github.com/patrickbotarick/guigs-stock/blob/main/image-library.js): `image-library.js`

### Other components

- **Dashboard user**
- **Supabase backend**

## Connections

- Dashboard user → Dashboard shell: uses
- Dashboard shell → Inventory counts: creates UI (evidence: `cloud-dashboard.js`)
- Dashboard shell → Fridge operations: creates UI (evidence: `cloud-dashboard.js`)
- Dashboard shell → Reports: creates UI (evidence: `cloud-dashboard.js`)
- Fridge operations → Image library: uses library (evidence: `fridges.js`)
- Fridge operations → Supabase backend: calls RPCs (evidence: `fridges.js`)
- Fridge operations → Supabase backend: uploads images (evidence: `fridges.js`)
- Reports → Supabase backend: fetches reports (evidence: `reports.js`)
- Image library → Supabase backend: reads and writes (evidence: `image-library.js`)
