# murgwell/midterms-practical architecture

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

- Interactive diagram: https://gitdiagram.com/murgwell/midterms-practical
- Repository: https://github.com/murgwell/midterms-practical

## Overview

Sarap Kitchen is a React front-end for browsing Filipino dishes and placing an order; the README describes routing, state, and filtering as client-side. Users browse or filter the menu, add dishes to a cart, submit delivery and payment details, then view an order confirmation. Cart state is persisted in browser local storage, while orders exist only in the current session. The graph includes documented menu, theme, and ordering capabilities; unsampled page behavior is represented only where the source index or README supports it.

Main entry points: [`src/App.jsx`](https://github.com/murgwell/midterms-practical/blob/main/src/App.jsx) (App routes), [`src/pages/MenuPage.jsx`](https://github.com/murgwell/midterms-practical/blob/main/src/pages/MenuPage.jsx) (Filtered menu), [`src/context/CartContext.jsx`](https://github.com/murgwell/midterms-practical/blob/main/src/context/CartContext.jsx) (Cart provider), [`src/data/menuItems.js`](https://github.com/murgwell/midterms-practical/blob/main/src/data/menuItems.js) (Menu items)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Storefront experience"]
  node_app["App routes<br/>[App.jsx]"]
  node_home["Home page<br/>[HomePage.jsx]"]
  node_menu["Filtered menu<br/>[MenuPage.jsx]"]
  node_fullmenu["Grouped menu<br/>[FullMenuPage.jsx]"]
  node_dish["Dish details<br/>[DishDetailPage.jsx]"]
  node_card["Dish card<br/>[MenuItemCard.jsx]"]
  node_theme["Theme state<br/>[ThemeContext.jsx]"]
  node_themetoggle["Theme hook<br/>[useTheme.js]"]
end

subgraph group_catalog["Menu catalog"]
  node_menuitems[("Menu items<br/>[menuItems.js]")]
  node_categories[("Categories<br/>[categories.js]")]
  node_content[("Site content<br/>[content.js]")]
end

subgraph group_ordering["Cart and orders"]
  node_cartpage["Cart review<br/>[CartPage.jsx]"]
  node_checkout["Checkout<br/>[CheckoutPage.jsx]"]
  node_confirmation["Order confirmation"]
  node_cartstate["Cart provider<br/>[CartContext.jsx]"]
  node_cartapi["Cart hook<br/>[useCart.js]"]
end

subgraph group_domain["Domain and state"]
  node_menuitemmodel["Menu item model<br/>[MenuItem.js]"]
  node_money["Money utilities<br/>[Money.js]"]
  node_cartmodel["Cart model<br/>[Cart.js]"]
  node_cartline["Cart line model<br/>[CartLine.js]"]
  node_customer["Customer model<br/>[Customer.js]"]
  node_ordermodel["Order model<br/>[Order.js]"]
end

node_user(("Customer"))
node_browserstorage[("Browser local storage")]

node_user -.->|"uses"| node_app
node_app -->|"routes"| node_home
node_app -->|"routes"| node_menu
node_app -->|"routes"| node_fullmenu
node_app -->|"routes"| node_dish
node_app -->|"routes"| node_cartpage
node_app -->|"routes"| node_checkout
node_app -->|"routes"| node_confirmation
node_menu -->|"filters and sorts"| node_menuitems
node_menu -->|"filters by"| node_categories
node_fullmenu -->|"groups items"| node_menuitems
node_fullmenu -->|"groups by"| node_categories
node_home -->|"displays"| node_menuitems
node_home -->|"displays"| node_categories
node_menu -->|"renders"| node_card
node_fullmenu -->|"renders"| node_card
node_dish -->|"looks up dish"| node_menuitems
node_menuitems -->|"creates items"| node_menuitemmodel
node_categories -.->|"uses labels"| node_content
node_menu -->|"reads labels"| node_content
node_home -->|"reads content"| node_content
node_cartpage -->|"reads cart"| node_cartapi
node_checkout -->|"places order through"| node_cartapi
node_confirmation -->|"reads order"| node_cartapi
node_cartapi -->|"reads context"| node_cartstate
node_cartstate -->|"persists cart"| node_browserstorage
node_cartstate -->|"updates cart"| node_cartmodel
node_cartstate -->|"creates customer"| node_customer
node_cartstate -->|"creates order"| node_ordermodel
node_cartmodel -->|"uses lines"| node_cartline
node_cartmodel -->|"uses menu items"| node_menuitemmodel
node_cartmodel -->|"uses currency"| node_money
node_cartline -->|"uses currency"| node_money
node_ordermodel -->|"uses currency"| node_money
node_theme -.->|"exposes theme"| node_themetoggle

click node_app "https://github.com/murgwell/midterms-practical/blob/main/src/App.jsx"
click node_home "https://github.com/murgwell/midterms-practical/blob/main/src/pages/HomePage.jsx"
click node_menu "https://github.com/murgwell/midterms-practical/blob/main/src/pages/MenuPage.jsx"
click node_fullmenu "https://github.com/murgwell/midterms-practical/blob/main/src/pages/FullMenuPage.jsx"
click node_dish "https://github.com/murgwell/midterms-practical/blob/main/src/pages/DishDetailPage.jsx"
click node_cartpage "https://github.com/murgwell/midterms-practical/blob/main/src/pages/CartPage.jsx"
click node_checkout "https://github.com/murgwell/midterms-practical/blob/main/src/pages/CheckoutPage.jsx"
click node_confirmation "https://github.com/murgwell/midterms-practical/blob/main/src/pages/OrderConfirmationPage.jsx"
click node_card "https://github.com/murgwell/midterms-practical/blob/main/src/components/MenuItemCard.jsx"
click node_cartstate "https://github.com/murgwell/midterms-practical/blob/main/src/context/CartContext.jsx"
click node_cartapi "https://github.com/murgwell/midterms-practical/blob/main/src/hooks/useCart.js"
click node_menuitems "https://github.com/murgwell/midterms-practical/blob/main/src/data/menuItems.js"
click node_categories "https://github.com/murgwell/midterms-practical/blob/main/src/data/categories.js"
click node_content "https://github.com/murgwell/midterms-practical/blob/main/src/data/content.js"
click node_menuitemmodel "https://github.com/murgwell/midterms-practical/blob/main/src/models/MenuItem.js"
click node_money "https://github.com/murgwell/midterms-practical/blob/main/src/models/Money.js"
click node_cartmodel "https://github.com/murgwell/midterms-practical/blob/main/src/models/Cart.js"
click node_cartline "https://github.com/murgwell/midterms-practical/blob/main/src/models/CartLine.js"
click node_customer "https://github.com/murgwell/midterms-practical/blob/main/src/models/Customer.js"
click node_ordermodel "https://github.com/murgwell/midterms-practical/blob/main/src/models/Order.js"
click node_theme "https://github.com/murgwell/midterms-practical/blob/main/src/context/ThemeContext.jsx"
click node_themetoggle "https://github.com/murgwell/midterms-practical/blob/main/src/hooks/useTheme.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_menu,node_fullmenu,node_dish,node_card,node_theme,node_themetoggle toneBlue
class node_menuitems,node_categories,node_content,node_browserstorage toneAmber
class node_cartpage,node_checkout,node_confirmation,node_cartstate,node_cartapi toneMint
class node_menuitemmodel,node_money,node_cartmodel,node_cartline,node_customer,node_ordermodel toneRose
class node_user toneIndigo
```

## Components

### Storefront experience

- [App routes](https://github.com/murgwell/midterms-practical/blob/main/src/App.jsx): `src/App.jsx`
- [Home page](https://github.com/murgwell/midterms-practical/blob/main/src/pages/HomePage.jsx): `src/pages/HomePage.jsx`
- [Filtered menu](https://github.com/murgwell/midterms-practical/blob/main/src/pages/MenuPage.jsx): `src/pages/MenuPage.jsx`
- [Grouped menu](https://github.com/murgwell/midterms-practical/blob/main/src/pages/FullMenuPage.jsx): `src/pages/FullMenuPage.jsx`
- [Dish details](https://github.com/murgwell/midterms-practical/blob/main/src/pages/DishDetailPage.jsx): `src/pages/DishDetailPage.jsx`
- [Dish card](https://github.com/murgwell/midterms-practical/blob/main/src/components/MenuItemCard.jsx): `src/components/MenuItemCard.jsx`
- [Theme state](https://github.com/murgwell/midterms-practical/blob/main/src/context/ThemeContext.jsx): `src/context/ThemeContext.jsx`
- [Theme hook](https://github.com/murgwell/midterms-practical/blob/main/src/hooks/useTheme.js): `src/hooks/useTheme.js`

### Menu catalog

- [Menu items](https://github.com/murgwell/midterms-practical/blob/main/src/data/menuItems.js): `src/data/menuItems.js`
- [Categories](https://github.com/murgwell/midterms-practical/blob/main/src/data/categories.js): `src/data/categories.js`
- [Site content](https://github.com/murgwell/midterms-practical/blob/main/src/data/content.js): `src/data/content.js`

### Cart and orders

- [Cart review](https://github.com/murgwell/midterms-practical/blob/main/src/pages/CartPage.jsx): `src/pages/CartPage.jsx`
- [Checkout](https://github.com/murgwell/midterms-practical/blob/main/src/pages/CheckoutPage.jsx): `src/pages/CheckoutPage.jsx`
- [Order confirmation](https://github.com/murgwell/midterms-practical/blob/main/src/pages/OrderConfirmationPage.jsx): `src/pages/OrderConfirmationPage.jsx`
- [Cart provider](https://github.com/murgwell/midterms-practical/blob/main/src/context/CartContext.jsx): `src/context/CartContext.jsx`
- [Cart hook](https://github.com/murgwell/midterms-practical/blob/main/src/hooks/useCart.js): `src/hooks/useCart.js`

### Domain and state

- [Menu item model](https://github.com/murgwell/midterms-practical/blob/main/src/models/MenuItem.js): `src/models/MenuItem.js`
- [Money utilities](https://github.com/murgwell/midterms-practical/blob/main/src/models/Money.js): `src/models/Money.js`
- [Cart model](https://github.com/murgwell/midterms-practical/blob/main/src/models/Cart.js): `src/models/Cart.js`
- [Cart line model](https://github.com/murgwell/midterms-practical/blob/main/src/models/CartLine.js): `src/models/CartLine.js`
- [Customer model](https://github.com/murgwell/midterms-practical/blob/main/src/models/Customer.js): `src/models/Customer.js`
- [Order model](https://github.com/murgwell/midterms-practical/blob/main/src/models/Order.js): `src/models/Order.js`

### Other components

- **Customer**
- **Browser local storage**

## Connections

- Customer → App routes: uses
- App routes → Home page: routes (evidence: `src/App.jsx`)
- App routes → Filtered menu: routes (evidence: `src/App.jsx`)
- App routes → Grouped menu: routes (evidence: `src/App.jsx`)
- App routes → Dish details: routes (evidence: `src/App.jsx`)
- App routes → Cart review: routes (evidence: `src/App.jsx`)
- App routes → Checkout: routes (evidence: `src/App.jsx`)
- App routes → Order confirmation: routes (evidence: `src/App.jsx`)
- Filtered menu → Menu items: filters and sorts (evidence: `src/pages/MenuPage.jsx`)
- Filtered menu → Categories: filters by (evidence: `src/pages/MenuPage.jsx`)
- Grouped menu → Menu items: groups items (evidence: `src/pages/FullMenuPage.jsx`)
- Grouped menu → Categories: groups by (evidence: `src/pages/FullMenuPage.jsx`)
- Home page → Menu items: displays (evidence: `src/pages/HomePage.jsx`)
- Home page → Categories: displays (evidence: `src/pages/HomePage.jsx`)
- Filtered menu → Dish card: renders (evidence: `src/pages/MenuPage.jsx`)
- Grouped menu → Dish card: renders (evidence: `src/pages/FullMenuPage.jsx`)
- Dish details → Menu items: looks up dish (evidence: `src/pages/DishDetailPage.jsx`)
- Menu items → Menu item model: creates items (evidence: `src/data/menuItems.js`)
- Categories → Site content: uses labels
- Filtered menu → Site content: reads labels (evidence: `src/pages/MenuPage.jsx`)
- Home page → Site content: reads content (evidence: `src/pages/HomePage.jsx`)
- Cart review → Cart hook: reads cart (evidence: `src/pages/CartPage.jsx`)
- Checkout → Cart hook: places order through (evidence: `src/pages/CheckoutPage.jsx`)
- Order confirmation → Cart hook: reads order (evidence: `src/pages/OrderConfirmationPage.jsx`)
- Cart hook → Cart provider: reads context (evidence: `src/hooks/useCart.js`)
- Cart provider → Browser local storage: persists cart (evidence: `src/context/CartContext.jsx`)
- Cart provider → Cart model: updates cart (evidence: `src/context/CartContext.jsx`)
- Cart provider → Customer model: creates customer (evidence: `src/context/CartContext.jsx`)
- Cart provider → Order model: creates order (evidence: `src/context/CartContext.jsx`)
- Cart model → Cart line model: uses lines (evidence: `src/models/Cart.js`)
- Cart model → Menu item model: uses menu items (evidence: `src/models/Cart.js`)
- Cart model → Money utilities: uses currency (evidence: `src/models/Cart.js`)
- Cart line model → Money utilities: uses currency (evidence: `src/models/CartLine.js`)
- Order model → Money utilities: uses currency (evidence: `src/models/Order.js`)
- Theme state → Theme hook: exposes theme
