# tyo-whydi/stockflow-app architecture

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

- Interactive diagram: https://gitdiagram.com/tyo-whydi/stockflow-app
- Repository: https://github.com/tyo-whydi/stockflow-app

## Overview

StockFlow is a browser-based warehouse inventory app. Users can sign in, then manage product and location data, record stock movements, and review current stock, reports, and activity. The Next.js pages query Supabase directly through a shared browser client; the excerpts show authentication and several inventory operations, while other dashboard modules are represented from the source index and file tree. The README is a generic Next.js starter and documents no additional product capabilities.

Main entry points: [`lib/supabase.ts`](https://github.com/tyo-whydi/stockflow-app/blob/main/lib/supabase.ts) (Supabase client), [`app/login/page.tsx`](https://github.com/tyo-whydi/stockflow-app/blob/main/app/login/page.tsx) (Sign in), [`app/dashboard/page.tsx`](https://github.com/tyo-whydi/stockflow-app/blob/main/app/dashboard/page.tsx) (Dashboard overview), [`app/page.tsx`](https://github.com/tyo-whydi/stockflow-app/blob/main/app/page.tsx) (Home overview)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and overview"]
  node_login["Sign in<br/>[page.tsx]"]
  node_home["Home overview<br/>[page.tsx]"]
  node_dashboard["Dashboard overview<br/>[page.tsx]"]
  node_users["User management<br/>[page.tsx]"]
  node_profile["User profile<br/>[page.tsx]"]
end

subgraph group_inventory["Inventory operations"]
  node_categories["Categories<br/>[page.tsx]"]
  node_products["Products<br/>[page.tsx]"]
  node_locations["Storage locations<br/>[page.tsx]"]
  node_transactions["Stock transactions<br/>[page.tsx]"]
end

subgraph group_insights["Stock insights"]
  node_stock["Stock by location<br/>[page.tsx]"]
  node_reports["Stock reports<br/>[page.tsx]"]
  node_history["Activity history<br/>[page.tsx]"]
end

subgraph group_data["Data services"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
  node_supabase[("Supabase")]
end

node_user(("Warehouse user"))

node_user -->|"signs in"| node_login
node_login -->|"authenticates with"| node_supabase_client
node_login -->|"navigates to"| node_dashboard
node_home -->|"queries data"| node_supabase_client
node_dashboard -->|"queries data"| node_supabase_client
node_categories -->|"manages categories"| node_supabase_client
node_products -->|"manages products"| node_supabase_client
node_locations -->|"manages locations"| node_supabase_client
node_transactions -->|"records movements"| node_supabase_client
node_stock -->|"reads stock"| node_supabase_client
node_reports -->|"reads stock"| node_supabase_client
node_history -->|"reads activity"| node_supabase_client
node_users -->|"uses data client"| node_supabase_client
node_profile -->|"uses data client"| node_supabase_client
node_supabase_client -.->|"connects to"| node_supabase

click node_login "https://github.com/tyo-whydi/stockflow-app/blob/main/app/login/page.tsx"
click node_home "https://github.com/tyo-whydi/stockflow-app/blob/main/app/page.tsx"
click node_dashboard "https://github.com/tyo-whydi/stockflow-app/blob/main/app/dashboard/page.tsx"
click node_categories "https://github.com/tyo-whydi/stockflow-app/blob/main/app/dashboard/categories/page.tsx"
click node_products "https://github.com/tyo-whydi/stockflow-app/blob/main/app/dashboard/products/page.tsx"
click node_locations "https://github.com/tyo-whydi/stockflow-app/blob/main/app/dashboard/locations/page.tsx"
click node_transactions "https://github.com/tyo-whydi/stockflow-app/blob/main/app/dashboard/transactions/page.tsx"
click node_stock "https://github.com/tyo-whydi/stockflow-app/blob/main/app/dashboard/stock/page.tsx"
click node_reports "https://github.com/tyo-whydi/stockflow-app/blob/main/app/dashboard/reports/page.tsx"
click node_history "https://github.com/tyo-whydi/stockflow-app/blob/main/app/dashboard/history/page.tsx"
click node_users "https://github.com/tyo-whydi/stockflow-app/blob/main/app/dashboard/users/page.tsx"
click node_profile "https://github.com/tyo-whydi/stockflow-app/blob/main/app/dashboard/profile/page.tsx"
click node_supabase_client "https://github.com/tyo-whydi/stockflow-app/blob/main/lib/supabase.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_login,node_home,node_dashboard,node_users,node_profile,node_user toneBlue
class node_categories,node_products,node_locations,node_transactions toneAmber
class node_stock,node_reports,node_history toneMint
class node_supabase_client,node_supabase toneRose
```

## Components

### Access and overview

- [Sign in](https://github.com/tyo-whydi/stockflow-app/blob/main/app/login/page.tsx): `app/login/page.tsx`
- [Home overview](https://github.com/tyo-whydi/stockflow-app/blob/main/app/page.tsx): `app/page.tsx`
- [Dashboard overview](https://github.com/tyo-whydi/stockflow-app/blob/main/app/dashboard/page.tsx): `app/dashboard/page.tsx`
- [User management](https://github.com/tyo-whydi/stockflow-app/blob/main/app/dashboard/users/page.tsx): `app/dashboard/users/page.tsx`
- [User profile](https://github.com/tyo-whydi/stockflow-app/blob/main/app/dashboard/profile/page.tsx): `app/dashboard/profile/page.tsx`

### Inventory operations

- [Categories](https://github.com/tyo-whydi/stockflow-app/blob/main/app/dashboard/categories/page.tsx): `app/dashboard/categories/page.tsx`
- [Products](https://github.com/tyo-whydi/stockflow-app/blob/main/app/dashboard/products/page.tsx): `app/dashboard/products/page.tsx`
- [Storage locations](https://github.com/tyo-whydi/stockflow-app/blob/main/app/dashboard/locations/page.tsx): `app/dashboard/locations/page.tsx`
- [Stock transactions](https://github.com/tyo-whydi/stockflow-app/blob/main/app/dashboard/transactions/page.tsx): `app/dashboard/transactions/page.tsx`

### Stock insights

- [Stock by location](https://github.com/tyo-whydi/stockflow-app/blob/main/app/dashboard/stock/page.tsx): `app/dashboard/stock/page.tsx`
- [Stock reports](https://github.com/tyo-whydi/stockflow-app/blob/main/app/dashboard/reports/page.tsx): `app/dashboard/reports/page.tsx`
- [Activity history](https://github.com/tyo-whydi/stockflow-app/blob/main/app/dashboard/history/page.tsx): `app/dashboard/history/page.tsx`

### Data services

- [Supabase client](https://github.com/tyo-whydi/stockflow-app/blob/main/lib/supabase.ts): `lib/supabase.ts`
- **Supabase**

### Other components

- **Warehouse user**

## Connections

- Warehouse user → Sign in: signs in (evidence: `app/login/page.tsx`)
- Sign in → Supabase client: authenticates with (evidence: `app/login/page.tsx`)
- Sign in → Dashboard overview: navigates to (evidence: `app/login/page.tsx`)
- Home overview → Supabase client: queries data (evidence: `app/page.tsx`)
- Dashboard overview → Supabase client: queries data (evidence: `app/dashboard/page.tsx`)
- Categories → Supabase client: manages categories (evidence: `app/dashboard/categories/page.tsx`)
- Products → Supabase client: manages products (evidence: `app/dashboard/products/page.tsx`)
- Storage locations → Supabase client: manages locations (evidence: `app/dashboard/locations/page.tsx`)
- Stock transactions → Supabase client: records movements (evidence: `app/dashboard/transactions/page.tsx`)
- Stock by location → Supabase client: reads stock (evidence: `app/dashboard/stock/page.tsx`)
- Stock reports → Supabase client: reads stock (evidence: `app/dashboard/reports/page.tsx`)
- Activity history → Supabase client: reads activity (evidence: `app/dashboard/history/page.tsx`)
- User management → Supabase client: uses data client (evidence: `app/dashboard/users/page.tsx`)
- User profile → Supabase client: uses data client (evidence: `app/dashboard/profile/page.tsx`)
- Supabase client → Supabase: connects to
