# kevj-github/au-electronic architecture

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

- Interactive diagram: https://gitdiagram.com/kevj-github/au-electronic
- Repository: https://github.com/kevj-github/au-electronic

## Overview

AU Electronic is an Indonesian order-management/POS app for owners and shop-floor helpers. The main workflow is to manage customers, create and fulfill orders, record owner-only payments, and produce invoices or receipts. Dashboard reporting, realtime refresh, role-aware access, and shop settings are important supporting capabilities. The graph follows documented flows and SOURCE INDEX references; unsampled action implementations are represented by their exact listed paths, but their internal calls are not inferred.

Main entry points: [`src/app/(app)/dashboard/page.tsx`](https://github.com/kevj-github/au-electronic/blob/main/src/app/(app)/dashboard/page.tsx) (Dashboard), [`src/app/(app)/pesanan/[id]/page.tsx`](https://github.com/kevj-github/au-electronic/blob/main/src/app/(app)/pesanan/%5Bid%5D/page.tsx) (Order fulfillment), [`src/lib/supabase/server.ts`](https://github.com/kevj-github/au-electronic/blob/main/src/lib/supabase/server.ts) (Server client), [`src/lib/supabase/client.ts`](https://github.com/kevj-github/au-electronic/blob/main/src/lib/supabase/client.ts) (Browser client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflows["App workflows"]
  node_auth["Login / registration<br/>[page.tsx]"]
  node_app_shell["App shell<br/>[AppShell.tsx]"]
  node_customers["Customer management<br/>[page.tsx]"]
  node_customer_form["Customer form<br/>[PelangganForm.tsx]"]
  node_customer_actions["Customer actions<br/>[actions.ts]"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
end

subgraph group_orders["Orders and documents"]
  node_order_list["Order lists<br/>[OrderList.tsx]"]
  node_order_create["Order entry<br/>[OrderForm.tsx]"]
  node_order_actions["Order actions<br/>[actions.ts]"]
  node_order_detail["Order fulfillment<br/>[page.tsx]"]
  node_order_rows["Order row mapping<br/>[order-row.ts]"]
  node_invoice_data["Invoice data<br/>[invoice-data.ts]"]
  node_invoice_pdf["PDF invoice<br/>[DocumentPDF.tsx]"]
  node_receipt_print["ESC/P receipt<br/>[escp.ts]"]
  node_whatsapp["WhatsApp invoice<br/>[whatsapp.ts]"]
  node_payment["Payments<br/>[PaymentModal.tsx]"]
end

subgraph group_platform["Access and data"]
  node_supabase_client["Browser client<br/>[client.ts]"]
  node_supabase_server["Server client<br/>[server.ts]"]
  node_request_cache["Request auth / settings<br/>[request-cache.ts]"]
  node_database[("Supabase data store")]
  node_realtime["Realtime refresh"]
end

subgraph group_settings["Settings and integrations"]
  node_settings_page["Shop settings<br/>[page.tsx]"]
  node_settings_actions["Settings actions<br/>[actions.ts]"]
  node_printer_setting["Printer setup"]
  node_qz["QZ Tray<br/>[qz.ts]"]
end

node_user(("Owner / helper"))
node_printer["Epson printer"]

node_user -->|"signs in"| node_auth
node_auth -->|"authenticates with"| node_supabase_client
node_user -->|"manages customers"| node_customers
node_customers -->|"renders"| node_customer_form
node_customer_form -->|"submits changes"| node_customer_actions
node_user -->|"views metrics"| node_dashboard
node_dashboard -->|"queries"| node_supabase_server
node_dashboard -->|"maps orders"| node_order_rows
node_dashboard -->|"renders"| node_order_list
node_user -->|"creates orders"| node_order_create
node_order_create -->|"calls create action"| node_order_actions
node_order_actions -.->|"persists orders"| node_supabase_server
node_user -->|"fulfills orders"| node_order_detail
node_order_detail -->|"fetches order"| node_supabase_server
node_order_detail -->|"renders payment UI"| node_payment
node_user -->|"records payment"| node_payment
node_order_detail -->|"prepares invoice data"| node_invoice_data
node_invoice_pdf -->|"uses invoice data"| node_invoice_data
node_user -->|"exports invoice"| node_invoice_pdf
node_user -->|"shares invoice"| node_whatsapp
node_user -->|"prints receipt"| node_receipt_print
node_receipt_print -->|"prints ESC/P"| node_printer
node_user -->|"configures shop"| node_settings_page
node_settings_page -->|"uses settings actions"| node_settings_actions
node_printer_setting -->|"saves settings"| node_settings_actions
node_printer_setting -->|"configures printer"| node_qz
node_qz -->|"connects to"| node_printer
node_supabase_server -->|"reads / writes"| node_database
node_supabase_client -->|"accesses"| node_database
node_request_cache -->|"creates client"| node_supabase_server
node_order_detail -->|"checks user / lock"| node_request_cache
node_dashboard -->|"checks user"| node_request_cache
node_realtime -->|"subscribes via hook"| node_supabase_client

click node_auth "https://github.com/kevj-github/au-electronic/blob/main/src/app/(auth)/login/page.tsx"
click node_app_shell "https://github.com/kevj-github/au-electronic/blob/main/src/components/layout/AppShell.tsx"
click node_customers "https://github.com/kevj-github/au-electronic/blob/main/src/app/(app)/pelanggan/page.tsx"
click node_customer_form "https://github.com/kevj-github/au-electronic/blob/main/src/components/pelanggan/PelangganForm.tsx"
click node_customer_actions "https://github.com/kevj-github/au-electronic/blob/main/src/app/(app)/pelanggan/actions.ts"
click node_dashboard "https://github.com/kevj-github/au-electronic/blob/main/src/app/(app)/dashboard/page.tsx"
click node_order_list "https://github.com/kevj-github/au-electronic/blob/main/src/components/pesanan/OrderList.tsx"
click node_order_create "https://github.com/kevj-github/au-electronic/blob/main/src/components/pesanan/OrderForm.tsx"
click node_order_actions "https://github.com/kevj-github/au-electronic/blob/main/src/app/(app)/pesanan/actions.ts"
click node_order_detail "https://github.com/kevj-github/au-electronic/blob/main/src/app/(app)/pesanan/%5Bid%5D/page.tsx"
click node_order_rows "https://github.com/kevj-github/au-electronic/blob/main/src/components/pesanan/order-row.ts"
click node_invoice_data "https://github.com/kevj-github/au-electronic/blob/main/src/lib/invoice-data.ts"
click node_invoice_pdf "https://github.com/kevj-github/au-electronic/blob/main/src/components/invoice/DocumentPDF.tsx"
click node_receipt_print "https://github.com/kevj-github/au-electronic/blob/main/src/lib/escp.ts"
click node_whatsapp "https://github.com/kevj-github/au-electronic/blob/main/src/components/invoice/whatsapp.ts"
click node_payment "https://github.com/kevj-github/au-electronic/blob/main/src/components/pesanan/PaymentModal.tsx"
click node_settings_page "https://github.com/kevj-github/au-electronic/blob/main/src/app/(app)/pengaturan/page.tsx"
click node_settings_actions "https://github.com/kevj-github/au-electronic/blob/main/src/app/(app)/pengaturan/actions.ts"
click node_printer_setting "https://github.com/kevj-github/au-electronic/blob/main/src/components/pengaturan/EpsonPrinterSetting.tsx"
click node_qz "https://github.com/kevj-github/au-electronic/blob/main/src/lib/qz.ts"
click node_supabase_client "https://github.com/kevj-github/au-electronic/blob/main/src/lib/supabase/client.ts"
click node_supabase_server "https://github.com/kevj-github/au-electronic/blob/main/src/lib/supabase/server.ts"
click node_request_cache "https://github.com/kevj-github/au-electronic/blob/main/src/lib/supabase/request-cache.ts"
click node_realtime "https://github.com/kevj-github/au-electronic/blob/main/src/components/realtime/RealtimeRefresh.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_auth,node_app_shell,node_customers,node_customer_form,node_customer_actions,node_dashboard toneBlue
class node_order_list,node_order_create,node_order_actions,node_order_detail,node_order_rows,node_invoice_data,node_invoice_pdf,node_receipt_print,node_whatsapp,node_payment toneAmber
class node_supabase_client,node_supabase_server,node_request_cache,node_database,node_realtime toneMint
class node_settings_page,node_settings_actions,node_printer_setting,node_qz toneRose
class node_user,node_printer toneIndigo
```

## Components

### App workflows

- [Login / registration](https://github.com/kevj-github/au-electronic/blob/main/src/app/(auth)/login/page.tsx): `src/app/(auth)/login/page.tsx`
- [App shell](https://github.com/kevj-github/au-electronic/blob/main/src/components/layout/AppShell.tsx): `src/components/layout/AppShell.tsx`
- [Customer management](https://github.com/kevj-github/au-electronic/blob/main/src/app/(app)/pelanggan/page.tsx): `src/app/(app)/pelanggan/page.tsx`
- [Customer form](https://github.com/kevj-github/au-electronic/blob/main/src/components/pelanggan/PelangganForm.tsx): `src/components/pelanggan/PelangganForm.tsx`
- [Customer actions](https://github.com/kevj-github/au-electronic/blob/main/src/app/(app)/pelanggan/actions.ts): `src/app/(app)/pelanggan/actions.ts`
- [Dashboard](https://github.com/kevj-github/au-electronic/blob/main/src/app/(app)/dashboard/page.tsx): `src/app/(app)/dashboard/page.tsx`

### Orders and documents

- [Order lists](https://github.com/kevj-github/au-electronic/blob/main/src/components/pesanan/OrderList.tsx): `src/components/pesanan/OrderList.tsx`
- [Order entry](https://github.com/kevj-github/au-electronic/blob/main/src/components/pesanan/OrderForm.tsx): `src/components/pesanan/OrderForm.tsx`
- [Order actions](https://github.com/kevj-github/au-electronic/blob/main/src/app/(app)/pesanan/actions.ts): `src/app/(app)/pesanan/actions.ts`
- [Order fulfillment](https://github.com/kevj-github/au-electronic/blob/main/src/app/(app)/pesanan/%5Bid%5D/page.tsx): `src/app/(app)/pesanan/[id]/page.tsx`
- [Order row mapping](https://github.com/kevj-github/au-electronic/blob/main/src/components/pesanan/order-row.ts): `src/components/pesanan/order-row.ts`
- [Invoice data](https://github.com/kevj-github/au-electronic/blob/main/src/lib/invoice-data.ts): `src/lib/invoice-data.ts`
- [PDF invoice](https://github.com/kevj-github/au-electronic/blob/main/src/components/invoice/DocumentPDF.tsx): `src/components/invoice/DocumentPDF.tsx`
- [ESC/P receipt](https://github.com/kevj-github/au-electronic/blob/main/src/lib/escp.ts): `src/lib/escp.ts`
- [WhatsApp invoice](https://github.com/kevj-github/au-electronic/blob/main/src/components/invoice/whatsapp.ts): `src/components/invoice/whatsapp.ts`
- [Payments](https://github.com/kevj-github/au-electronic/blob/main/src/components/pesanan/PaymentModal.tsx): `src/components/pesanan/PaymentModal.tsx`

### Access and data

- [Browser client](https://github.com/kevj-github/au-electronic/blob/main/src/lib/supabase/client.ts): `src/lib/supabase/client.ts`
- [Server client](https://github.com/kevj-github/au-electronic/blob/main/src/lib/supabase/server.ts): `src/lib/supabase/server.ts`
- [Request auth / settings](https://github.com/kevj-github/au-electronic/blob/main/src/lib/supabase/request-cache.ts): `src/lib/supabase/request-cache.ts`
- **Supabase data store**
- [Realtime refresh](https://github.com/kevj-github/au-electronic/blob/main/src/components/realtime/RealtimeRefresh.tsx): `src/components/realtime/RealtimeRefresh.tsx`

### Settings and integrations

- [Shop settings](https://github.com/kevj-github/au-electronic/blob/main/src/app/(app)/pengaturan/page.tsx): `src/app/(app)/pengaturan/page.tsx`
- [Settings actions](https://github.com/kevj-github/au-electronic/blob/main/src/app/(app)/pengaturan/actions.ts): `src/app/(app)/pengaturan/actions.ts`
- [Printer setup](https://github.com/kevj-github/au-electronic/blob/main/src/components/pengaturan/EpsonPrinterSetting.tsx): `src/components/pengaturan/EpsonPrinterSetting.tsx`
- [QZ Tray](https://github.com/kevj-github/au-electronic/blob/main/src/lib/qz.ts): `src/lib/qz.ts`

### Other components

- **Owner / helper**
- **Epson printer**

## Connections

- Owner / helper → Login / registration: signs in (evidence: `README.md`)
- Login / registration → Browser client: authenticates with (evidence: `src/app/(auth)/login/page.tsx`)
- Owner / helper → Customer management: manages customers (evidence: `README.md`)
- Customer management → Customer form: renders (evidence: `src/app/(app)/pelanggan/page.tsx`)
- Customer form → Customer actions: submits changes (evidence: `src/components/pelanggan/PelangganForm.tsx`)
- Owner / helper → Dashboard: views metrics (evidence: `src/app/(app)/dashboard/page.tsx`)
- Dashboard → Server client: queries (evidence: `src/app/(app)/dashboard/page.tsx`)
- Dashboard → Order row mapping: maps orders (evidence: `src/app/(app)/dashboard/page.tsx`)
- Dashboard → Order lists: renders (evidence: `src/app/(app)/dashboard/page.tsx`)
- Owner / helper → Order entry: creates orders (evidence: `README.md`)
- Order entry → Order actions: calls create action (evidence: `src/components/pesanan/OrderForm.tsx`)
- Order actions → Server client: persists orders
- Owner / helper → Order fulfillment: fulfills orders (evidence: `README.md`)
- Order fulfillment → Server client: fetches order (evidence: `src/app/(app)/pesanan/[id]/page.tsx`)
- Order fulfillment → Payments: renders payment UI (evidence: `src/app/(app)/pesanan/[id]/page.tsx`)
- Owner / helper → Payments: records payment (evidence: `README.md`)
- Order fulfillment → Invoice data: prepares invoice data (evidence: `src/app/(app)/pesanan/[id]/page.tsx`)
- PDF invoice → Invoice data: uses invoice data (evidence: `src/components/invoice/DocumentPDF.tsx`)
- Owner / helper → PDF invoice: exports invoice (evidence: `README.md`)
- Owner / helper → WhatsApp invoice: shares invoice (evidence: `README.md`)
- Owner / helper → ESC/P receipt: prints receipt (evidence: `README.md`)
- ESC/P receipt → Epson printer: prints ESC/P (evidence: `README.md`)
- Owner / helper → Shop settings: configures shop (evidence: `README.md`)
- Shop settings → Settings actions: uses settings actions (evidence: `src/app/(app)/pengaturan/page.tsx`)
- Printer setup → Settings actions: saves settings (evidence: `src/components/pengaturan/EpsonPrinterSetting.tsx`)
- Printer setup → QZ Tray: configures printer (evidence: `src/components/pengaturan/EpsonPrinterSetting.tsx`)
- QZ Tray → Epson printer: connects to (evidence: `README.md`)
- Server client → Supabase data store: reads / writes (evidence: `src/lib/supabase/server.ts`)
- Browser client → Supabase data store: accesses (evidence: `src/lib/supabase/client.ts`)
- Request auth / settings → Server client: creates client (evidence: `src/lib/supabase/request-cache.ts`)
- Order fulfillment → Request auth / settings: checks user / lock (evidence: `src/app/(app)/pesanan/[id]/page.tsx`)
- Dashboard → Request auth / settings: checks user (evidence: `src/app/(app)/dashboard/page.tsx`)
- Realtime refresh → Browser client: subscribes via hook (evidence: `src/components/realtime/RealtimeRefresh.tsx`)
