# ftzarqa/madjoe-kopi architecture

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

- Interactive diagram: https://gitdiagram.com/ftzarqa/madjoe-kopi
- Repository: https://github.com/ftzarqa/madjoe-kopi

## Overview

Madjoe Kopi is a take-away café ordering web app. Customers browse the catalog, add items to a persistent cart, submit checkout details, and use an in-app payment flow; orders are stored and payment status can be updated by Midtrans notifications. Staff also have a kitchen order page, while story, location, and login pages provide supporting site capabilities. The graph includes documented and indexed relationships; the kitchen page’s connections are not visible in the sampled excerpts, so no specific data flow is asserted for it.

Main entry points: [`src/app/api/pesanan/route.ts`](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/app/api/pesanan/route.ts) (Order API), [`src/lib/supabase.ts`](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/lib/supabase.ts) (Supabase Admin), [`src/app/page.tsx`](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/app/page.tsx) (Home), [`src/components/AppShell.tsx`](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/components/AppShell.tsx) (App Shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront &amp; Catalog"]
  node_home["Home<br/>[page.tsx]"]
  node_menu["Menu Catalog<br/>[page.tsx]"]
  node_menu_data["Menu Data<br/>[menu.ts]"]
  node_menu_card["Menu Card<br/>[MenuCard.tsx]"]
end

subgraph group_ordering["Cart &amp; Checkout"]
  node_cart_state["Cart State<br/>[CartContext.tsx]"]
  node_cart_sidebar["Cart Sidebar<br/>[CartSidebar.tsx]"]
  node_cart_item["Cart Item<br/>[CartItem.tsx]"]
  node_checkout["Checkout Form<br/>[CheckoutForm.tsx]"]
  node_app_shell["App Shell<br/>[AppShell.tsx]"]
end

subgraph group_orders["Orders &amp; Payments"]
  node_payment_modal["Payment Modal<br/>[PaymentModal.tsx]"]
  node_order_api["Order API<br/>[route.ts]"]
  node_midtrans_client["Midtrans Client<br/>[midtrans.ts]"]
  node_payment_webhook["Payment Webhook<br/>[route.ts]"]
  node_order_status["Order Status API<br/>[route.ts]"]
  node_supabase_admin["Supabase Admin<br/>[supabase.ts]"]
  node_orders_db[("Orders Store")]
end

subgraph group_site["Site &amp; Staff"]
  node_kitchen["Kitchen Dashboard<br/>[page.tsx]"]
  node_login["Login Page<br/>[page.tsx]"]
  node_supabase_browser["Browser Auth Client<br/>[client.ts]"]
  node_stories["Stories Page<br/>[page.tsx]"]
  node_location["Location Page<br/>[page.tsx]"]
  node_layout["Root Layout<br/>[layout.tsx]"]
end

node_customer(("Customer"))
node_midtrans["Midtrans"]
node_visitor(("Visitor"))

node_customer -->|"browses"| node_home
node_customer -->|"browses"| node_menu
node_home -->|"reads"| node_menu_data
node_menu -->|"reads"| node_menu_data
node_menu -->|"renders"| node_menu_card
node_home -->|"renders"| node_menu_card
node_menu_card -.->|"adds items"| node_cart_state
node_home -->|"opens cart"| node_cart_state
node_layout -->|"renders"| node_app_shell
node_app_shell -->|"provides state"| node_cart_state
node_app_shell -->|"renders"| node_cart_sidebar
node_app_shell -->|"renders"| node_payment_modal
node_cart_sidebar -->|"renders"| node_cart_item
node_cart_sidebar -->|"renders"| node_checkout
node_cart_state -.->|"supplies cart"| node_cart_sidebar
node_customer -->|"submits details"| node_checkout
node_payment_modal -->|"creates order"| node_order_api
node_order_api -->|"validates prices"| node_menu_data
node_order_api -->|"charges QRIS"| node_midtrans_client
node_midtrans_client -.->|"requests charge"| node_midtrans
node_order_api -->|"writes order"| node_supabase_admin
node_order_api -->|"reads orders"| node_supabase_admin
node_payment_webhook -->|"updates payment"| node_supabase_admin
node_order_status -->|"reads status"| node_supabase_admin
node_supabase_admin -->|"accesses orders"| node_orders_db
node_midtrans -->|"sends notification"| node_payment_webhook
node_kitchen -.->|"order access"| node_order_api
node_login -->|"creates client"| node_supabase_browser
node_visitor -->|"reads"| node_stories
node_visitor -->|"checks location"| node_location

click node_home "https://github.com/ftzarqa/madjoe-kopi/blob/main/src/app/page.tsx"
click node_menu "https://github.com/ftzarqa/madjoe-kopi/blob/main/src/app/menu/page.tsx"
click node_menu_data "https://github.com/ftzarqa/madjoe-kopi/blob/main/src/data/menu.ts"
click node_menu_card "https://github.com/ftzarqa/madjoe-kopi/blob/main/src/components/MenuCard.tsx"
click node_cart_state "https://github.com/ftzarqa/madjoe-kopi/blob/main/src/context/CartContext.tsx"
click node_cart_sidebar "https://github.com/ftzarqa/madjoe-kopi/blob/main/src/components/CartSidebar.tsx"
click node_cart_item "https://github.com/ftzarqa/madjoe-kopi/blob/main/src/components/CartItem.tsx"
click node_checkout "https://github.com/ftzarqa/madjoe-kopi/blob/main/src/components/CheckoutForm.tsx"
click node_app_shell "https://github.com/ftzarqa/madjoe-kopi/blob/main/src/components/AppShell.tsx"
click node_payment_modal "https://github.com/ftzarqa/madjoe-kopi/blob/main/src/components/PaymentModal.tsx"
click node_order_api "https://github.com/ftzarqa/madjoe-kopi/blob/main/src/app/api/pesanan/route.ts"
click node_midtrans_client "https://github.com/ftzarqa/madjoe-kopi/blob/main/src/lib/midtrans.ts"
click node_payment_webhook "https://github.com/ftzarqa/madjoe-kopi/blob/main/src/app/api/payment/webhook/route.ts"
click node_order_status "https://github.com/ftzarqa/madjoe-kopi/blob/main/src/app/api/pesanan/status/route.ts"
click node_supabase_admin "https://github.com/ftzarqa/madjoe-kopi/blob/main/src/lib/supabase.ts"
click node_kitchen "https://github.com/ftzarqa/madjoe-kopi/blob/main/src/app/dapur/page.tsx"
click node_login "https://github.com/ftzarqa/madjoe-kopi/blob/main/src/app/login/page.tsx"
click node_supabase_browser "https://github.com/ftzarqa/madjoe-kopi/blob/main/src/lib/supabase/client.ts"
click node_stories "https://github.com/ftzarqa/madjoe-kopi/blob/main/src/app/cerita/page.tsx"
click node_location "https://github.com/ftzarqa/madjoe-kopi/blob/main/src/app/lokasi/page.tsx"
click node_layout "https://github.com/ftzarqa/madjoe-kopi/blob/main/src/app/layout.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_home,node_menu,node_menu_data,node_menu_card toneBlue
class node_cart_state,node_cart_sidebar,node_cart_item,node_checkout,node_app_shell toneAmber
class node_payment_modal,node_order_api,node_midtrans_client,node_payment_webhook,node_order_status,node_supabase_admin,node_orders_db toneMint
class node_kitchen,node_login,node_supabase_browser,node_stories,node_location,node_layout toneRose
class node_customer,node_midtrans,node_visitor toneIndigo
```

## Components

### Storefront & Catalog

- [Home](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Menu Catalog](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/app/menu/page.tsx): `src/app/menu/page.tsx`
- [Menu Data](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/data/menu.ts): `src/data/menu.ts`
- [Menu Card](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/components/MenuCard.tsx): `src/components/MenuCard.tsx`

### Cart & Checkout

- [Cart State](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/context/CartContext.tsx): `src/context/CartContext.tsx`
- [Cart Sidebar](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/components/CartSidebar.tsx): `src/components/CartSidebar.tsx`
- [Cart Item](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/components/CartItem.tsx): `src/components/CartItem.tsx`
- [Checkout Form](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/components/CheckoutForm.tsx): `src/components/CheckoutForm.tsx`
- [App Shell](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/components/AppShell.tsx): `src/components/AppShell.tsx`

### Orders & Payments

- [Payment Modal](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/components/PaymentModal.tsx): `src/components/PaymentModal.tsx`
- [Order API](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/app/api/pesanan/route.ts): `src/app/api/pesanan/route.ts`
- [Midtrans Client](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/lib/midtrans.ts): `src/lib/midtrans.ts`
- [Payment Webhook](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/app/api/payment/webhook/route.ts): `src/app/api/payment/webhook/route.ts`
- [Order Status API](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/app/api/pesanan/status/route.ts): `src/app/api/pesanan/status/route.ts`
- [Supabase Admin](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- **Orders Store**

### Site & Staff

- [Kitchen Dashboard](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/app/dapur/page.tsx): `src/app/dapur/page.tsx`
- [Login Page](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/app/login/page.tsx): `src/app/login/page.tsx`
- [Browser Auth Client](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/lib/supabase/client.ts): `src/lib/supabase/client.ts`
- [Stories Page](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/app/cerita/page.tsx): `src/app/cerita/page.tsx`
- [Location Page](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/app/lokasi/page.tsx): `src/app/lokasi/page.tsx`
- [Root Layout](https://github.com/ftzarqa/madjoe-kopi/blob/main/src/app/layout.tsx): `src/app/layout.tsx`

### Other components

- **Customer**
- **Midtrans**
- **Visitor**

## Connections

- Customer → Home: browses (evidence: `README.md`)
- Customer → Menu Catalog: browses (evidence: `README.md`)
- Home → Menu Data: reads (evidence: `src/app/page.tsx`)
- Menu Catalog → Menu Data: reads (evidence: `src/app/menu/page.tsx`)
- Menu Catalog → Menu Card: renders (evidence: `src/app/menu/page.tsx`)
- Home → Menu Card: renders (evidence: `src/app/page.tsx`)
- Menu Card → Cart State: adds items
- Home → Cart State: opens cart (evidence: `src/app/page.tsx`)
- Root Layout → App Shell: renders (evidence: `src/app/layout.tsx`)
- App Shell → Cart State: provides state (evidence: `src/components/AppShell.tsx`)
- App Shell → Cart Sidebar: renders (evidence: `src/components/AppShell.tsx`)
- App Shell → Payment Modal: renders (evidence: `src/components/AppShell.tsx`)
- Cart Sidebar → Cart Item: renders (evidence: `src/components/CartSidebar.tsx`)
- Cart Sidebar → Checkout Form: renders (evidence: `src/components/CartSidebar.tsx`)
- Cart State → Cart Sidebar: supplies cart
- Customer → Checkout Form: submits details (evidence: `README.md`)
- Payment Modal → Order API: creates order (evidence: `src/components/PaymentModal.tsx`)
- Order API → Menu Data: validates prices (evidence: `src/app/api/pesanan/route.ts`)
- Order API → Midtrans Client: charges QRIS (evidence: `src/app/api/pesanan/route.ts`)
- Midtrans Client → Midtrans: requests charge
- Order API → Supabase Admin: writes order (evidence: `src/app/api/pesanan/route.ts`)
- Order API → Supabase Admin: reads orders (evidence: `src/app/api/pesanan/route.ts`)
- Payment Webhook → Supabase Admin: updates payment (evidence: `src/app/api/payment/webhook/route.ts`)
- Order Status API → Supabase Admin: reads status (evidence: `src/app/api/pesanan/status/route.ts`)
- Supabase Admin → Orders Store: accesses orders
- Midtrans → Payment Webhook: sends notification (evidence: `src/app/api/payment/webhook/route.ts`)
- Kitchen Dashboard → Order API: order access
- Login Page → Browser Auth Client: creates client (evidence: `src/app/login/page.tsx`)
- Visitor → Stories Page: reads (evidence: `README.md`)
- Visitor → Location Page: checks location (evidence: `README.md`)
