# subhash8729/goldenzone architecture

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

- Interactive diagram: https://gitdiagram.com/subhash8729/goldenzone
- Repository: https://github.com/subhash8729/goldenzone

## Overview

Golden Zone is a jewellery storefront with a separate authenticated admin dashboard, backed by an Express REST API and MySQL. The customer workflow spans browsing products, managing a cart and account, placing prepaid orders, and tracking them; admins manage orders, catalog, payments, reviews, customers, and site settings. The graph includes documented Razorpay and contact capabilities. Some routes and page implementations were not sampled, so their internal connections are shown only where README or indexed references support them.

Main entry points: [`server/src/app.js`](https://github.com/subhash8729/goldenzone/blob/main/server/src/app.js) (API Application), [`server/src/config/db.js`](https://github.com/subhash8729/goldenzone/blob/main/server/src/config/db.js) (MySQL), [`client/src/App.jsx`](https://github.com/subhash8729/goldenzone/blob/main/client/src/App.jsx) (Storefront Routes), [`client/src/pages/CheckoutPage.jsx`](https://github.com/subhash8729/goldenzone/blob/main/client/src/pages/CheckoutPage.jsx) (Shop and Checkout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Customer Storefront"]
  node_storefront_app["Storefront Routes<br/>[App.jsx]"]
  node_storefront_pages["Shop and Checkout<br/>[CheckoutPage.jsx]"]
  node_customer_auth["Customer Auth<br/>[AuthContext.jsx]"]
  node_cart["Cart State<br/>[CartContext.jsx]"]
  node_customer_api["Storefront API Client<br/>[api.js]"]
  node_contact["Contact Enquiries<br/>[ContactPage.jsx]"]
end

subgraph group_admin["Admin Dashboard"]
  node_admin_app["Admin Routes<br/>[App.jsx]"]
  node_admin_auth["Admin Auth"]
  node_admin_pages["Admin Operations<br/>[OrdersPage.jsx]"]
  node_admin_api["Admin API Client<br/>[api.js]"]
end

subgraph group_api["REST API"]
  node_express_app["API Application<br/>[app.js]"]
  node_auth_routes["Auth Routes<br/>[authRoutes.js]"]
  node_product_routes["Product Routes<br/>[productRoutes.js]"]
  node_order_routes["Order Routes<br/>[orderRoutes.js]"]
  node_review_routes["Review Routes<br/>[reviewRoutes.js]"]
end

subgraph group_domain["Commerce Services"]
  node_auth_logic["Authentication<br/>[authController.js]"]
  node_catalog_logic["Catalog"]
  node_order_logic["Order Processing<br/>[orderController.js]"]
  node_payment_logic["Payment Verification"]
  node_reviews_logic["Review Moderation"]
end

subgraph group_infra["Data and Integrations"]
  node_database[("MySQL<br/>[db.js]")]
  node_razorpay_service["Razorpay Service<br/>[razorpayService.js]"]
  node_otp_service["OTP Service<br/>[otpService.js]"]
end

node_customer(("Customer"))
node_admin_user(("Administrator"))
node_razorpay["Razorpay"]
node_sms["Renflair SMS"]

node_customer -->|"uses"| node_storefront_app
node_storefront_app -->|"routes to"| node_storefront_pages
node_storefront_app -->|"provides"| node_customer_auth
node_storefront_app -->|"provides"| node_cart
node_storefront_pages -->|"reads"| node_cart
node_storefront_pages -->|"reads"| node_customer_auth
node_customer_auth -->|"calls"| node_customer_api
node_storefront_pages -->|"calls"| node_customer_api
node_contact -->|"submits enquiry"| node_customer_api
node_customer_api -->|"requests API"| node_express_app
node_admin_user -->|"uses"| node_admin_app
node_admin_app -->|"checks session"| node_admin_auth
node_admin_app -->|"routes to"| node_admin_pages
node_admin_auth -->|"calls"| node_admin_api
node_admin_api -->|"requests API"| node_express_app
node_express_app -->|"mounts"| node_auth_routes
node_express_app -->|"mounts"| node_product_routes
node_express_app -->|"mounts"| node_order_routes
node_express_app -.->|"mounts"| node_review_routes
node_auth_routes -->|"dispatches"| node_auth_logic
node_product_routes -->|"dispatches"| node_catalog_logic
node_order_routes -->|"dispatches"| node_order_logic
node_review_routes -->|"dispatches"| node_reviews_logic
node_auth_logic -->|"queries"| node_database
node_catalog_logic -.->|"queries"| node_database
node_order_logic -->|"queries"| node_database
node_order_logic -->|"creates orders"| node_razorpay_service
node_payment_logic -->|"queries"| node_database
node_payment_logic -->|"verifies payments"| node_razorpay_service
node_reviews_logic -->|"queries"| node_database
node_razorpay_service -->|"integrates"| node_razorpay
node_auth_logic -->|"uses"| node_otp_service
node_otp_service -.->|"sends OTP"| node_sms

click node_storefront_app "https://github.com/subhash8729/goldenzone/blob/main/client/src/App.jsx"
click node_storefront_pages "https://github.com/subhash8729/goldenzone/blob/main/client/src/pages/CheckoutPage.jsx"
click node_customer_auth "https://github.com/subhash8729/goldenzone/blob/main/client/src/context/AuthContext.jsx"
click node_cart "https://github.com/subhash8729/goldenzone/blob/main/client/src/context/CartContext.jsx"
click node_customer_api "https://github.com/subhash8729/goldenzone/blob/main/client/src/services/api.js"
click node_contact "https://github.com/subhash8729/goldenzone/blob/main/client/src/pages/ContactPage.jsx"
click node_admin_app "https://github.com/subhash8729/goldenzone/blob/main/admin/src/App.jsx"
click node_admin_auth "https://github.com/subhash8729/goldenzone/blob/main/admin/src/context/AdminAuthContext.jsx"
click node_admin_pages "https://github.com/subhash8729/goldenzone/blob/main/admin/src/pages/OrdersPage.jsx"
click node_admin_api "https://github.com/subhash8729/goldenzone/blob/main/admin/src/services/api.js"
click node_express_app "https://github.com/subhash8729/goldenzone/blob/main/server/src/app.js"
click node_auth_routes "https://github.com/subhash8729/goldenzone/blob/main/server/src/routes/authRoutes.js"
click node_product_routes "https://github.com/subhash8729/goldenzone/blob/main/server/src/routes/productRoutes.js"
click node_order_routes "https://github.com/subhash8729/goldenzone/blob/main/server/src/routes/orderRoutes.js"
click node_review_routes "https://github.com/subhash8729/goldenzone/blob/main/server/src/routes/reviewRoutes.js"
click node_auth_logic "https://github.com/subhash8729/goldenzone/blob/main/server/src/controllers/authController.js"
click node_catalog_logic "https://github.com/subhash8729/goldenzone/blob/main/server/src/controllers/productController.js"
click node_order_logic "https://github.com/subhash8729/goldenzone/blob/main/server/src/controllers/orderController.js"
click node_payment_logic "https://github.com/subhash8729/goldenzone/blob/main/server/src/controllers/paymentController.js"
click node_reviews_logic "https://github.com/subhash8729/goldenzone/blob/main/server/src/controllers/reviewController.js"
click node_database "https://github.com/subhash8729/goldenzone/blob/main/server/src/config/db.js"
click node_razorpay_service "https://github.com/subhash8729/goldenzone/blob/main/server/src/services/razorpayService.js"
click node_otp_service "https://github.com/subhash8729/goldenzone/blob/main/server/src/services/otpService.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_storefront_app,node_storefront_pages,node_customer_auth,node_cart,node_customer_api,node_contact toneBlue
class node_admin_app,node_admin_auth,node_admin_pages,node_admin_api toneAmber
class node_express_app,node_auth_routes,node_product_routes,node_order_routes,node_review_routes toneMint
class node_auth_logic,node_catalog_logic,node_order_logic,node_payment_logic,node_reviews_logic toneRose
class node_database,node_razorpay_service,node_otp_service,node_customer,node_admin_user,node_razorpay,node_sms toneIndigo
```

## Components

### Customer Storefront

- [Storefront Routes](https://github.com/subhash8729/goldenzone/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Shop and Checkout](https://github.com/subhash8729/goldenzone/blob/main/client/src/pages/CheckoutPage.jsx): `client/src/pages/CheckoutPage.jsx`
- [Customer Auth](https://github.com/subhash8729/goldenzone/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [Cart State](https://github.com/subhash8729/goldenzone/blob/main/client/src/context/CartContext.jsx): `client/src/context/CartContext.jsx`
- [Storefront API Client](https://github.com/subhash8729/goldenzone/blob/main/client/src/services/api.js): `client/src/services/api.js`
- [Contact Enquiries](https://github.com/subhash8729/goldenzone/blob/main/client/src/pages/ContactPage.jsx): `client/src/pages/ContactPage.jsx`

### Admin Dashboard

- [Admin Routes](https://github.com/subhash8729/goldenzone/blob/main/admin/src/App.jsx): `admin/src/App.jsx`
- [Admin Auth](https://github.com/subhash8729/goldenzone/blob/main/admin/src/context/AdminAuthContext.jsx): `admin/src/context/AdminAuthContext.jsx`
- [Admin Operations](https://github.com/subhash8729/goldenzone/blob/main/admin/src/pages/OrdersPage.jsx): `admin/src/pages/OrdersPage.jsx`
- [Admin API Client](https://github.com/subhash8729/goldenzone/blob/main/admin/src/services/api.js): `admin/src/services/api.js`

### REST API

- [API Application](https://github.com/subhash8729/goldenzone/blob/main/server/src/app.js): `server/src/app.js`
- [Auth Routes](https://github.com/subhash8729/goldenzone/blob/main/server/src/routes/authRoutes.js): `server/src/routes/authRoutes.js`
- [Product Routes](https://github.com/subhash8729/goldenzone/blob/main/server/src/routes/productRoutes.js): `server/src/routes/productRoutes.js`
- [Order Routes](https://github.com/subhash8729/goldenzone/blob/main/server/src/routes/orderRoutes.js): `server/src/routes/orderRoutes.js`
- [Review Routes](https://github.com/subhash8729/goldenzone/blob/main/server/src/routes/reviewRoutes.js): `server/src/routes/reviewRoutes.js`

### Commerce Services

- [Authentication](https://github.com/subhash8729/goldenzone/blob/main/server/src/controllers/authController.js): `server/src/controllers/authController.js`
- [Catalog](https://github.com/subhash8729/goldenzone/blob/main/server/src/controllers/productController.js): `server/src/controllers/productController.js`
- [Order Processing](https://github.com/subhash8729/goldenzone/blob/main/server/src/controllers/orderController.js): `server/src/controllers/orderController.js`
- [Payment Verification](https://github.com/subhash8729/goldenzone/blob/main/server/src/controllers/paymentController.js): `server/src/controllers/paymentController.js`
- [Review Moderation](https://github.com/subhash8729/goldenzone/blob/main/server/src/controllers/reviewController.js): `server/src/controllers/reviewController.js`

### Data and Integrations

- [MySQL](https://github.com/subhash8729/goldenzone/blob/main/server/src/config/db.js): `server/src/config/db.js`
- [Razorpay Service](https://github.com/subhash8729/goldenzone/blob/main/server/src/services/razorpayService.js): `server/src/services/razorpayService.js`
- [OTP Service](https://github.com/subhash8729/goldenzone/blob/main/server/src/services/otpService.js): `server/src/services/otpService.js`

### Other components

- **Customer**
- **Administrator**
- **Razorpay**
- **Renflair SMS**

## Connections

- Customer → Storefront Routes: uses (evidence: `README.md`)
- Storefront Routes → Shop and Checkout: routes to (evidence: `client/src/App.jsx`)
- Storefront Routes → Customer Auth: provides (evidence: `client/src/App.jsx`)
- Storefront Routes → Cart State: provides (evidence: `client/src/App.jsx`)
- Shop and Checkout → Cart State: reads (evidence: `client/src/pages/CheckoutPage.jsx`)
- Shop and Checkout → Customer Auth: reads (evidence: `client/src/pages/CheckoutPage.jsx`)
- Customer Auth → Storefront API Client: calls (evidence: `client/src/context/AuthContext.jsx`)
- Shop and Checkout → Storefront API Client: calls (evidence: `client/src/pages/CheckoutPage.jsx`)
- Contact Enquiries → Storefront API Client: submits enquiry (evidence: `client/src/pages/ContactPage.jsx`)
- Storefront API Client → API Application: requests API (evidence: `README.md`)
- Administrator → Admin Routes: uses (evidence: `README.md`)
- Admin Routes → Admin Auth: checks session (evidence: `admin/src/App.jsx`)
- Admin Routes → Admin Operations: routes to (evidence: `admin/src/App.jsx`)
- Admin Auth → Admin API Client: calls (evidence: `admin/src/context/AdminAuthContext.jsx`)
- Admin API Client → API Application: requests API (evidence: `README.md`)
- API Application → Auth Routes: mounts (evidence: `server/src/app.js`)
- API Application → Product Routes: mounts (evidence: `server/src/app.js`)
- API Application → Order Routes: mounts (evidence: `server/src/app.js`)
- API Application → Review Routes: mounts (evidence: `server/src/app.js`)
- Auth Routes → Authentication: dispatches (evidence: `server/src/routes/authRoutes.js`)
- Product Routes → Catalog: dispatches (evidence: `server/src/routes/productRoutes.js`)
- Order Routes → Order Processing: dispatches (evidence: `server/src/routes/orderRoutes.js`)
- Review Routes → Review Moderation: dispatches (evidence: `server/src/routes/reviewRoutes.js`)
- Authentication → MySQL: queries (evidence: `server/src/controllers/authController.js`)
- Catalog → MySQL: queries
- Order Processing → MySQL: queries (evidence: `server/src/controllers/orderController.js`)
- Order Processing → Razorpay Service: creates orders (evidence: `server/src/controllers/orderController.js`)
- Payment Verification → MySQL: queries (evidence: `server/src/controllers/paymentController.js`)
- Payment Verification → Razorpay Service: verifies payments (evidence: `server/src/controllers/paymentController.js`)
- Review Moderation → MySQL: queries (evidence: `server/src/controllers/reviewController.js`)
- Razorpay Service → Razorpay: integrates (evidence: `README.md`)
- Authentication → OTP Service: uses (evidence: `server/src/controllers/authController.js`)
- OTP Service → Renflair SMS: sends OTP
