# namburivivek/ofoods26-ecommerce architecture

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

- Interactive diagram: https://gitdiagram.com/namburivivek/ofoods26-ecommerce
- Repository: https://github.com/namburivivek/ofoods26-ecommerce

## Overview

O Foods is a food-commerce platform whose main customer journey runs from product discovery through cart and checkout to order confirmation, with home-delivery or store-pickup choices and online payment. The frontend is a collection of HTML pages backed by an Express API in one server file. The README documents authentication, product and order management, reviews, notifications, and admin operations; several of those backend capabilities are represented by responsibilities within that monolithic file. Source excerpts are partial, so unshown implementation-level links are limited to documented relationships.

Main entry points: [`backend/server.js`](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/backend/server.js) (Express API), [`frontend/Checkout.html`](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/Checkout.html) (Checkout), [`frontend/all-items.html`](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/all-items.html) (Product browsing), [`frontend/price-sync.js`](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/price-sync.js) (Live price sync)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shopping["Customer shopping"]
  node_browse["Product browsing<br/>[all-items.html]"]
  node_product["Product details<br/>[product.html]"]
  node_cart["Shopping cart<br/>[cart.html]"]
  node_checkout["Checkout<br/>[Checkout.html]"]
  node_confirmation["Order confirmation<br/>[conformation.html]"]
  node_reviews["Reviews and ratings<br/>[review.html]"]
end

subgraph group_accounts["Accounts and preferences"]
  node_delivery["Delivery preferences<br/>[delivery-mode.js]"]
  node_dateutils["Pickup date utilities<br/>[date-utils.js]"]
  node_login["Customer accounts<br/>[login.html]"]
  node_profile["Profile and addresses<br/>[profile.html]"]
  node_auth["Authentication<br/>[server.js]"]
end

subgraph group_commerce["Commerce services"]
  node_price_sync["Live price sync<br/>[price-sync.js]"]
  node_api["Express API<br/>[server.js]"]
  node_catalog["Catalog management<br/>[server.js]"]
  node_orders["Order management<br/>[server.js]"]
  node_payments["Payment processing<br/>[server.js]"]
  node_review_service["Review service<br/>[server.js]"]
end

subgraph group_operations["Business operations"]
  node_admin["Admin dashboard<br/>[Admin.html]"]
  node_admin_login["Admin authentication<br/>[Admin login.html]"]
  node_fulfillment["Shipment and pickup<br/>[server.js]"]
  node_notifications["Order notifications<br/>[server.js]"]
end

node_customer(("Customer"))
node_mysql[("MySQL")]
node_razorpay["Razorpay"]
node_email_sms["Email and SMS"]

node_customer -->|"browses"| node_browse
node_browse -->|"opens details"| node_product
node_customer -->|"manages cart"| node_cart
node_customer -->|"places order"| node_checkout
node_checkout -->|"selects mode"| node_delivery
node_checkout -->|"schedules pickup"| node_dateutils
node_checkout -->|"confirms order"| node_confirmation
node_customer -->|"registers or signs in"| node_login
node_customer -->|"manages profile"| node_profile
node_customer -->|"writes reviews"| node_reviews
node_price_sync -->|"fetches live prices"| node_api
node_browse -.->|"patches prices"| node_price_sync
node_product -.->|"patches prices"| node_price_sync
node_checkout -->|"submits requests"| node_api
node_login -->|"calls REST API"| node_api
node_profile -->|"calls REST API"| node_api
node_reviews -->|"calls REST API"| node_api
node_admin_login -.->|"authenticates access"| node_admin
node_admin -->|"manages business data"| node_api
node_api -->|"handles authentication"| node_auth
node_api -->|"serves catalog"| node_catalog
node_api -->|"handles orders"| node_orders
node_api -->|"processes payments"| node_payments
node_api -->|"supports reviews"| node_review_service
node_api -->|"updates fulfillment"| node_fulfillment
node_api -->|"sends order notices"| node_notifications
node_api -->|"queries data"| node_mysql
node_payments -.->|"uses gateway"| node_razorpay
node_notifications -->|"sends messages"| node_email_sms

click node_browse "https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/all-items.html"
click node_product "https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/product.html"
click node_cart "https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/cart.html"
click node_checkout "https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/Checkout.html"
click node_confirmation "https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/conformation.html"
click node_delivery "https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/delivery-mode.js"
click node_dateutils "https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/date-utils.js"
click node_login "https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/login.html"
click node_profile "https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/profile.html"
click node_reviews "https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/review.html"
click node_price_sync "https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/price-sync.js"
click node_api "https://github.com/namburivivek/ofoods26-ecommerce/blob/main/backend/server.js"
click node_auth "https://github.com/namburivivek/ofoods26-ecommerce/blob/main/backend/server.js"
click node_catalog "https://github.com/namburivivek/ofoods26-ecommerce/blob/main/backend/server.js"
click node_orders "https://github.com/namburivivek/ofoods26-ecommerce/blob/main/backend/server.js"
click node_payments "https://github.com/namburivivek/ofoods26-ecommerce/blob/main/backend/server.js"
click node_review_service "https://github.com/namburivivek/ofoods26-ecommerce/blob/main/backend/server.js"
click node_admin "https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/Admin.html"
click node_admin_login "https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/Admin%20login.html"
click node_fulfillment "https://github.com/namburivivek/ofoods26-ecommerce/blob/main/backend/server.js"
click node_notifications "https://github.com/namburivivek/ofoods26-ecommerce/blob/main/backend/server.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_browse,node_product,node_cart,node_checkout,node_confirmation,node_reviews toneBlue
class node_delivery,node_dateutils,node_login,node_profile,node_auth,node_mysql toneAmber
class node_price_sync,node_api,node_catalog,node_orders,node_payments,node_review_service toneMint
class node_admin,node_admin_login,node_fulfillment,node_notifications toneRose
class node_customer,node_razorpay,node_email_sms toneIndigo
```

## Components

### Customer shopping

- [Product browsing](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/all-items.html): `frontend/all-items.html`
- [Product details](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/product.html): `frontend/product.html`
- [Shopping cart](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/cart.html): `frontend/cart.html`
- [Checkout](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/Checkout.html): `frontend/Checkout.html`
- [Order confirmation](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/conformation.html): `frontend/conformation.html`
- [Reviews and ratings](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/review.html): `frontend/review.html`

### Accounts and preferences

- [Delivery preferences](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/delivery-mode.js): `frontend/delivery-mode.js`
- [Pickup date utilities](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/date-utils.js): `frontend/date-utils.js`
- [Customer accounts](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/login.html): `frontend/login.html`
- [Profile and addresses](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/profile.html): `frontend/profile.html`
- [Authentication](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/backend/server.js): `backend/server.js`

### Commerce services

- [Live price sync](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/price-sync.js): `frontend/price-sync.js`
- [Express API](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/backend/server.js): `backend/server.js`
- [Catalog management](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/backend/server.js): `backend/server.js`
- [Order management](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/backend/server.js): `backend/server.js`
- [Payment processing](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/backend/server.js): `backend/server.js`
- [Review service](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/backend/server.js): `backend/server.js`

### Business operations

- [Admin dashboard](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/Admin.html): `frontend/Admin.html`
- [Admin authentication](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/frontend/Admin%20login.html): `frontend/Admin login.html`
- [Shipment and pickup](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/backend/server.js): `backend/server.js`
- [Order notifications](https://github.com/namburivivek/ofoods26-ecommerce/blob/main/backend/server.js): `backend/server.js`

### Other components

- **Customer**
- **MySQL**
- **Razorpay**
- **Email and SMS**

## Connections

- Customer → Product browsing: browses (evidence: `README.md`)
- Product browsing → Product details: opens details (evidence: `README.md`)
- Customer → Shopping cart: manages cart (evidence: `README.md`)
- Customer → Checkout: places order (evidence: `README.md`)
- Checkout → Delivery preferences: selects mode (evidence: `README.md`)
- Checkout → Pickup date utilities: schedules pickup (evidence: `README.md`)
- Checkout → Order confirmation: confirms order (evidence: `README.md`)
- Customer → Customer accounts: registers or signs in (evidence: `README.md`)
- Customer → Profile and addresses: manages profile (evidence: `README.md`)
- Customer → Reviews and ratings: writes reviews (evidence: `README.md`)
- Live price sync → Express API: fetches live prices (evidence: `frontend/price-sync.js`)
- Product browsing → Live price sync: patches prices
- Product details → Live price sync: patches prices
- Checkout → Express API: submits requests (evidence: `README.md`)
- Customer accounts → Express API: calls REST API (evidence: `README.md`)
- Profile and addresses → Express API: calls REST API (evidence: `README.md`)
- Reviews and ratings → Express API: calls REST API (evidence: `README.md`)
- Admin authentication → Admin dashboard: authenticates access
- Admin dashboard → Express API: manages business data (evidence: `README.md`)
- Express API → Authentication: handles authentication (evidence: `backend/server.js`)
- Express API → Catalog management: serves catalog (evidence: `README.md`)
- Express API → Order management: handles orders (evidence: `backend/server.js`)
- Express API → Payment processing: processes payments (evidence: `README.md`)
- Express API → Review service: supports reviews (evidence: `README.md`)
- Express API → Shipment and pickup: updates fulfillment (evidence: `backend/server.js`)
- Express API → Order notifications: sends order notices (evidence: `backend/server.js`)
- Express API → MySQL: queries data (evidence: `backend/server.js`)
- Payment processing → Razorpay: uses gateway
- Order notifications → Email and SMS: sends messages (evidence: `README.md`)
