# rakesh-mora/delight_mandi architecture

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

- Interactive diagram: https://gitdiagram.com/rakesh-mora/delight_mandi
- Repository: https://github.com/rakesh-mora/delight_mandi

## Overview

Delight Mandi is a restaurant website backed by a REST API, with public menu and review experiences and an admin area. The supported review workflow is visitor → review form → API → PostgreSQL; administrators can retrieve, approve or hide, and delete reviews. The server also exposes menu, order/cart, health, and image-serving routes. The menu, order, and most admin implementations were not sampled, so their documented route capabilities are shown without speculative call chains.

Main entry points: [`new-backend/server.js`](https://github.com/rakesh-mora/delight_mandi/blob/master/new-backend/server.js) (Express server), [`new-backend/routes/reviews.js`](https://github.com/rakesh-mora/delight_mandi/blob/master/new-backend/routes/reviews.js) (Review routes), [`new-frontend/src/admin/AdminPage.js`](https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/admin/AdminPage.js) (Admin page), [`new-frontend/src/App.js`](https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/App.js) (App routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Customer website"]
  node_app["App routing<br/>[App.js]"]
  node_homepage["Home sections<br/>[App.js]"]
  node_menupage["Menu page<br/>[MenuPage.js]"]
  node_reviewsui["Reviews and form<br/>[Reviews.js]"]
end

subgraph group_admin["Administration"]
  node_adminpage["Admin page<br/>[AdminPage.js]"]
  node_adminlogin["Admin login<br/>[AdminLogin.js]"]
  node_admincontext["Admin session<br/>[AdminContext.js]"]
  node_adminmenu["Menu management<br/>[AdminMenu.js]"]
  node_adminorders["Order management<br/>[AdminOrders.js]"]
  node_adminreviews["Review management<br/>[AdminReviews.js]"]
end

subgraph group_api["REST API"]
  node_apiclient["API client<br/>[api.js]"]
  node_server["Express server<br/>[server.js]"]
  node_health["Health routes<br/>[health.js]"]
  node_menuroutes["Menu routes<br/>[menu.js]"]
  node_reviewroutes["Review routes<br/>[reviews.js]"]
  node_orderroutes["Order and cart routes<br/>[orders.js]"]
  node_auth["Admin authorization<br/>[auth.js]"]
  node_config["Runtime configuration<br/>[index.js]"]
end

subgraph group_data["Data and media"]
  node_db[("PostgreSQL<br/>[db.js]")]
  node_imagestore[("Image files<br/>[index.js]")]
end

node_visitor(("Visitor"))
node_adminuser(("Administrator"))
node_whatsapp(("WhatsApp service"))

node_visitor -->|"opens"| node_app
node_adminuser -->|"opens"| node_app
node_app -->|"renders"| node_homepage
node_app -->|"routes to"| node_menupage
node_app -->|"routes to"| node_adminpage
node_homepage -->|"includes"| node_reviewsui
node_adminpage -->|"uses"| node_adminlogin
node_adminpage -->|"provides"| node_adminmenu
node_adminpage -->|"provides"| node_adminorders
node_adminpage -->|"provides"| node_adminreviews
node_adminlogin -->|"uses"| node_admincontext
node_adminreviews -->|"reads key"| node_admincontext
node_reviewsui -->|"requests reviews"| node_reviewroutes
node_reviewsui -->|"submits review"| node_reviewroutes
node_adminreviews -->|"admin requests"| node_reviewroutes
node_adminreviews -->|"calls"| node_apiclient
node_apiclient -->|"sends requests"| node_server
node_server -->|"dispatches"| node_health
node_server -->|"dispatches"| node_menuroutes
node_server -->|"dispatches"| node_reviewroutes
node_server -->|"dispatches"| node_orderroutes
node_reviewroutes -->|"queries"| node_db
node_reviewroutes -->|"protects admin routes"| node_auth
node_server -->|"reads settings"| node_config
node_server -->|"serves images"| node_imagestore
node_server -->|"checks connection"| node_db
node_orderroutes -.->|"cart integration"| node_whatsapp

click node_app "https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/App.js"
click node_homepage "https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/App.js"
click node_menupage "https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/components/MenuPage.js"
click node_reviewsui "https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/components/Reviews.js"
click node_adminpage "https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/admin/AdminPage.js"
click node_adminlogin "https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/admin/AdminLogin.js"
click node_admincontext "https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/context/AdminContext.js"
click node_adminmenu "https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/admin/AdminMenu.js"
click node_adminorders "https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/admin/AdminOrders.js"
click node_adminreviews "https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/admin/AdminReviews.js"
click node_apiclient "https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/utils/api.js"
click node_server "https://github.com/rakesh-mora/delight_mandi/blob/master/new-backend/server.js"
click node_health "https://github.com/rakesh-mora/delight_mandi/blob/master/new-backend/routes/health.js"
click node_menuroutes "https://github.com/rakesh-mora/delight_mandi/blob/master/new-backend/routes/menu.js"
click node_reviewroutes "https://github.com/rakesh-mora/delight_mandi/blob/master/new-backend/routes/reviews.js"
click node_orderroutes "https://github.com/rakesh-mora/delight_mandi/blob/master/new-backend/routes/orders.js"
click node_auth "https://github.com/rakesh-mora/delight_mandi/blob/master/new-backend/middleware/auth.js"
click node_config "https://github.com/rakesh-mora/delight_mandi/blob/master/new-backend/config/index.js"
click node_db "https://github.com/rakesh-mora/delight_mandi/blob/master/new-backend/db.js"
click node_imagestore "https://github.com/rakesh-mora/delight_mandi/blob/master/new-backend/config/index.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_homepage,node_menupage,node_reviewsui toneBlue
class node_adminpage,node_adminlogin,node_admincontext,node_adminmenu,node_adminorders,node_adminreviews toneAmber
class node_apiclient,node_server,node_health,node_menuroutes,node_reviewroutes,node_orderroutes,node_auth,node_config toneMint
class node_db,node_imagestore toneRose
class node_visitor,node_adminuser,node_whatsapp toneIndigo
```

## Components

### Customer website

- [App routing](https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/App.js): `new-frontend/src/App.js`
- [Home sections](https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/App.js): `new-frontend/src/App.js`
- [Menu page](https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/components/MenuPage.js): `new-frontend/src/components/MenuPage.js`
- [Reviews and form](https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/components/Reviews.js): `new-frontend/src/components/Reviews.js`

### Administration

- [Admin page](https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/admin/AdminPage.js): `new-frontend/src/admin/AdminPage.js`
- [Admin login](https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/admin/AdminLogin.js): `new-frontend/src/admin/AdminLogin.js`
- [Admin session](https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/context/AdminContext.js): `new-frontend/src/context/AdminContext.js`
- [Menu management](https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/admin/AdminMenu.js): `new-frontend/src/admin/AdminMenu.js`
- [Order management](https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/admin/AdminOrders.js): `new-frontend/src/admin/AdminOrders.js`
- [Review management](https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/admin/AdminReviews.js): `new-frontend/src/admin/AdminReviews.js`

### REST API

- [API client](https://github.com/rakesh-mora/delight_mandi/blob/master/new-frontend/src/utils/api.js): `new-frontend/src/utils/api.js`
- [Express server](https://github.com/rakesh-mora/delight_mandi/blob/master/new-backend/server.js): `new-backend/server.js`
- [Health routes](https://github.com/rakesh-mora/delight_mandi/blob/master/new-backend/routes/health.js): `new-backend/routes/health.js`
- [Menu routes](https://github.com/rakesh-mora/delight_mandi/blob/master/new-backend/routes/menu.js): `new-backend/routes/menu.js`
- [Review routes](https://github.com/rakesh-mora/delight_mandi/blob/master/new-backend/routes/reviews.js): `new-backend/routes/reviews.js`
- [Order and cart routes](https://github.com/rakesh-mora/delight_mandi/blob/master/new-backend/routes/orders.js): `new-backend/routes/orders.js`
- [Admin authorization](https://github.com/rakesh-mora/delight_mandi/blob/master/new-backend/middleware/auth.js): `new-backend/middleware/auth.js`
- [Runtime configuration](https://github.com/rakesh-mora/delight_mandi/blob/master/new-backend/config/index.js): `new-backend/config/index.js`

### Data and media

- [PostgreSQL](https://github.com/rakesh-mora/delight_mandi/blob/master/new-backend/db.js): `new-backend/db.js`
- [Image files](https://github.com/rakesh-mora/delight_mandi/blob/master/new-backend/config/index.js): `new-backend/config/index.js`

### Other components

- **Visitor**
- **Administrator**
- **WhatsApp service**

## Connections

- Visitor → App routing: opens
- Administrator → App routing: opens
- App routing → Home sections: renders
- App routing → Menu page: routes to
- App routing → Admin page: routes to
- Home sections → Reviews and form: includes
- Admin page → Admin login: uses
- Admin page → Menu management: provides
- Admin page → Order management: provides
- Admin page → Review management: provides
- Admin login → Admin session: uses
- Review management → Admin session: reads key
- Reviews and form → Review routes: requests reviews
- Reviews and form → Review routes: submits review
- Review management → Review routes: admin requests
- Review management → API client: calls
- API client → Express server: sends requests
- Express server → Health routes: dispatches
- Express server → Menu routes: dispatches
- Express server → Review routes: dispatches
- Express server → Order and cart routes: dispatches
- Review routes → PostgreSQL: queries
- Review routes → Admin authorization: protects admin routes
- Express server → Runtime configuration: reads settings
- Express server → Image files: serves images
- Express server → PostgreSQL: checks connection
- Order and cart routes → WhatsApp service: cart integration
