# sumanthba2004/sweety-food-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/sumanthba2004/sweety-food-frontend
- Repository: https://github.com/sumanthba2004/sweety-food-frontend

## Overview

Sweetly is a restaurant food-ordering frontend. Customers browse food, add items to a persistent cart, provide delivery details, select a payment method, place an order, and reach order confirmation or tracking; registration is also part of the customer flow. The graph includes the admin-management area visible in the source tree, but its internal wiring is not established by the excerpts. Checkout and payment excerpts show direct calls to a backend API; unsampled service modules are not assumed to be in that request path.

Main entry points: [`src/App.js`](https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/App.js) (App Router), [`src/context/CartContext.js`](https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/context/CartContext.js) (Cart State), [`src/pages/Register/Register.js`](https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/Register/Register.js) (Registration), [`src/pages/Payment/Payment.js`](https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/Payment/Payment.js) (Payment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application Shell"]
  node_app["App Router<br/>[App.js]"]
  node_navbar["Navigation<br/>[Navbar.js]"]
end

subgraph group_discovery["Food Discovery"]
  node_home["Home<br/>[Home.js]"]
  node_menu["Menu<br/>[Menu.js]"]
  node_foodcard["Food Card<br/>[FoodCard.js]"]
end

subgraph group_customer["Customer Account"]
  node_login["Login<br/>[Login.js]"]
  node_register["Registration<br/>[Register.js]"]
end

subgraph group_ordering["Ordering and Payment"]
  node_cartstate["Cart State<br/>[CartContext.js]"]
  node_cart["Cart<br/>[Cart.js]"]
  node_checkout["Checkout<br/>[Checkout.js]"]
  node_payment["Payment<br/>[Payment.js]"]
  node_demopayment["Demo Payment<br/>[DemoPayment.jsx]"]
  node_ordersuccess["Order Success<br/>[OrderSuccess.js]"]
  node_tracking["Order Tracking<br/>[TrackOrder.js]"]
end

subgraph group_admin["Administration"]
  node_admin["Admin Management"]
  node_dashboard["Admin Dashboard<br/>[Dashboard.js]"]
end

node_customer(("Customer"))
node_backend{{"Backend API"}}
node_localstorage[("Browser Storage")]

node_customer -->|"uses"| node_app
node_app -->|"renders"| node_navbar
node_app -->|"routes"| node_home
node_app -->|"routes"| node_menu
node_app -->|"routes"| node_cart
node_app -->|"routes"| node_checkout
node_app -->|"routes"| node_payment
node_app -->|"routes"| node_demopayment
node_app -->|"routes"| node_ordersuccess
node_app -->|"routes"| node_tracking
node_app -->|"routes"| node_login
node_app -->|"routes"| node_register
node_app -->|"provides"| node_cartstate
node_home -->|"renders"| node_foodcard
node_menu -->|"renders"| node_foodcard
node_foodcard -->|"adds items"| node_cartstate
node_navbar -->|"reads cart"| node_cartstate
node_cart -->|"updates cart"| node_cartstate
node_cartstate -->|"persists cart"| node_localstorage
node_checkout -->|"creates order"| node_backend
node_payment -->|"creates order"| node_backend
node_payment -->|"clears cart"| node_cartstate
node_register -->|"registers customer"| node_backend
node_register -->|"saves customer"| node_localstorage

click node_app "https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/App.js"
click node_navbar "https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/components/Navbar/Navbar.js"
click node_home "https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/Home/Home.js"
click node_menu "https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/Menu/Menu.js"
click node_foodcard "https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/components/FoodCard/FoodCard.js"
click node_cartstate "https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/context/CartContext.js"
click node_cart "https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/Cart/Cart.js"
click node_checkout "https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/Checkout/Checkout.js"
click node_payment "https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/Payment/Payment.js"
click node_demopayment "https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/DemoPayment/DemoPayment.jsx"
click node_ordersuccess "https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/OrderSuccess/OrderSuccess.js"
click node_tracking "https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/TrackOrder/TrackOrder.js"
click node_login "https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/Login/Login.js"
click node_register "https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/Register/Register.js"
click node_admin "https://github.com/sumanthba2004/sweety-food-frontend/tree/master/src/pages/Admin"
click node_dashboard "https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/Admin/Dashboard.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_navbar toneBlue
class node_home,node_menu,node_foodcard,node_localstorage toneAmber
class node_login,node_register,node_backend toneMint
class node_cartstate,node_cart,node_checkout,node_payment,node_demopayment,node_ordersuccess,node_tracking toneRose
class node_admin,node_dashboard,node_customer toneIndigo
```

## Components

### Application Shell

- [App Router](https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/App.js): `src/App.js`
- [Navigation](https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/components/Navbar/Navbar.js): `src/components/Navbar/Navbar.js`

### Food Discovery

- [Home](https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/Home/Home.js): `src/pages/Home/Home.js`
- [Menu](https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/Menu/Menu.js): `src/pages/Menu/Menu.js`
- [Food Card](https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/components/FoodCard/FoodCard.js): `src/components/FoodCard/FoodCard.js`

### Customer Account

- [Login](https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/Login/Login.js): `src/pages/Login/Login.js`
- [Registration](https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/Register/Register.js): `src/pages/Register/Register.js`

### Ordering and Payment

- [Cart State](https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/context/CartContext.js): `src/context/CartContext.js`
- [Cart](https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/Cart/Cart.js): `src/pages/Cart/Cart.js`
- [Checkout](https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/Checkout/Checkout.js): `src/pages/Checkout/Checkout.js`
- [Payment](https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/Payment/Payment.js): `src/pages/Payment/Payment.js`
- [Demo Payment](https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/DemoPayment/DemoPayment.jsx): `src/pages/DemoPayment/DemoPayment.jsx`
- [Order Success](https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/OrderSuccess/OrderSuccess.js): `src/pages/OrderSuccess/OrderSuccess.js`
- [Order Tracking](https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/TrackOrder/TrackOrder.js): `src/pages/TrackOrder/TrackOrder.js`

### Administration

- [Admin Management](https://github.com/sumanthba2004/sweety-food-frontend/tree/master/src/pages/Admin): `src/pages/Admin`
- [Admin Dashboard](https://github.com/sumanthba2004/sweety-food-frontend/blob/master/src/pages/Admin/Dashboard.js): `src/pages/Admin/Dashboard.js`

### Other components

- **Customer**
- **Backend API**
- **Browser Storage**

## Connections

- Customer → App Router: uses
- App Router → Navigation: renders (evidence: `src/App.js`)
- App Router → Home: routes (evidence: `src/App.js`)
- App Router → Menu: routes (evidence: `src/App.js`)
- App Router → Cart: routes (evidence: `src/App.js`)
- App Router → Checkout: routes (evidence: `src/App.js`)
- App Router → Payment: routes (evidence: `src/App.js`)
- App Router → Demo Payment: routes (evidence: `src/App.js`)
- App Router → Order Success: routes (evidence: `src/App.js`)
- App Router → Order Tracking: routes (evidence: `src/App.js`)
- App Router → Login: routes (evidence: `src/App.js`)
- App Router → Registration: routes (evidence: `src/App.js`)
- App Router → Cart State: provides (evidence: `src/App.js`)
- Home → Food Card: renders (evidence: `src/pages/Home/Home.js`)
- Menu → Food Card: renders (evidence: `src/pages/Menu/Menu.js`)
- Food Card → Cart State: adds items (evidence: `src/components/FoodCard/FoodCard.js`)
- Navigation → Cart State: reads cart (evidence: `src/components/Navbar/Navbar.js`)
- Cart → Cart State: updates cart (evidence: `src/pages/Cart/Cart.js`)
- Cart State → Browser Storage: persists cart (evidence: `src/context/CartContext.js`)
- Checkout → Backend API: creates order (evidence: `src/pages/Checkout/Checkout.js`)
- Payment → Backend API: creates order (evidence: `src/pages/Payment/Payment.js`)
- Payment → Cart State: clears cart (evidence: `src/pages/Payment/Payment.js`)
- Registration → Backend API: registers customer (evidence: `src/pages/Register/Register.js`)
- Registration → Browser Storage: saves customer (evidence: `src/pages/Register/Register.js`)
