# devsayagroup/hub-aromabiji architecture

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

- Interactive diagram: https://gitdiagram.com/devsayagroup/hub-aromabiji
- Repository: https://github.com/devsayagroup/hub-aromabiji

## Overview

Aroma Biji Hub is a browser-based operations application for purchasing, vendors, production, and warehouse inventory. Users sign in, then work through these domain areas; the dashboard summarizes operational data, while barcode scanning supports item lookup. Domain stores coordinate application state and Supabase access. The README is only a generic Next.js template, so product capabilities are inferred from the supplied tree and source index. Several workflow pages are unsampled; their internal transitions are therefore not asserted here.

Main entry points: [`store/useWarehouseStore.ts`](https://github.com/devsayagroup/hub-aromabiji/blob/main/store/useWarehouseStore.ts) (Inventory state), [`app/(dashboard)/purchasing/page.tsx`](https://github.com/devsayagroup/hub-aromabiji/blob/main/app/(dashboard)/purchasing/page.tsx) (Purchase orders), [`components/ui/CameraScanner.tsx`](https://github.com/devsayagroup/hub-aromabiji/blob/main/components/ui/CameraScanner.tsx) (Camera scanner), [`store/useAuthStore.ts`](https://github.com/devsayagroup/hub-aromabiji/blob/main/store/useAuthStore.ts) (Session and roles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and navigation"]
  node_login["Sign in<br/>[page.tsx]"]
  node_auth["Session and roles<br/>[useAuthStore.ts]"]
  node_authprovider["Auth lifecycle<br/>[AuthProvider.tsx]"]
end

subgraph group_overview["Operations overview"]
  node_dashboard["Operations dashboard<br/>[page.tsx]"]
  node_overviewstore["Overview data"]
  node_overviewui["KPI and stock panels"]
end

subgraph group_procurement["Procurement and vendors"]
  node_purchasepage["Purchase orders<br/>[page.tsx]"]
  node_purchaseui["PO workflows"]
  node_purchasestore["Purchasing state"]
  node_deliveries["Deliveries<br/>[page.tsx]"]
  node_receipts["Receipt log<br/>[page.tsx]"]
  node_vendorpage["Vendor directory<br/>[page.tsx]"]
  node_vendordetail["Vendor profile and catalog"]
  node_vendorstore["Vendor state<br/>[useVendorStore.ts]"]
end

subgraph group_operations["Production and inventory"]
  node_productionpage["Manufacturing orders<br/>[page.tsx]"]
  node_productionui["MO create and detail<br/>[MoCreateModal.tsx]"]
  node_productionstore["Production state"]
  node_warehousepage["Warehouse hub<br/>[page.tsx]"]
  node_warehouseui["Warehouse stock table<br/>[WhStockTable.tsx]"]
  node_warehousebranches["Raw and finished goods"]
  node_warehousestore["Inventory state"]
  node_scanpage["Scan page<br/>[page.tsx]"]
  node_camerascanner["Camera scanner<br/>[CameraScanner.tsx]"]
  node_barcode["Barcode result"]
end

subgraph group_platform["Application services"]
  node_supabase[("Supabase")]
  node_search["Global search"]
  node_notifications["Notifications"]
end

node_user(("Staff user"))

node_user -->|"signs in"| node_login
node_login -->|"authenticates"| node_auth
node_authprovider -->|"checks session"| node_auth
node_authprovider -->|"listens for auth"| node_supabase
node_auth -->|"reads and signs in"| node_supabase
node_dashboard -->|"loads data"| node_overviewstore
node_dashboard -->|"renders panels"| node_overviewui
node_purchasepage -->|"loads orders"| node_purchasestore
node_purchasepage -->|"loads hubs and materials"| node_warehousestore
node_purchasepage -->|"renders workflow"| node_purchaseui
node_purchaseui -->|"uses order actions"| node_purchasestore
node_purchasestore -->|"reads and writes orders"| node_supabase
node_vendorpage -->|"loads vendor data"| node_vendorstore
node_vendordetail -->|"loads vendor catalog"| node_vendorstore
node_vendorstore -->|"reads and writes vendors"| node_supabase
node_productionpage -->|"renders workflow"| node_productionui
node_productionui -->|"uses MO actions"| node_productionstore
node_productionstore -->|"reads and writes orders"| node_supabase
node_warehousepage -->|"renders stock view"| node_warehouseui
node_warehouseui -->|"reads inventory"| node_warehousestore
node_warehousestore -->|"reads and writes inventory"| node_supabase
node_scanpage -->|"renders scanner"| node_camerascanner
node_camerascanner -->|"looks up inventory"| node_warehousestore
node_camerascanner -->|"opens scan result"| node_barcode

click node_login "https://github.com/devsayagroup/hub-aromabiji/blob/main/app/(auth)/login/page.tsx"
click node_auth "https://github.com/devsayagroup/hub-aromabiji/blob/main/store/useAuthStore.ts"
click node_authprovider "https://github.com/devsayagroup/hub-aromabiji/blob/main/components/providers/AuthProvider.tsx"
click node_dashboard "https://github.com/devsayagroup/hub-aromabiji/blob/main/app/(dashboard)/page.tsx"
click node_overviewstore "https://github.com/devsayagroup/hub-aromabiji/blob/main/store/useOverviewStore.ts"
click node_overviewui "https://github.com/devsayagroup/hub-aromabiji/tree/main/components/features/overview"
click node_purchasepage "https://github.com/devsayagroup/hub-aromabiji/blob/main/app/(dashboard)/purchasing/page.tsx"
click node_purchaseui "https://github.com/devsayagroup/hub-aromabiji/tree/main/components/features/purchase/purchasing"
click node_purchasestore "https://github.com/devsayagroup/hub-aromabiji/blob/main/store/usePurchaseStore.ts"
click node_deliveries "https://github.com/devsayagroup/hub-aromabiji/blob/main/app/(dashboard)/purchasing/deliveries/page.tsx"
click node_receipts "https://github.com/devsayagroup/hub-aromabiji/blob/main/app/(dashboard)/purchasing/receipt-log/page.tsx"
click node_vendorpage "https://github.com/devsayagroup/hub-aromabiji/blob/main/app/(dashboard)/vendors/page.tsx"
click node_vendordetail "https://github.com/devsayagroup/hub-aromabiji/blob/main/components/features/vendors/detail/VendorDetailClient.tsx"
click node_vendorstore "https://github.com/devsayagroup/hub-aromabiji/blob/main/store/useVendorStore.ts"
click node_productionpage "https://github.com/devsayagroup/hub-aromabiji/blob/main/app/(dashboard)/production/page.tsx"
click node_productionui "https://github.com/devsayagroup/hub-aromabiji/blob/main/components/features/production/MoCreateModal.tsx"
click node_productionstore "https://github.com/devsayagroup/hub-aromabiji/blob/main/store/useProductionStore.ts"
click node_warehousepage "https://github.com/devsayagroup/hub-aromabiji/blob/main/app/(dashboard)/warehouse/page.tsx"
click node_warehouseui "https://github.com/devsayagroup/hub-aromabiji/blob/main/components/features/warehouse/hub/WhStockTable.tsx"
click node_warehousebranches "https://github.com/devsayagroup/hub-aromabiji/tree/main/app/(dashboard)/warehouse"
click node_warehousestore "https://github.com/devsayagroup/hub-aromabiji/blob/main/store/useWarehouseStore.ts"
click node_scanpage "https://github.com/devsayagroup/hub-aromabiji/blob/main/app/(dashboard)/warehouse/scan/page.tsx"
click node_camerascanner "https://github.com/devsayagroup/hub-aromabiji/blob/main/components/ui/CameraScanner.tsx"
click node_barcode "https://github.com/devsayagroup/hub-aromabiji/blob/main/components/ui/GlobalBarcodeModal.tsx"
click node_search "https://github.com/devsayagroup/hub-aromabiji/blob/main/components/features/search/GlobalSearchModal.tsx"
click node_notifications "https://github.com/devsayagroup/hub-aromabiji/blob/main/components/features/notifications/NotificationDropdown.tsx"

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_auth,node_authprovider,node_user toneBlue
class node_dashboard,node_overviewstore,node_overviewui toneAmber
class node_purchasepage,node_purchaseui,node_purchasestore,node_deliveries,node_receipts,node_vendorpage,node_vendordetail,node_vendorstore toneMint
class node_productionpage,node_productionui,node_productionstore,node_warehousepage,node_warehouseui,node_warehousebranches,node_warehousestore,node_scanpage,node_camerascanner,node_barcode toneRose
class node_supabase,node_search,node_notifications toneIndigo
```

## Components

### Access and navigation

- [Sign in](https://github.com/devsayagroup/hub-aromabiji/blob/main/app/(auth)/login/page.tsx): `app/(auth)/login/page.tsx`
- [Session and roles](https://github.com/devsayagroup/hub-aromabiji/blob/main/store/useAuthStore.ts): `store/useAuthStore.ts`
- [Auth lifecycle](https://github.com/devsayagroup/hub-aromabiji/blob/main/components/providers/AuthProvider.tsx): `components/providers/AuthProvider.tsx`

### Operations overview

- [Operations dashboard](https://github.com/devsayagroup/hub-aromabiji/blob/main/app/(dashboard)/page.tsx): `app/(dashboard)/page.tsx`
- [Overview data](https://github.com/devsayagroup/hub-aromabiji/blob/main/store/useOverviewStore.ts): `store/useOverviewStore.ts`
- [KPI and stock panels](https://github.com/devsayagroup/hub-aromabiji/tree/main/components/features/overview): `components/features/overview`

### Procurement and vendors

- [Purchase orders](https://github.com/devsayagroup/hub-aromabiji/blob/main/app/(dashboard)/purchasing/page.tsx): `app/(dashboard)/purchasing/page.tsx`
- [PO workflows](https://github.com/devsayagroup/hub-aromabiji/tree/main/components/features/purchase/purchasing): `components/features/purchase/purchasing`
- [Purchasing state](https://github.com/devsayagroup/hub-aromabiji/blob/main/store/usePurchaseStore.ts): `store/usePurchaseStore.ts`
- [Deliveries](https://github.com/devsayagroup/hub-aromabiji/blob/main/app/(dashboard)/purchasing/deliveries/page.tsx): `app/(dashboard)/purchasing/deliveries/page.tsx`
- [Receipt log](https://github.com/devsayagroup/hub-aromabiji/blob/main/app/(dashboard)/purchasing/receipt-log/page.tsx): `app/(dashboard)/purchasing/receipt-log/page.tsx`
- [Vendor directory](https://github.com/devsayagroup/hub-aromabiji/blob/main/app/(dashboard)/vendors/page.tsx): `app/(dashboard)/vendors/page.tsx`
- [Vendor profile and catalog](https://github.com/devsayagroup/hub-aromabiji/blob/main/components/features/vendors/detail/VendorDetailClient.tsx): `components/features/vendors/detail/VendorDetailClient.tsx`
- [Vendor state](https://github.com/devsayagroup/hub-aromabiji/blob/main/store/useVendorStore.ts): `store/useVendorStore.ts`

### Production and inventory

- [Manufacturing orders](https://github.com/devsayagroup/hub-aromabiji/blob/main/app/(dashboard)/production/page.tsx): `app/(dashboard)/production/page.tsx`
- [MO create and detail](https://github.com/devsayagroup/hub-aromabiji/blob/main/components/features/production/MoCreateModal.tsx): `components/features/production/MoCreateModal.tsx`
- [Production state](https://github.com/devsayagroup/hub-aromabiji/blob/main/store/useProductionStore.ts): `store/useProductionStore.ts`
- [Warehouse hub](https://github.com/devsayagroup/hub-aromabiji/blob/main/app/(dashboard)/warehouse/page.tsx): `app/(dashboard)/warehouse/page.tsx`
- [Warehouse stock table](https://github.com/devsayagroup/hub-aromabiji/blob/main/components/features/warehouse/hub/WhStockTable.tsx): `components/features/warehouse/hub/WhStockTable.tsx`
- [Raw and finished goods](https://github.com/devsayagroup/hub-aromabiji/tree/main/app/(dashboard)/warehouse): `app/(dashboard)/warehouse`
- [Inventory state](https://github.com/devsayagroup/hub-aromabiji/blob/main/store/useWarehouseStore.ts): `store/useWarehouseStore.ts`
- [Scan page](https://github.com/devsayagroup/hub-aromabiji/blob/main/app/(dashboard)/warehouse/scan/page.tsx): `app/(dashboard)/warehouse/scan/page.tsx`
- [Camera scanner](https://github.com/devsayagroup/hub-aromabiji/blob/main/components/ui/CameraScanner.tsx): `components/ui/CameraScanner.tsx`
- [Barcode result](https://github.com/devsayagroup/hub-aromabiji/blob/main/components/ui/GlobalBarcodeModal.tsx): `components/ui/GlobalBarcodeModal.tsx`

### Application services

- **Supabase**
- [Global search](https://github.com/devsayagroup/hub-aromabiji/blob/main/components/features/search/GlobalSearchModal.tsx): `components/features/search/GlobalSearchModal.tsx`
- [Notifications](https://github.com/devsayagroup/hub-aromabiji/blob/main/components/features/notifications/NotificationDropdown.tsx): `components/features/notifications/NotificationDropdown.tsx`

### Other components

- **Staff user**

## Connections

- Staff user → Sign in: signs in
- Sign in → Session and roles: authenticates (evidence: `app/(auth)/login/page.tsx`)
- Auth lifecycle → Session and roles: checks session (evidence: `components/providers/AuthProvider.tsx`)
- Auth lifecycle → Supabase: listens for auth (evidence: `components/providers/AuthProvider.tsx`)
- Session and roles → Supabase: reads and signs in (evidence: `store/useAuthStore.ts`)
- Operations dashboard → Overview data: loads data (evidence: `app/(dashboard)/page.tsx`)
- Operations dashboard → KPI and stock panels: renders panels (evidence: `app/(dashboard)/page.tsx`)
- Purchase orders → Purchasing state: loads orders (evidence: `app/(dashboard)/purchasing/page.tsx`)
- Purchase orders → Inventory state: loads hubs and materials (evidence: `app/(dashboard)/purchasing/page.tsx`)
- Purchase orders → PO workflows: renders workflow (evidence: `app/(dashboard)/purchasing/page.tsx`)
- PO workflows → Purchasing state: uses order actions (evidence: `components/features/purchase/purchasing/PoDetailModal.tsx`)
- Purchasing state → Supabase: reads and writes orders (evidence: `store/usePurchaseStore.ts`)
- Vendor directory → Vendor state: loads vendor data
- Vendor profile and catalog → Vendor state: loads vendor catalog (evidence: `components/features/vendors/detail/VendorDetailClient.tsx`)
- Vendor state → Supabase: reads and writes vendors (evidence: `store/useVendorStore.ts`)
- Manufacturing orders → MO create and detail: renders workflow (evidence: `app/(dashboard)/production/page.tsx`)
- MO create and detail → Production state: uses MO actions (evidence: `components/features/production/MoCreateModal.tsx`)
- Production state → Supabase: reads and writes orders (evidence: `store/useProductionStore.ts`)
- Warehouse hub → Warehouse stock table: renders stock view (evidence: `app/(dashboard)/warehouse/page.tsx`)
- Warehouse stock table → Inventory state: reads inventory (evidence: `components/features/warehouse/hub/WhStockTable.tsx`)
- Inventory state → Supabase: reads and writes inventory (evidence: `store/useWarehouseStore.ts`)
- Scan page → Camera scanner: renders scanner (evidence: `app/(dashboard)/warehouse/scan/page.tsx`)
- Camera scanner → Inventory state: looks up inventory (evidence: `components/ui/CameraScanner.tsx`)
- Camera scanner → Barcode result: opens scan result (evidence: `components/ui/CameraScanner.tsx`)
