# saainikhil/peddammas-kitchen architecture

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

- Interactive diagram: https://gitdiagram.com/saainikhil/peddammas-kitchen
- Repository: https://github.com/saainikhil/peddammas-kitchen

## Overview

Peddamma’s Kitchen is a React storefront for browsing traditional foods and placing orders. The main journey is routed through the app: customers browse the catalog and product details, add items to a cart or buy now, then complete checkout and reach order success. Account pages provide login, profile, saved addresses, and order history. State is primarily browser-local: authentication uses localStorage directly, while cart and page data use a shared persistence hook. The excerpts show no backend or payment-service integration; unsampled page behavior is represented cautiously.

Main entry points: [`src/App.jsx`](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/App.jsx) (Route Shell), [`src/pages/Checkout.jsx`](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/Checkout.jsx) (Checkout), [`src/context/CartContext.jsx`](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/context/CartContext.jsx) (Cart State), [`src/hooks/useLocalStorage.js`](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/hooks/useLocalStorage.js) (Local Storage Hook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_home["Home<br/>[Home.jsx]"]
  node_catalog["Product Catalog<br/>[Products.jsx]"]
  node_productdata["Product Data<br/>[products.js]"]
  node_details["Product Details<br/>[ProductDetails.jsx]"]
  node_productcard["Product Card<br/>[ProductCard.jsx]"]
  node_bulk["Bulk Orders<br/>[BulkOrders.jsx]"]
  node_about["About<br/>[About.jsx]"]
  node_contact["Contact<br/>[Contact.jsx]"]
end

subgraph group_purchase["Purchase and Orders"]
  node_cart["Cart<br/>[Cart.jsx]"]
  node_cartstate["Cart State<br/>[CartContext.jsx]"]
  node_checkout["Checkout<br/>[Checkout.jsx]"]
  node_orders["Order History<br/>[Orders.jsx]"]
  node_success["Order Success<br/>[OrderSuccess.jsx]"]
  node_orderutils["Order Utilities<br/>[orderUtils.js]"]
end

subgraph group_account["Account"]
  node_auth["Authentication<br/>[AuthContext.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
  node_protected["Route Guard<br/>[ProtectedRoute.jsx]"]
  node_profile["Profile<br/>[Profile.jsx]"]
  node_addresses["Saved Addresses<br/>[Addresses.jsx]"]
end

subgraph group_shared["Shared Runtime"]
  node_app["Route Shell<br/>[App.jsx]"]
  node_storage["Local Storage Hook<br/>[useLocalStorage.js]"]
  node_validators["Form Validation<br/>[validators.js]"]
  node_toast["Toast Notifications<br/>[ToastContext.jsx]"]
  node_breadcrumb["Breadcrumbs<br/>[Breadcrumb.jsx]"]
  node_navbar["Navigation Bar<br/>[Navbar.jsx]"]
  node_footer["Footer<br/>[Footer.jsx]"]
end

node_customer(("Customer"))

node_customer -->|"opens"| node_app
node_app -->|"provides"| node_auth
node_app -->|"provides"| node_cartstate
node_app -->|"provides"| node_toast
node_app -->|"routes"| node_login
node_app -->|"routes"| node_home
node_app -->|"routes"| node_catalog
node_app -->|"routes"| node_details
node_app -->|"routes"| node_bulk
node_app -->|"routes"| node_cart
node_app -->|"routes"| node_checkout
node_app -->|"routes"| node_success
node_app -->|"routes"| node_orders
node_app -->|"routes"| node_profile
node_app -->|"routes"| node_addresses
node_app -->|"routes"| node_about
node_app -->|"routes"| node_contact
node_app -->|"guards routes"| node_protected
node_protected -->|"checks session"| node_auth
node_login -->|"authenticates"| node_auth
node_app -->|"renders"| node_navbar
node_app -->|"renders"| node_footer
node_home -->|"reads catalog"| node_productdata
node_catalog -->|"reads catalog"| node_productdata
node_details -->|"reads product"| node_productdata
node_catalog -->|"renders cards"| node_productcard
node_home -->|"renders cards"| node_productcard
node_productcard -->|"adds items"| node_cartstate
node_details -->|"updates cart"| node_cartstate
node_cart -->|"reads and updates"| node_cartstate
node_checkout -->|"reads and clears"| node_cartstate
node_cartstate -->|"persists cart"| node_storage
node_checkout -->|"loads buy-now item"| node_productdata
node_checkout -->|"validates address"| node_validators
node_checkout -->|"calculates order"| node_orderutils
node_checkout -->|"persists addresses"| node_storage
node_checkout -->|"shows feedback"| node_toast
node_checkout -->|"navigates after order"| node_success
node_orders -->|"reads saved orders"| node_storage
node_orders -->|"formats order data"| node_orderutils
node_addresses -->|"persists addresses"| node_storage
node_addresses -->|"validates forms"| node_validators
node_addresses -->|"shows feedback"| node_toast
node_profile -->|"reads account"| node_auth
node_profile -->|"validates profile"| node_validators
node_profile -->|"persists profile data"| node_storage
node_cart -->|"uses order helpers"| node_orderutils

click node_app "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/App.jsx"
click node_auth "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/context/AuthContext.jsx"
click node_login "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/Login.jsx"
click node_protected "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/components/ProtectedRoute.jsx"
click node_home "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/Home.jsx"
click node_catalog "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/Products.jsx"
click node_productdata "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/data/products.js"
click node_details "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/ProductDetails.jsx"
click node_productcard "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/components/ProductCard.jsx"
click node_bulk "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/BulkOrders.jsx"
click node_cart "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/Cart.jsx"
click node_cartstate "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/context/CartContext.jsx"
click node_checkout "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/Checkout.jsx"
click node_orders "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/Orders.jsx"
click node_success "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/OrderSuccess.jsx"
click node_orderutils "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/utils/orderUtils.js"
click node_profile "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/Profile.jsx"
click node_addresses "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/Addresses.jsx"
click node_storage "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/hooks/useLocalStorage.js"
click node_validators "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/utils/validators.js"
click node_toast "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/context/ToastContext.jsx"
click node_breadcrumb "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/components/Breadcrumb.jsx"
click node_navbar "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/components/Navbar.jsx"
click node_footer "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/components/Footer.jsx"
click node_about "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/About.jsx"
click node_contact "https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/Contact.jsx"

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_catalog,node_productdata,node_details,node_productcard,node_bulk,node_about,node_contact toneBlue
class node_cart,node_cartstate,node_checkout,node_orders,node_success,node_orderutils toneAmber
class node_auth,node_login,node_protected,node_profile,node_addresses toneMint
class node_app,node_storage,node_validators,node_toast,node_breadcrumb,node_navbar,node_footer toneRose
class node_customer toneIndigo
```

## Components

### Storefront

- [Home](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`
- [Product Catalog](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/Products.jsx): `src/pages/Products.jsx`
- [Product Data](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/data/products.js): `src/data/products.js`
- [Product Details](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/ProductDetails.jsx): `src/pages/ProductDetails.jsx`
- [Product Card](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/components/ProductCard.jsx): `src/components/ProductCard.jsx`
- [Bulk Orders](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/BulkOrders.jsx): `src/pages/BulkOrders.jsx`
- [About](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/About.jsx): `src/pages/About.jsx`
- [Contact](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/Contact.jsx): `src/pages/Contact.jsx`

### Purchase and Orders

- [Cart](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/Cart.jsx): `src/pages/Cart.jsx`
- [Cart State](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/context/CartContext.jsx): `src/context/CartContext.jsx`
- [Checkout](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/Checkout.jsx): `src/pages/Checkout.jsx`
- [Order History](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/Orders.jsx): `src/pages/Orders.jsx`
- [Order Success](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/OrderSuccess.jsx): `src/pages/OrderSuccess.jsx`
- [Order Utilities](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/utils/orderUtils.js): `src/utils/orderUtils.js`

### Account

- [Authentication](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Login](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/Login.jsx): `src/pages/Login.jsx`
- [Route Guard](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/components/ProtectedRoute.jsx): `src/components/ProtectedRoute.jsx`
- [Profile](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/Profile.jsx): `src/pages/Profile.jsx`
- [Saved Addresses](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/pages/Addresses.jsx): `src/pages/Addresses.jsx`

### Shared Runtime

- [Route Shell](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/App.jsx): `src/App.jsx`
- [Local Storage Hook](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/hooks/useLocalStorage.js): `src/hooks/useLocalStorage.js`
- [Form Validation](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/utils/validators.js): `src/utils/validators.js`
- [Toast Notifications](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/context/ToastContext.jsx): `src/context/ToastContext.jsx`
- [Breadcrumbs](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/components/Breadcrumb.jsx): `src/components/Breadcrumb.jsx`
- [Navigation Bar](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/components/Navbar.jsx): `src/components/Navbar.jsx`
- [Footer](https://github.com/saainikhil/peddammas-kitchen/blob/main/src/components/Footer.jsx): `src/components/Footer.jsx`

### Other components

- **Customer**

## Connections

- Customer → Route Shell: opens
- Route Shell → Authentication: provides (evidence: `src/App.jsx`)
- Route Shell → Cart State: provides (evidence: `src/App.jsx`)
- Route Shell → Toast Notifications: provides (evidence: `src/App.jsx`)
- Route Shell → Login: routes (evidence: `src/App.jsx`)
- Route Shell → Home: routes (evidence: `src/App.jsx`)
- Route Shell → Product Catalog: routes (evidence: `src/App.jsx`)
- Route Shell → Product Details: routes (evidence: `src/App.jsx`)
- Route Shell → Bulk Orders: routes (evidence: `src/App.jsx`)
- Route Shell → Cart: routes (evidence: `src/App.jsx`)
- Route Shell → Checkout: routes (evidence: `src/App.jsx`)
- Route Shell → Order Success: routes (evidence: `src/App.jsx`)
- Route Shell → Order History: routes (evidence: `src/App.jsx`)
- Route Shell → Profile: routes (evidence: `src/App.jsx`)
- Route Shell → Saved Addresses: routes (evidence: `src/App.jsx`)
- Route Shell → About: routes (evidence: `src/App.jsx`)
- Route Shell → Contact: routes (evidence: `src/App.jsx`)
- Route Shell → Route Guard: guards routes (evidence: `src/App.jsx`)
- Route Guard → Authentication: checks session (evidence: `src/components/ProtectedRoute.jsx`)
- Login → Authentication: authenticates (evidence: `src/pages/Login.jsx`)
- Route Shell → Navigation Bar: renders (evidence: `src/App.jsx`)
- Route Shell → Footer: renders (evidence: `src/App.jsx`)
- Home → Product Data: reads catalog (evidence: `src/pages/Home.jsx`)
- Product Catalog → Product Data: reads catalog (evidence: `src/pages/Products.jsx`)
- Product Details → Product Data: reads product (evidence: `src/pages/ProductDetails.jsx`)
- Product Catalog → Product Card: renders cards (evidence: `src/pages/Products.jsx`)
- Home → Product Card: renders cards (evidence: `src/pages/Home.jsx`)
- Product Card → Cart State: adds items (evidence: `src/components/ProductCard.jsx`)
- Product Details → Cart State: updates cart (evidence: `src/pages/ProductDetails.jsx`)
- Cart → Cart State: reads and updates (evidence: `src/pages/Cart.jsx`)
- Checkout → Cart State: reads and clears (evidence: `src/pages/Checkout.jsx`)
- Cart State → Local Storage Hook: persists cart (evidence: `src/context/CartContext.jsx`)
- Checkout → Product Data: loads buy-now item (evidence: `src/pages/Checkout.jsx`)
- Checkout → Form Validation: validates address (evidence: `src/pages/Checkout.jsx`)
- Checkout → Order Utilities: calculates order (evidence: `src/pages/Checkout.jsx`)
- Checkout → Local Storage Hook: persists addresses (evidence: `src/pages/Checkout.jsx`)
- Checkout → Toast Notifications: shows feedback (evidence: `src/pages/Checkout.jsx`)
- Checkout → Order Success: navigates after order (evidence: `src/pages/Checkout.jsx`)
- Order History → Local Storage Hook: reads saved orders (evidence: `src/pages/Orders.jsx`)
- Order History → Order Utilities: formats order data (evidence: `src/pages/Orders.jsx`)
- Saved Addresses → Local Storage Hook: persists addresses (evidence: `src/pages/Addresses.jsx`)
- Saved Addresses → Form Validation: validates forms (evidence: `src/pages/Addresses.jsx`)
- Saved Addresses → Toast Notifications: shows feedback (evidence: `src/pages/Addresses.jsx`)
- Profile → Authentication: reads account (evidence: `src/pages/Profile.jsx`)
- Profile → Form Validation: validates profile (evidence: `src/pages/Profile.jsx`)
- Profile → Local Storage Hook: persists profile data (evidence: `src/pages/Profile.jsx`)
- Cart → Order Utilities: uses order helpers (evidence: `src/pages/Cart.jsx`)
