# lalitmohit/chiller architecture

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

- Interactive diagram: https://gitdiagram.com/lalitmohit/chiller
- Repository: https://github.com/lalitmohit/chiller

## Overview

Vansh Aqua is a bilingual water-delivery site with public product and contact information, subscription and event ordering, and an admin order-management area. Customers submit order details and optional payment proof; admins authenticate to review and update orders. The backend persists orders and sends notifications, with optional Cloudinary image storage. Edges reflect shown code and SOURCE INDEX references; some frontend request paths and backend contact-mail behavior are supported only by the index, so unsampled details are not expanded.

Main entry points: [`frontend/src/App.jsx`](https://github.com/lalitmohit/chiller/blob/main/frontend/src/App.jsx) (Route shell), [`backend/server.js`](https://github.com/lalitmohit/chiller/blob/main/backend/server.js) (HTTP server), [`backend/src/routes/orders.js`](https://github.com/lalitmohit/chiller/blob/main/backend/src/routes/orders.js) (Order endpoints), [`frontend/src/api/client.js`](https://github.com/lalitmohit/chiller/blob/main/frontend/src/api/client.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Customer website"]
  node_app["Route shell<br/>[App.jsx]"]
  node_home["Home page<br/>[Home.jsx]"]
  node_products["Products page<br/>[Products.jsx]"]
  node_about["About page<br/>[About.jsx]"]
  node_contact_page["Contact page<br/>[Contact.jsx]"]
  node_order_page["Order form<br/>[Order.jsx]"]
  node_header["Navigation<br/>[Header.jsx]"]
  node_language["Language switcher"]
  node_i18n["Translations<br/>[i18n.js]"]
  node_api_client["API client<br/>[client.js]"]
end

subgraph group_admin["Admin experience"]
  node_login_page["Admin login<br/>[Login.jsx]"]
  node_auth_context["Auth state<br/>[AuthContext.jsx]"]
  node_protected["Route guard<br/>[ProtectedRoute.jsx]"]
  node_dashboard["Order dashboard<br/>[Dashboard.jsx]"]
end

subgraph group_api["Backend API"]
  node_server["HTTP server<br/>[server.js]"]
  node_auth_route["Login endpoint<br/>[auth.js]"]
  node_orders_route["Order endpoints<br/>[orders.js]"]
  node_contact_route["Contact endpoint<br/>[contact.js]"]
  node_auth_middleware["Admin verification<br/>[auth.js]"]
end

subgraph group_data["Persistence and services"]
  node_order_model[("Order records<br/>[Order.js]")]
  node_admin_model[("Admin records<br/>[Admin.js]")]
  node_db_connect["Mongo connection<br/>[db.js]"]
  node_cloudinary_config["Image uploader<br/>[cloudinary.js]"]
  node_mailer["Mail notifications<br/>[mailer.js]"]
end

node_customer(("Customer"))
node_admin_actor(("Administrator"))
node_mongo[("MongoDB")]
node_cloudinary["Cloudinary"]
node_email_service["Email service"]

node_customer -->|"visits"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_products
node_app -->|"routes to"| node_about
node_app -->|"routes to"| node_contact_page
node_app -->|"routes to"| node_order_page
node_app -->|"renders"| node_header
node_header -->|"renders"| node_language
node_app -->|"uses translations"| node_i18n
node_order_page -->|"submits order"| node_api_client
node_contact_page -->|"sends contact"| node_api_client
node_admin_actor -->|"signs in"| node_login_page
node_login_page -->|"requests login"| node_api_client
node_login_page -->|"stores session"| node_auth_context
node_app -->|"guards admin route"| node_protected
node_protected -->|"checks session"| node_auth_context
node_app -->|"routes after guard"| node_dashboard
node_dashboard -->|"loads and updates"| node_api_client
node_dashboard -->|"logs out"| node_auth_context
node_api_client -->|"sends API requests"| node_server
node_server -->|"connects before requests"| node_db_connect
node_server -->|"mounts orders"| node_orders_route
node_server -->|"mounts auth"| node_auth_route
node_server -->|"mounts contact"| node_contact_route
node_db_connect -->|"connects"| node_mongo
node_auth_route -->|"looks up admin"| node_admin_model
node_orders_route -->|"creates and queries"| node_order_model
node_orders_route -->|"protects admin routes"| node_auth_middleware
node_orders_route -->|"uploads proof"| node_cloudinary_config
node_cloudinary_config -.->|"configures uploader"| node_cloudinary
node_orders_route -->|"sends notification"| node_mailer
node_mailer -.->|"sends mail"| node_email_service
node_contact_route -.->|"handles contact mail"| node_mailer

click node_app "https://github.com/lalitmohit/chiller/blob/main/frontend/src/App.jsx"
click node_home "https://github.com/lalitmohit/chiller/blob/main/frontend/src/pages/Home.jsx"
click node_products "https://github.com/lalitmohit/chiller/blob/main/frontend/src/pages/Products.jsx"
click node_about "https://github.com/lalitmohit/chiller/blob/main/frontend/src/pages/About.jsx"
click node_contact_page "https://github.com/lalitmohit/chiller/blob/main/frontend/src/pages/Contact.jsx"
click node_order_page "https://github.com/lalitmohit/chiller/blob/main/frontend/src/pages/Order.jsx"
click node_header "https://github.com/lalitmohit/chiller/blob/main/frontend/src/components/Header.jsx"
click node_language "https://github.com/lalitmohit/chiller/blob/main/frontend/src/components/LanguageSwitcher.jsx"
click node_i18n "https://github.com/lalitmohit/chiller/blob/main/frontend/src/i18n.js"
click node_api_client "https://github.com/lalitmohit/chiller/blob/main/frontend/src/api/client.js"
click node_login_page "https://github.com/lalitmohit/chiller/blob/main/frontend/src/pages/admin/Login.jsx"
click node_auth_context "https://github.com/lalitmohit/chiller/blob/main/frontend/src/context/AuthContext.jsx"
click node_protected "https://github.com/lalitmohit/chiller/blob/main/frontend/src/components/ProtectedRoute.jsx"
click node_dashboard "https://github.com/lalitmohit/chiller/blob/main/frontend/src/pages/admin/Dashboard.jsx"
click node_server "https://github.com/lalitmohit/chiller/blob/main/backend/server.js"
click node_auth_route "https://github.com/lalitmohit/chiller/blob/main/backend/src/routes/auth.js"
click node_orders_route "https://github.com/lalitmohit/chiller/blob/main/backend/src/routes/orders.js"
click node_contact_route "https://github.com/lalitmohit/chiller/blob/main/backend/src/routes/contact.js"
click node_auth_middleware "https://github.com/lalitmohit/chiller/blob/main/backend/src/middleware/auth.js"
click node_order_model "https://github.com/lalitmohit/chiller/blob/main/backend/src/models/Order.js"
click node_admin_model "https://github.com/lalitmohit/chiller/blob/main/backend/src/models/Admin.js"
click node_db_connect "https://github.com/lalitmohit/chiller/blob/main/backend/src/config/db.js"
click node_cloudinary_config "https://github.com/lalitmohit/chiller/blob/main/backend/src/config/cloudinary.js"
click node_mailer "https://github.com/lalitmohit/chiller/blob/main/backend/src/config/mailer.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_products,node_about,node_contact_page,node_order_page,node_header,node_language,node_i18n,node_api_client toneBlue
class node_login_page,node_auth_context,node_protected,node_dashboard,node_mongo toneAmber
class node_server,node_auth_route,node_orders_route,node_contact_route,node_auth_middleware toneMint
class node_order_model,node_admin_model,node_db_connect,node_cloudinary_config,node_mailer toneRose
class node_customer,node_admin_actor,node_cloudinary,node_email_service toneIndigo
```

## Components

### Customer website

- [Route shell](https://github.com/lalitmohit/chiller/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Home page](https://github.com/lalitmohit/chiller/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Products page](https://github.com/lalitmohit/chiller/blob/main/frontend/src/pages/Products.jsx): `frontend/src/pages/Products.jsx`
- [About page](https://github.com/lalitmohit/chiller/blob/main/frontend/src/pages/About.jsx): `frontend/src/pages/About.jsx`
- [Contact page](https://github.com/lalitmohit/chiller/blob/main/frontend/src/pages/Contact.jsx): `frontend/src/pages/Contact.jsx`
- [Order form](https://github.com/lalitmohit/chiller/blob/main/frontend/src/pages/Order.jsx): `frontend/src/pages/Order.jsx`
- [Navigation](https://github.com/lalitmohit/chiller/blob/main/frontend/src/components/Header.jsx): `frontend/src/components/Header.jsx`
- [Language switcher](https://github.com/lalitmohit/chiller/blob/main/frontend/src/components/LanguageSwitcher.jsx): `frontend/src/components/LanguageSwitcher.jsx`
- [Translations](https://github.com/lalitmohit/chiller/blob/main/frontend/src/i18n.js): `frontend/src/i18n.js`
- [API client](https://github.com/lalitmohit/chiller/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`

### Admin experience

- [Admin login](https://github.com/lalitmohit/chiller/blob/main/frontend/src/pages/admin/Login.jsx): `frontend/src/pages/admin/Login.jsx`
- [Auth state](https://github.com/lalitmohit/chiller/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Route guard](https://github.com/lalitmohit/chiller/blob/main/frontend/src/components/ProtectedRoute.jsx): `frontend/src/components/ProtectedRoute.jsx`
- [Order dashboard](https://github.com/lalitmohit/chiller/blob/main/frontend/src/pages/admin/Dashboard.jsx): `frontend/src/pages/admin/Dashboard.jsx`

### Backend API

- [HTTP server](https://github.com/lalitmohit/chiller/blob/main/backend/server.js): `backend/server.js`
- [Login endpoint](https://github.com/lalitmohit/chiller/blob/main/backend/src/routes/auth.js): `backend/src/routes/auth.js`
- [Order endpoints](https://github.com/lalitmohit/chiller/blob/main/backend/src/routes/orders.js): `backend/src/routes/orders.js`
- [Contact endpoint](https://github.com/lalitmohit/chiller/blob/main/backend/src/routes/contact.js): `backend/src/routes/contact.js`
- [Admin verification](https://github.com/lalitmohit/chiller/blob/main/backend/src/middleware/auth.js): `backend/src/middleware/auth.js`

### Persistence and services

- [Order records](https://github.com/lalitmohit/chiller/blob/main/backend/src/models/Order.js): `backend/src/models/Order.js`
- [Admin records](https://github.com/lalitmohit/chiller/blob/main/backend/src/models/Admin.js): `backend/src/models/Admin.js`
- [Mongo connection](https://github.com/lalitmohit/chiller/blob/main/backend/src/config/db.js): `backend/src/config/db.js`
- [Image uploader](https://github.com/lalitmohit/chiller/blob/main/backend/src/config/cloudinary.js): `backend/src/config/cloudinary.js`
- [Mail notifications](https://github.com/lalitmohit/chiller/blob/main/backend/src/config/mailer.js): `backend/src/config/mailer.js`

### Other components

- **Customer**
- **Administrator**
- **MongoDB**
- **Cloudinary**
- **Email service**

## Connections

- Customer → Route shell: visits (evidence: `frontend/src/App.jsx`)
- Route shell → Home page: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → Products page: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → About page: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → Contact page: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → Order form: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → Navigation: renders (evidence: `frontend/src/App.jsx`)
- Navigation → Language switcher: renders (evidence: `frontend/src/components/Header.jsx`)
- Route shell → Translations: uses translations (evidence: `frontend/src/main.jsx`)
- Order form → API client: submits order (evidence: `frontend/src/pages/Order.jsx`)
- Contact page → API client: sends contact (evidence: `frontend/src/pages/Contact.jsx`)
- Administrator → Admin login: signs in (evidence: `frontend/src/pages/admin/Login.jsx`)
- Admin login → API client: requests login (evidence: `frontend/src/pages/admin/Login.jsx`)
- Admin login → Auth state: stores session (evidence: `frontend/src/pages/admin/Login.jsx`)
- Route shell → Route guard: guards admin route (evidence: `frontend/src/App.jsx`)
- Route guard → Auth state: checks session (evidence: `frontend/src/components/ProtectedRoute.jsx`)
- Route shell → Order dashboard: routes after guard (evidence: `frontend/src/App.jsx`)
- Order dashboard → API client: loads and updates (evidence: `frontend/src/pages/admin/Dashboard.jsx`)
- Order dashboard → Auth state: logs out (evidence: `frontend/src/pages/admin/Dashboard.jsx`)
- API client → HTTP server: sends API requests (evidence: `frontend/src/api/client.js`)
- HTTP server → Mongo connection: connects before requests (evidence: `backend/server.js`)
- HTTP server → Order endpoints: mounts orders (evidence: `backend/server.js`)
- HTTP server → Login endpoint: mounts auth (evidence: `backend/server.js`)
- HTTP server → Contact endpoint: mounts contact (evidence: `backend/server.js`)
- Mongo connection → MongoDB: connects (evidence: `backend/src/config/db.js`)
- Login endpoint → Admin records: looks up admin (evidence: `backend/src/routes/auth.js`)
- Order endpoints → Order records: creates and queries (evidence: `backend/src/routes/orders.js`)
- Order endpoints → Admin verification: protects admin routes (evidence: `backend/src/routes/orders.js`)
- Order endpoints → Image uploader: uploads proof (evidence: `backend/src/routes/orders.js`)
- Image uploader → Cloudinary: configures uploader
- Order endpoints → Mail notifications: sends notification (evidence: `backend/src/routes/orders.js`)
- Mail notifications → Email service: sends mail
- Contact endpoint → Mail notifications: handles contact mail
