# bryancheng33-oss/skibidigofood architecture

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

- Interactive diagram: https://gitdiagram.com/bryancheng33-oss/skibidigofood
- Repository: https://github.com/bryancheng33-oss/skibidigofood

## Overview

Skibidi GoFood is a campus food-ordering web app for MMU students and staff. Its principal workflow is browsing the menu, adding items to a cart, completing checkout, and tracking orders; accounts, wallet, points, rewards, and an AI help assistant are additional capabilities. The graph includes sampled UI-to-state calls and documented product stages. Many page modules were not shown in source excerpts, so their internal calls and some integrations are intentionally left unconnected.

Main entry points: [`api/sgf-ai.js`](https://github.com/bryancheng33-oss/skibidigofood/blob/main/api/sgf-ai.js) (AI proxy), [`js/state.js`](https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/state.js) (Application state), [`js/pages/menu-inline.js`](https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/pages/menu-inline.js) (Menu browsing), [`orders_inline.js`](https://github.com/bryancheng33-oss/skibidigofood/blob/main/orders_inline.js) (Order history)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ordering["Ordering"]
  node_menu["Menu browsing<br/>[menu-inline.js]"]
  node_catalog["Product catalog<br/>[products.js]"]
  node_cart["Cart<br/>[cart.js]"]
  node_checkout["Checkout<br/>[checkout-inline.js]"]
  node_orders["Order history<br/>[orders_inline.js]"]
  node_admin["Order administration<br/>[admin.js]"]
end

subgraph group_accounts["Accounts"]
  node_auth["Registration &amp; login<br/>[auth.js]"]
  node_profile["Profile<br/>[profile-inline.js]"]
  node_dashboard["Dashboard"]
end

subgraph group_engagement["Rewards &amp; Wallet"]
  node_rewards["Rewards &amp; spins<br/>[rewards-inline.js]"]
  node_rewards_logic["Rewards rules<br/>[rewards.js]"]
  node_wallet["Wallet<br/>[wallet.js]"]
end

subgraph group_platform["State &amp; Backend"]
  node_state["Application state<br/>[state.js]"]
  node_data["Menu and app data<br/>[data.js]"]
  node_sync["Supabase synchronization<br/>[supabase-sync.js]"]
end

subgraph group_assistant["AI Assistant"]
  node_ai_ui["AI chat interface<br/>[student-ai-chat.js]"]
  node_ai_page["AI chat page handler<br/>[student-ai-chat.js]"]
  node_ai_proxy["AI proxy<br/>[sgf-ai.js]"]
  node_netlify_proxy["Netlify AI proxy<br/>[sgf-ai.js]"]
end

node_student(("Student or staff"))
node_groq["Groq API"]
node_supabase[("Supabase")]

node_student -->|"registers or signs in"| node_auth
node_student -->|"browses food"| node_menu
node_student -->|"places order"| node_checkout
node_student -->|"tracks orders"| node_orders
node_student -->|"manages account"| node_profile
node_student -->|"redeems points"| node_rewards
node_menu -->|"adds items"| node_state
node_orders -->|"updates cart and reviews"| node_state
node_rewards -->|"updates points"| node_state
node_cart -->|"continues to checkout"| node_checkout
node_ai_ui -.->|"requests assistance"| node_ai_proxy
node_ai_page -.->|"requests assistance"| node_ai_proxy
node_ai_proxy -->|"sends chat request"| node_groq
node_netlify_proxy -->|"sends chat request"| node_groq
node_sync -.->|"synchronizes data"| node_supabase

click node_auth "https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/auth.js"
click node_menu "https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/pages/menu-inline.js"
click node_catalog "https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/products.js"
click node_cart "https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/cart.js"
click node_checkout "https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/pages/checkout-inline.js"
click node_orders "https://github.com/bryancheng33-oss/skibidigofood/blob/main/orders_inline.js"
click node_admin "https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/admin.js"
click node_profile "https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/pages/profile-inline.js"
click node_dashboard "https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/pages/dashboard-inline.js"
click node_rewards "https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/pages/rewards-inline.js"
click node_rewards_logic "https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/rewards.js"
click node_wallet "https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/wallet.js"
click node_state "https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/state.js"
click node_data "https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/data.js"
click node_sync "https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/supabase-sync.js"
click node_ai_ui "https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/student-ai-chat.js"
click node_ai_page "https://github.com/bryancheng33-oss/skibidigofood/blob/main/api/student-ai-chat.js"
click node_ai_proxy "https://github.com/bryancheng33-oss/skibidigofood/blob/main/api/sgf-ai.js"
click node_netlify_proxy "https://github.com/bryancheng33-oss/skibidigofood/blob/main/netlify/functions/sgf-ai.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_menu,node_catalog,node_cart,node_checkout,node_orders,node_admin toneBlue
class node_auth,node_profile,node_dashboard,node_supabase toneAmber
class node_rewards,node_rewards_logic,node_wallet,node_groq toneMint
class node_state,node_data,node_sync toneRose
class node_ai_ui,node_ai_page,node_ai_proxy,node_netlify_proxy,node_student toneIndigo
```

## Components

### Ordering

- [Menu browsing](https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/pages/menu-inline.js): `js/pages/menu-inline.js`
- [Product catalog](https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/products.js): `js/products.js`
- [Cart](https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/cart.js): `js/cart.js`
- [Checkout](https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/pages/checkout-inline.js): `js/pages/checkout-inline.js`
- [Order history](https://github.com/bryancheng33-oss/skibidigofood/blob/main/orders_inline.js): `orders_inline.js`
- [Order administration](https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/admin.js): `js/admin.js`

### Accounts

- [Registration & login](https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/auth.js): `js/auth.js`
- [Profile](https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/pages/profile-inline.js): `js/pages/profile-inline.js`
- [Dashboard](https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/pages/dashboard-inline.js): `js/pages/dashboard-inline.js`

### Rewards & Wallet

- [Rewards & spins](https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/pages/rewards-inline.js): `js/pages/rewards-inline.js`
- [Rewards rules](https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/rewards.js): `js/rewards.js`
- [Wallet](https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/wallet.js): `js/wallet.js`

### State & Backend

- [Application state](https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/state.js): `js/state.js`
- [Menu and app data](https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/data.js): `js/data.js`
- [Supabase synchronization](https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/supabase-sync.js): `js/supabase-sync.js`

### AI Assistant

- [AI chat interface](https://github.com/bryancheng33-oss/skibidigofood/blob/main/js/student-ai-chat.js): `js/student-ai-chat.js`
- [AI chat page handler](https://github.com/bryancheng33-oss/skibidigofood/blob/main/api/student-ai-chat.js): `api/student-ai-chat.js`
- [AI proxy](https://github.com/bryancheng33-oss/skibidigofood/blob/main/api/sgf-ai.js): `api/sgf-ai.js`
- [Netlify AI proxy](https://github.com/bryancheng33-oss/skibidigofood/blob/main/netlify/functions/sgf-ai.js): `netlify/functions/sgf-ai.js`

### Other components

- **Student or staff**
- **Groq API**
- **Supabase**

## Connections

- Student or staff → Registration & login: registers or signs in
- Student or staff → Menu browsing: browses food
- Student or staff → Checkout: places order
- Student or staff → Order history: tracks orders
- Student or staff → Profile: manages account
- Student or staff → Rewards & spins: redeems points
- Menu browsing → Application state: adds items (evidence: `js/pages/menu-inline.js`)
- Order history → Application state: updates cart and reviews (evidence: `orders_inline.js`)
- Rewards & spins → Application state: updates points (evidence: `js/pages/rewards-inline.js`)
- Cart → Checkout: continues to checkout
- AI chat interface → AI proxy: requests assistance
- AI chat page handler → AI proxy: requests assistance
- AI proxy → Groq API: sends chat request (evidence: `api/sgf-ai.js`)
- Netlify AI proxy → Groq API: sends chat request (evidence: `netlify/functions/sgf-ai.js`)
- Supabase synchronization → Supabase: synchronizes data
