# anthonyjoshuamalabanan-code/coffeeshots-public architecture

> Architecture diagram of the GitHub repository anthonyjoshuamalabanan-code/coffeeshots-public, 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/anthonyjoshuamalabanan-code/coffeeshots-public
- Repository: https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public

## Overview

Coffe Shot is a two-branch coffee-shop website with menu browsing, pickup and delivery checkout, staff order management, and PayMongo payments. Customers browse the menu, submit an order, and—if paying online—continue to PayMongo; staff sign in to manage order status and payment. The README documents the backend function roles and payment flow. Some frontend and function internals were not excerpted, so those documented connections are represented without claiming additional implementation details.

Main entry points: [`src/pages/MenuPage.jsx`](https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/pages/MenuPage.jsx) (Menu browsing), [`src/App.jsx`](https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/App.jsx) (Page routing), [`src/pages/AdminPage.jsx`](https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/pages/AdminPage.jsx) (Staff order board), [`src/lib/supabase.js`](https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/lib/supabase.js) (Supabase backend)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Website"]
  node_app["Page routing<br/>[App.jsx]"]
  node_home["Home content<br/>[HomePage.jsx]"]
  node_policies["Policy pages<br/>[PolicyLayout.jsx]"]
  node_branches["Branch details<br/>[branches.js]"]
end

subgraph group_ordering["Ordering"]
  node_menu_page["Menu browsing<br/>[MenuPage.jsx]"]
  node_menu_loader["Menu loading<br/>[useMenu.js]"]
  node_menu_data["Sample menu<br/>[menu.js]"]
  node_order_form["Cart and checkout<br/>[OrderPanel.jsx]"]
  node_order_client["Order and payment calls<br/>[orders.js]"]
  node_confirmation["Receipt display<br/>[ReceiptSlip.jsx]"]
end

subgraph group_staff["Staff operations"]
  node_admin["Staff order board<br/>[AdminPage.jsx]"]
  node_counter["Counter orders<br/>[CounterOrder.jsx]"]
  node_export["Order export<br/>[OrderExport.jsx]"]
end

subgraph group_backend["Backend and payments"]
  node_staff_auth["Staff account function<br/>[index.ts]"]
  node_place_order["Order placement function<br/>[index.ts]"]
  node_checkout["PayMongo checkout function<br/>[index.ts]"]
  node_webhook["Payment webhook<br/>[index.ts]"]
  node_supabase[("Supabase backend<br/>[supabase.js]")]
end

node_customer(("Customer"))
node_staff_user(("Staff member"))
node_paymongo["PayMongo"]

node_customer -->|"opens site"| node_app
node_app -->|"routes to"| node_menu_page
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_policies
node_policies -->|"shows contacts"| node_branches
node_menu_page -->|"loads menu"| node_menu_loader
node_menu_loader -->|"reads menu"| node_supabase
node_menu_loader -->|"uses fallback"| node_menu_data
node_menu_page -->|"renders checkout"| node_order_form
node_order_form -->|"submits details"| node_menu_page
node_menu_page -->|"submits order"| node_order_client
node_order_client -.->|"places order"| node_place_order
node_place_order -.->|"saves order"| node_supabase
node_menu_page -.->|"starts payment"| node_checkout
node_checkout -->|"creates checkout"| node_paymongo
node_paymongo -->|"sends paid event"| node_webhook
node_webhook -->|"confirms payment"| node_paymongo
node_webhook -->|"marks paid"| node_supabase
node_menu_page -->|"shows receipt"| node_confirmation
node_staff_user -->|"opens admin"| node_app
node_app -->|"routes to"| node_admin
node_admin -->|"invokes login"| node_staff_auth
node_admin -->|"renders counter orders"| node_counter
node_admin -->|"renders export"| node_export
node_admin -.->|"manages orders"| node_supabase

click node_app "https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/App.jsx"
click node_home "https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/pages/HomePage.jsx"
click node_policies "https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/components/PolicyLayout.jsx"
click node_branches "https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/data/branches.js"
click node_menu_page "https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/pages/MenuPage.jsx"
click node_menu_loader "https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/lib/useMenu.js"
click node_menu_data "https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/data/menu.js"
click node_order_form "https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/components/OrderPanel.jsx"
click node_order_client "https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/lib/orders.js"
click node_confirmation "https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/components/ReceiptSlip.jsx"
click node_admin "https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/pages/AdminPage.jsx"
click node_counter "https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/components/CounterOrder.jsx"
click node_export "https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/components/OrderExport.jsx"
click node_staff_auth "https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/supabase/functions/staff-account/index.ts"
click node_place_order "https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/supabase/functions/place-order/index.ts"
click node_checkout "https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/supabase/functions/paymongo-checkout/index.ts"
click node_webhook "https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/supabase/functions/paymongo-webhook/index.ts"
click node_supabase "https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/lib/supabase.js"

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_app,node_home,node_policies,node_branches toneBlue
class node_menu_page,node_menu_loader,node_menu_data,node_order_form,node_order_client,node_confirmation toneAmber
class node_admin,node_counter,node_export toneMint
class node_staff_auth,node_place_order,node_checkout,node_webhook,node_supabase toneRose
class node_customer,node_staff_user,node_paymongo toneIndigo
```

## Components

### Website

- [Page routing](https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/App.jsx): `src/App.jsx`
- [Home content](https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/pages/HomePage.jsx): `src/pages/HomePage.jsx`
- [Policy pages](https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/components/PolicyLayout.jsx): `src/components/PolicyLayout.jsx`
- [Branch details](https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/data/branches.js): `src/data/branches.js`

### Ordering

- [Menu browsing](https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/pages/MenuPage.jsx): `src/pages/MenuPage.jsx`
- [Menu loading](https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/lib/useMenu.js): `src/lib/useMenu.js`
- [Sample menu](https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/data/menu.js): `src/data/menu.js`
- [Cart and checkout](https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/components/OrderPanel.jsx): `src/components/OrderPanel.jsx`
- [Order and payment calls](https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/lib/orders.js): `src/lib/orders.js`
- [Receipt display](https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/components/ReceiptSlip.jsx): `src/components/ReceiptSlip.jsx`

### Staff operations

- [Staff order board](https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/pages/AdminPage.jsx): `src/pages/AdminPage.jsx`
- [Counter orders](https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/components/CounterOrder.jsx): `src/components/CounterOrder.jsx`
- [Order export](https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/components/OrderExport.jsx): `src/components/OrderExport.jsx`

### Backend and payments

- [Staff account function](https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/supabase/functions/staff-account/index.ts): `supabase/functions/staff-account/index.ts`
- [Order placement function](https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/supabase/functions/place-order/index.ts): `supabase/functions/place-order/index.ts`
- [PayMongo checkout function](https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/supabase/functions/paymongo-checkout/index.ts): `supabase/functions/paymongo-checkout/index.ts`
- [Payment webhook](https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/supabase/functions/paymongo-webhook/index.ts): `supabase/functions/paymongo-webhook/index.ts`
- [Supabase backend](https://github.com/anthonyjoshuamalabanan-code/coffeeshots-public/blob/main/src/lib/supabase.js): `src/lib/supabase.js`

### Other components

- **Customer**
- **Staff member**
- **PayMongo**

## Connections

- Customer → Page routing: opens site
- Page routing → Menu browsing: routes to (evidence: `src/App.jsx`)
- Page routing → Home content: routes to (evidence: `src/App.jsx`)
- Page routing → Policy pages: routes to (evidence: `src/App.jsx`)
- Policy pages → Branch details: shows contacts (evidence: `src/components/PolicyLayout.jsx`)
- Menu browsing → Menu loading: loads menu (evidence: `src/pages/MenuPage.jsx`)
- Menu loading → Supabase backend: reads menu (evidence: `src/lib/useMenu.js`)
- Menu loading → Sample menu: uses fallback (evidence: `src/lib/useMenu.js`)
- Menu browsing → Cart and checkout: renders checkout (evidence: `src/pages/MenuPage.jsx`)
- Cart and checkout → Menu browsing: submits details (evidence: `src/components/OrderPanel.jsx`)
- Menu browsing → Order and payment calls: submits order (evidence: `src/pages/MenuPage.jsx`)
- Order and payment calls → Order placement function: places order
- Order placement function → Supabase backend: saves order
- Menu browsing → PayMongo checkout function: starts payment
- PayMongo checkout function → PayMongo: creates checkout
- PayMongo → Payment webhook: sends paid event
- Payment webhook → PayMongo: confirms payment
- Payment webhook → Supabase backend: marks paid
- Menu browsing → Receipt display: shows receipt (evidence: `src/pages/MenuPage.jsx`)
- Staff member → Page routing: opens admin
- Page routing → Staff order board: routes to (evidence: `src/App.jsx`)
- Staff order board → Staff account function: invokes login (evidence: `src/pages/AdminPage.jsx`)
- Staff order board → Counter orders: renders counter orders (evidence: `src/pages/AdminPage.jsx`)
- Staff order board → Order export: renders export (evidence: `src/pages/AdminPage.jsx`)
- Staff order board → Supabase backend: manages orders (evidence: `src/pages/AdminPage.jsx`)
