# dreeking/studio architecture

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

- Interactive diagram: https://gitdiagram.com/dreeking/studio
- Repository: https://github.com/dreeking/studio

## Overview

This repository is a Next.js point-of-sale and small-business operations interface presented as a Firebase Studio starter. The user-facing surface spans sales, order and delivery handling, business records, reporting, and configuration; a WhatsApp assistant is the distinct AI capability. The sampled pages primarily keep state in the client, and no persistent application database or backend is evidenced. Relationships among unsampled routes are therefore omitted; the visible AI links and sampled UI dependencies are shown where supported.

Main entry points: [`src/components/ui`](https://github.com/dreeking/studio/tree/master/src/components/ui) (UI Components), [`src/hooks/use-toast.ts`](https://github.com/dreeking/studio/blob/master/src/hooks/use-toast.ts) (Toast State), [`src/app/(main)/dashboard/page.tsx`](https://github.com/dreeking/studio/blob/master/src/app/(main)/dashboard/page.tsx) (Dashboard), [`src/app/(main)/sales/page.tsx`](https://github.com/dreeking/studio/blob/master/src/app/(main)/sales/page.tsx) (Point Of Sale)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operations["Store Operations"]
  node_sales["Point Of Sale<br/>[page.tsx]"]
  node_register["Cash Register<br/>[page.tsx]"]
  node_orders["Orders<br/>[page.tsx]"]
  node_delivery["Delivery<br/>[page.tsx]"]
  node_couriers["Courier Management<br/>[page.tsx]"]
  node_customers["Customers<br/>[page.tsx]"]
  node_products["Products<br/>[page.tsx]"]
  node_history["Sales History<br/>[page.tsx]"]
end

subgraph group_insight["Dashboard And Reports"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_reports["Reports<br/>[page.tsx]"]
end

subgraph group_admin["Business Administration"]
  node_settings["Settings<br/>[page.tsx]"]
end

subgraph group_assistant["WhatsApp Assistant"]
  node_support["Support<br/>[page.tsx]"]
  node_whatsapp["WhatsApp Assistant UI"]
  node_order_ai["Order Processing Flow"]
  node_genkit["Genkit Setup<br/>[genkit.ts]"]
end

subgraph group_shared["Shared Interface"]
  node_ui["UI Components"]
  node_toast["Toast State<br/>[use-toast.ts]"]
  node_sidebar["Navigation Sidebar<br/>[main-sidebar.tsx]"]
  node_metric["Metric Card<br/>[metric-card.tsx]"]
  node_channel_chart["Channel Chart"]
end

node_user(("Store Operator"))
node_home["App Home<br/>[page.tsx]"]

node_user -->|"opens"| node_home
node_whatsapp -->|"submits to"| node_order_ai
node_order_ai -->|"uses"| node_genkit
node_sales -->|"renders"| node_ui
node_sales -->|"notifies via"| node_toast
node_register -->|"renders"| node_ui
node_register -->|"notifies via"| node_toast
node_orders -->|"renders"| node_ui
node_orders -->|"notifies via"| node_toast
node_delivery -->|"renders"| node_ui
node_delivery -->|"notifies via"| node_toast
node_couriers -->|"renders"| node_ui
node_couriers -->|"notifies via"| node_toast
node_customers -->|"renders"| node_ui
node_customers -->|"notifies via"| node_toast
node_products -->|"renders"| node_ui
node_products -->|"notifies via"| node_toast
node_history -->|"renders"| node_ui
node_history -->|"notifies via"| node_toast
node_reports -->|"renders"| node_ui
node_reports -->|"notifies via"| node_toast
node_settings -->|"renders"| node_ui
node_dashboard -->|"renders"| node_metric
node_dashboard -->|"renders"| node_channel_chart
node_metric -->|"uses"| node_ui
node_channel_chart -->|"uses"| node_ui
node_sidebar -->|"uses"| node_ui
node_home -.->|"routes to"| node_dashboard

click node_home "https://github.com/dreeking/studio/blob/master/src/app/page.tsx"
click node_sales "https://github.com/dreeking/studio/blob/master/src/app/(main)/sales/page.tsx"
click node_register "https://github.com/dreeking/studio/blob/master/src/app/(main)/cash-register/open/page.tsx"
click node_orders "https://github.com/dreeking/studio/blob/master/src/app/(main)/orders/page.tsx"
click node_delivery "https://github.com/dreeking/studio/blob/master/src/app/(main)/delivery/page.tsx"
click node_couriers "https://github.com/dreeking/studio/blob/master/src/app/(main)/couriers/page.tsx"
click node_customers "https://github.com/dreeking/studio/blob/master/src/app/(main)/customers/page.tsx"
click node_products "https://github.com/dreeking/studio/blob/master/src/app/(main)/products/page.tsx"
click node_history "https://github.com/dreeking/studio/blob/master/src/app/(main)/sales-history/page.tsx"
click node_dashboard "https://github.com/dreeking/studio/blob/master/src/app/(main)/dashboard/page.tsx"
click node_reports "https://github.com/dreeking/studio/blob/master/src/app/(main)/reports/page.tsx"
click node_settings "https://github.com/dreeking/studio/blob/master/src/app/(main)/settings/page.tsx"
click node_support "https://github.com/dreeking/studio/blob/master/src/app/(main)/support/page.tsx"
click node_whatsapp "https://github.com/dreeking/studio/blob/master/src/app/(main)/support/whatsapp-assistant-client.tsx"
click node_order_ai "https://github.com/dreeking/studio/blob/master/src/ai/flows/whatsapp-order-processing.ts"
click node_genkit "https://github.com/dreeking/studio/blob/master/src/ai/genkit.ts"
click node_ui "https://github.com/dreeking/studio/tree/master/src/components/ui"
click node_toast "https://github.com/dreeking/studio/blob/master/src/hooks/use-toast.ts"
click node_sidebar "https://github.com/dreeking/studio/blob/master/src/components/layout/main-sidebar.tsx"
click node_metric "https://github.com/dreeking/studio/blob/master/src/components/dashboard/metric-card.tsx"
click node_channel_chart "https://github.com/dreeking/studio/blob/master/src/components/dashboard/sales-by-channel-chart.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_sales,node_register,node_orders,node_delivery,node_couriers,node_customers,node_products,node_history toneBlue
class node_dashboard,node_reports toneAmber
class node_settings toneMint
class node_support,node_whatsapp,node_order_ai,node_genkit toneRose
class node_ui,node_toast,node_sidebar,node_metric,node_channel_chart,node_user toneIndigo
class node_home toneTeal
```

## Components

### Store Operations

- [Point Of Sale](https://github.com/dreeking/studio/blob/master/src/app/(main)/sales/page.tsx): `src/app/(main)/sales/page.tsx`
- [Cash Register](https://github.com/dreeking/studio/blob/master/src/app/(main)/cash-register/open/page.tsx): `src/app/(main)/cash-register/open/page.tsx`
- [Orders](https://github.com/dreeking/studio/blob/master/src/app/(main)/orders/page.tsx): `src/app/(main)/orders/page.tsx`
- [Delivery](https://github.com/dreeking/studio/blob/master/src/app/(main)/delivery/page.tsx): `src/app/(main)/delivery/page.tsx`
- [Courier Management](https://github.com/dreeking/studio/blob/master/src/app/(main)/couriers/page.tsx): `src/app/(main)/couriers/page.tsx`
- [Customers](https://github.com/dreeking/studio/blob/master/src/app/(main)/customers/page.tsx): `src/app/(main)/customers/page.tsx`
- [Products](https://github.com/dreeking/studio/blob/master/src/app/(main)/products/page.tsx): `src/app/(main)/products/page.tsx`
- [Sales History](https://github.com/dreeking/studio/blob/master/src/app/(main)/sales-history/page.tsx): `src/app/(main)/sales-history/page.tsx`

### Dashboard And Reports

- [Dashboard](https://github.com/dreeking/studio/blob/master/src/app/(main)/dashboard/page.tsx): `src/app/(main)/dashboard/page.tsx`
- [Reports](https://github.com/dreeking/studio/blob/master/src/app/(main)/reports/page.tsx): `src/app/(main)/reports/page.tsx`

### Business Administration

- [Settings](https://github.com/dreeking/studio/blob/master/src/app/(main)/settings/page.tsx): `src/app/(main)/settings/page.tsx`

### WhatsApp Assistant

- [Support](https://github.com/dreeking/studio/blob/master/src/app/(main)/support/page.tsx): `src/app/(main)/support/page.tsx`
- [WhatsApp Assistant UI](https://github.com/dreeking/studio/blob/master/src/app/(main)/support/whatsapp-assistant-client.tsx): `src/app/(main)/support/whatsapp-assistant-client.tsx`
- [Order Processing Flow](https://github.com/dreeking/studio/blob/master/src/ai/flows/whatsapp-order-processing.ts): `src/ai/flows/whatsapp-order-processing.ts`
- [Genkit Setup](https://github.com/dreeking/studio/blob/master/src/ai/genkit.ts): `src/ai/genkit.ts`

### Shared Interface

- [UI Components](https://github.com/dreeking/studio/tree/master/src/components/ui): `src/components/ui`
- [Toast State](https://github.com/dreeking/studio/blob/master/src/hooks/use-toast.ts): `src/hooks/use-toast.ts`
- [Navigation Sidebar](https://github.com/dreeking/studio/blob/master/src/components/layout/main-sidebar.tsx): `src/components/layout/main-sidebar.tsx`
- [Metric Card](https://github.com/dreeking/studio/blob/master/src/components/dashboard/metric-card.tsx): `src/components/dashboard/metric-card.tsx`
- [Channel Chart](https://github.com/dreeking/studio/blob/master/src/components/dashboard/sales-by-channel-chart.tsx): `src/components/dashboard/sales-by-channel-chart.tsx`

### Other components

- **Store Operator**
- [App Home](https://github.com/dreeking/studio/blob/master/src/app/page.tsx): `src/app/page.tsx`

## Connections

- Store Operator → App Home: opens
- WhatsApp Assistant UI → Order Processing Flow: submits to (evidence: `src/app/(main)/support/whatsapp-assistant-client.tsx`)
- Order Processing Flow → Genkit Setup: uses (evidence: `src/ai/flows/whatsapp-order-processing.ts`)
- Point Of Sale → UI Components: renders (evidence: `src/app/(main)/sales/page.tsx`)
- Point Of Sale → Toast State: notifies via (evidence: `src/app/(main)/sales/page.tsx`)
- Cash Register → UI Components: renders (evidence: `src/app/(main)/cash-register/open/page.tsx`)
- Cash Register → Toast State: notifies via (evidence: `src/app/(main)/cash-register/open/page.tsx`)
- Orders → UI Components: renders (evidence: `src/app/(main)/orders/page.tsx`)
- Orders → Toast State: notifies via (evidence: `src/app/(main)/orders/page.tsx`)
- Delivery → UI Components: renders (evidence: `src/app/(main)/delivery/page.tsx`)
- Delivery → Toast State: notifies via (evidence: `src/app/(main)/delivery/page.tsx`)
- Courier Management → UI Components: renders (evidence: `src/app/(main)/couriers/page.tsx`)
- Courier Management → Toast State: notifies via (evidence: `src/app/(main)/couriers/page.tsx`)
- Customers → UI Components: renders (evidence: `src/app/(main)/customers/page.tsx`)
- Customers → Toast State: notifies via (evidence: `src/app/(main)/customers/page.tsx`)
- Products → UI Components: renders (evidence: `src/app/(main)/products/page.tsx`)
- Products → Toast State: notifies via (evidence: `src/app/(main)/products/page.tsx`)
- Sales History → UI Components: renders (evidence: `src/app/(main)/sales-history/page.tsx`)
- Sales History → Toast State: notifies via (evidence: `src/app/(main)/sales-history/page.tsx`)
- Reports → UI Components: renders (evidence: `src/app/(main)/reports/page.tsx`)
- Reports → Toast State: notifies via (evidence: `src/app/(main)/reports/page.tsx`)
- Settings → UI Components: renders (evidence: `src/app/(main)/settings/page.tsx`)
- Dashboard → Metric Card: renders (evidence: `src/app/(main)/dashboard/page.tsx`)
- Dashboard → Channel Chart: renders (evidence: `src/app/(main)/dashboard/page.tsx`)
- Metric Card → UI Components: uses (evidence: `src/components/dashboard/metric-card.tsx`)
- Channel Chart → UI Components: uses (evidence: `src/components/dashboard/sales-by-channel-chart.tsx`)
- Navigation Sidebar → UI Components: uses (evidence: `src/components/layout/main-sidebar.tsx`)
- App Home → Dashboard: routes to
