# shalemmarapakula/anu-home-foods architecture

> Architecture diagram of the GitHub repository shalemmarapakula/anu-home-foods, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shalemmarapakula/anu-home-foods
- Repository: https://github.com/shalemmarapakula/anu-home-foods

## Overview

ANU HOME FOODS is a React storefront and Express API for browsing and ordering homemade Andhra foods. The customer journey runs from product discovery and selection through cart management and checkout, with separate account registration/login and direct-contact options. The backend exposes product, order, and authentication endpoints; sampled controllers use in-memory data from backend/config/db.js, so the README’s MySQL description is not represented by the available tree. Frontend API wiring and several page implementations were not sampled, so those links reflect documented capabilities and are shown only at the API-service boundary.

Main entry points: [`frontend/src/App.jsx`](https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/App.jsx) (Routed Storefront), [`frontend/src/services/api.js`](https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/services/api.js) (API Client), [`backend/server.js`](https://github.com/shalemmarapakula/anu-home-foods/blob/main/backend/server.js) (Express API), [`frontend/src/pages/Checkout.jsx`](https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/pages/Checkout.jsx) (Checkout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app["Routed Storefront<br/>[App.jsx]"]
  node_home["Home Discovery<br/>[Home.jsx]"]
  node_contact["Contact Options"]
end

subgraph group_shopping["Shopping"]
  node_shop["Catalog &amp; Filters<br/>[Shop.jsx]"]
  node_details["Product Details<br/>[ProductDetails.jsx]"]
  node_cartpage["Cart Review<br/>[Cart.jsx]"]
  node_checkout["Checkout<br/>[Checkout.jsx]"]
end

subgraph group_accounts["Accounts"]
  node_loginpage["Login<br/>[Login.jsx]"]
  node_registerpage["Registration<br/>[Register.jsx]"]
end

subgraph group_api["REST API"]
  node_apiservice["API Client<br/>[api.js]"]
  node_server["Express API<br/>[server.js]"]
  node_productroutes["Product Routes<br/>[productRoutes.js]"]
  node_productlogic["Product Queries"]
  node_orderroutes["Order Routes<br/>[orderRoutes.js]"]
  node_orderlogic["Order Handling<br/>[orderController.js]"]
  node_authroutes["Auth Routes<br/>[authRoutes.js]"]
  node_authlogic["Auth Handling<br/>[authController.js]"]
  node_memorydb[("In-Memory Data<br/>[db.js]")]
end

subgraph group_state["Application State"]
  node_cartstate["Cart &amp; Totals<br/>[CartContext.jsx]"]
  node_authstate["Authentication State<br/>[AuthContext.jsx]"]
  node_wishliststate["Wishlist State"]
end

node_customer(("Customer"))

node_customer -->|"uses"| node_app
node_app -->|"routes"| node_home
node_app -->|"routes"| node_shop
node_app -->|"routes"| node_details
node_app -->|"routes"| node_cartpage
node_app -->|"routes"| node_checkout
node_app -->|"routes"| node_loginpage
node_app -->|"routes"| node_registerpage
node_app -->|"renders"| node_contact
node_app -->|"provides"| node_cartstate
node_app -->|"provides"| node_authstate
node_app -->|"provides"| node_wishliststate
node_home -.->|"requests products"| node_apiservice
node_shop -.->|"requests catalog"| node_apiservice
node_details -.->|"requests details"| node_apiservice
node_cartpage -->|"reads and updates"| node_cartstate
node_checkout -->|"reads totals"| node_cartstate
node_checkout -.->|"submits order"| node_apiservice
node_loginpage -.->|"submits login"| node_apiservice
node_registerpage -.->|"submits registration"| node_apiservice
node_apiservice -.->|"HTTP requests"| node_server
node_server -->|"dispatches"| node_productroutes
node_server -->|"dispatches"| node_orderroutes
node_server -->|"dispatches"| node_authroutes
node_productroutes -->|"invokes"| node_productlogic
node_orderroutes -->|"invokes"| node_orderlogic
node_authroutes -->|"invokes"| node_authlogic
node_productlogic -->|"reads products"| node_memorydb
node_orderlogic -->|"reads and writes orders"| node_memorydb
node_authlogic -->|"reads and writes users"| node_memorydb

click node_app "https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/App.jsx"
click node_home "https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/pages/Home.jsx"
click node_shop "https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/pages/Shop.jsx"
click node_details "https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/pages/ProductDetails.jsx"
click node_cartpage "https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/pages/Cart.jsx"
click node_checkout "https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/pages/Checkout.jsx"
click node_loginpage "https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/pages/Login.jsx"
click node_registerpage "https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/pages/Register.jsx"
click node_contact "https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/components/FloatingWidgets.jsx"
click node_cartstate "https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/context/CartContext.jsx"
click node_authstate "https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/context/AuthContext.jsx"
click node_wishliststate "https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/context/WishlistContext.jsx"
click node_apiservice "https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/services/api.js"
click node_server "https://github.com/shalemmarapakula/anu-home-foods/blob/main/backend/server.js"
click node_productroutes "https://github.com/shalemmarapakula/anu-home-foods/blob/main/backend/routes/productRoutes.js"
click node_productlogic "https://github.com/shalemmarapakula/anu-home-foods/blob/main/backend/controllers/productController.js"
click node_orderroutes "https://github.com/shalemmarapakula/anu-home-foods/blob/main/backend/routes/orderRoutes.js"
click node_orderlogic "https://github.com/shalemmarapakula/anu-home-foods/blob/main/backend/controllers/orderController.js"
click node_authroutes "https://github.com/shalemmarapakula/anu-home-foods/blob/main/backend/routes/authRoutes.js"
click node_authlogic "https://github.com/shalemmarapakula/anu-home-foods/blob/main/backend/controllers/authController.js"
click node_memorydb "https://github.com/shalemmarapakula/anu-home-foods/blob/main/backend/config/db.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_contact toneBlue
class node_shop,node_details,node_cartpage,node_checkout toneAmber
class node_loginpage,node_registerpage toneMint
class node_apiservice,node_server,node_productroutes,node_productlogic,node_orderroutes,node_orderlogic,node_authroutes,node_authlogic,node_memorydb toneRose
class node_cartstate,node_authstate,node_wishliststate,node_customer toneIndigo
```

## Components

### Storefront

- [Routed Storefront](https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Home Discovery](https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Contact Options](https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/components/FloatingWidgets.jsx): `frontend/src/components/FloatingWidgets.jsx`

### Shopping

- [Catalog & Filters](https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/pages/Shop.jsx): `frontend/src/pages/Shop.jsx`
- [Product Details](https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/pages/ProductDetails.jsx): `frontend/src/pages/ProductDetails.jsx`
- [Cart Review](https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/pages/Cart.jsx): `frontend/src/pages/Cart.jsx`
- [Checkout](https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/pages/Checkout.jsx): `frontend/src/pages/Checkout.jsx`

### Accounts

- [Login](https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Registration](https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/pages/Register.jsx): `frontend/src/pages/Register.jsx`

### REST API

- [API Client](https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Express API](https://github.com/shalemmarapakula/anu-home-foods/blob/main/backend/server.js): `backend/server.js`
- [Product Routes](https://github.com/shalemmarapakula/anu-home-foods/blob/main/backend/routes/productRoutes.js): `backend/routes/productRoutes.js`
- [Product Queries](https://github.com/shalemmarapakula/anu-home-foods/blob/main/backend/controllers/productController.js): `backend/controllers/productController.js`
- [Order Routes](https://github.com/shalemmarapakula/anu-home-foods/blob/main/backend/routes/orderRoutes.js): `backend/routes/orderRoutes.js`
- [Order Handling](https://github.com/shalemmarapakula/anu-home-foods/blob/main/backend/controllers/orderController.js): `backend/controllers/orderController.js`
- [Auth Routes](https://github.com/shalemmarapakula/anu-home-foods/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Auth Handling](https://github.com/shalemmarapakula/anu-home-foods/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [In-Memory Data](https://github.com/shalemmarapakula/anu-home-foods/blob/main/backend/config/db.js): `backend/config/db.js`

### Application State

- [Cart & Totals](https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/context/CartContext.jsx): `frontend/src/context/CartContext.jsx`
- [Authentication State](https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Wishlist State](https://github.com/shalemmarapakula/anu-home-foods/blob/main/frontend/src/context/WishlistContext.jsx): `frontend/src/context/WishlistContext.jsx`

### Other components

- **Customer**

## Connections

- Customer → Routed Storefront: uses
- Routed Storefront → Home Discovery: routes
- Routed Storefront → Catalog & Filters: routes
- Routed Storefront → Product Details: routes
- Routed Storefront → Cart Review: routes
- Routed Storefront → Checkout: routes
- Routed Storefront → Login: routes
- Routed Storefront → Registration: routes
- Routed Storefront → Contact Options: renders
- Routed Storefront → Cart & Totals: provides
- Routed Storefront → Authentication State: provides
- Routed Storefront → Wishlist State: provides
- Home Discovery → API Client: requests products
- Catalog & Filters → API Client: requests catalog
- Product Details → API Client: requests details
- Cart Review → Cart & Totals: reads and updates
- Checkout → Cart & Totals: reads totals
- Checkout → API Client: submits order
- Login → API Client: submits login
- Registration → API Client: submits registration
- API Client → Express API: HTTP requests
- Express API → Product Routes: dispatches
- Express API → Order Routes: dispatches
- Express API → Auth Routes: dispatches
- Product Routes → Product Queries: invokes
- Order Routes → Order Handling: invokes
- Auth Routes → Auth Handling: invokes
- Product Queries → In-Memory Data: reads products
- Order Handling → In-Memory Data: reads and writes orders
- Auth Handling → In-Memory Data: reads and writes users
