# supesh10/welcomecraft architecture

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

- Interactive diagram: https://gitdiagram.com/supesh10/welcomecraft
- Repository: https://github.com/supesh10/welcomecraft

## Overview

Welcome-Craft is a Buddhist handicraft storefront with a React client and Express/MongoDB API. Customers browse categorized products, manage a cart, provide checkout details, and complete ordering through WhatsApp; administrators manage catalog and orders behind JWT access. Silver pricing is a distinct automated capability: scraping feeds stored daily prices, history, and dynamic silver-product calculations. The graph combines sampled calls with README-documented capabilities; unsampled route/controller wiring is not inferred.

Main entry points: [`backend/app.js`](https://github.com/supesh10/welcomecraft/blob/main/backend/app.js) (Express API), [`frontend/src/App.js`](https://github.com/supesh10/welcomecraft/blob/main/frontend/src/App.js) (React App), [`frontend/src/services/apiService.js`](https://github.com/supesh10/welcomecraft/blob/main/frontend/src/services/apiService.js) (API Client), [`backend/src/Controller/cartController.js`](https://github.com/supesh10/welcomecraft/blob/main/backend/src/Controller/cartController.js) (Cart And WhatsApp Orders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Customer Storefront"]
  node_app["React App<br/>[App.js]"]
  node_api["API Client<br/>[apiService.js]"]
  node_browse["Product Browsing<br/>[ProductsPage.js]"]
  node_home["Home And About<br/>[HomePage.js]"]
  node_productdetail["Product Details"]
  node_cartui["Cart<br/>[CartPage.js]"]
  node_checkoutui["Checkout<br/>[CheckoutPage.js]"]
end

subgraph group_commerce["Catalog And Orders"]
  node_productcontroller["Product Management"]
  node_categorycontroller["Category Management"]
  node_cartcontroller["Cart And WhatsApp Orders<br/>[cartController.js]"]
  node_ordercontroller["Order Management<br/>[orderController.js]"]
  node_messaging["WhatsApp Messaging"]
end

subgraph group_pricing["Metal Pricing"]
  node_silvercontroller["Silver Price API"]
  node_silverscraper["Silver Scraper"]
  node_goldcontroller["Gold Price API"]
  node_cron["Price Scheduler<br/>[cron.js]"]
end

subgraph group_admin["Administration"]
  node_dashboard["Admin Dashboard<br/>[AdminDashboard.js]"]
  node_login["Admin Login<br/>[AdminLogin.js]"]
  node_auth["JWT Authentication<br/>[authMiddleware.js]"]
end

subgraph group_platform["API And Persistence"]
  node_server["Express API<br/>[app.js]"]
  node_database[("MongoDB<br/>[db.js]")]
  node_productmodel[("Product Records<br/>[productModel.js]")]
  node_categorymodel[("Category Records<br/>[categoryModel.js]")]
  node_silvermodel[("Silver Price Records")]
end

node_customer(("Customer"))

node_customer -->|"uses"| node_app
node_app -->|"routes to"| node_browse
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_productdetail
node_app -->|"routes to"| node_cartui
node_app -->|"routes to"| node_checkoutui
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_login
node_browse -->|"requests catalog"| node_api
node_productdetail -->|"requests product"| node_api
node_cartui -->|"updates cart"| node_api
node_checkoutui -->|"submits checkout"| node_api
node_dashboard -->|"manages records"| node_api
node_login -->|"authenticates"| node_api
node_api -->|"calls API"| node_server
node_server -->|"connects"| node_database
node_server -->|"starts"| node_cron
node_server -.->|"routes products"| node_productcontroller
node_server -.->|"routes categories"| node_categorycontroller
node_server -.->|"routes cart"| node_cartcontroller
node_server -.->|"routes orders"| node_ordercontroller
node_server -.->|"routes silver"| node_silvercontroller
node_server -.->|"routes gold"| node_goldcontroller
node_cartcontroller -->|"generates order link"| node_messaging
node_cartcontroller -->|"reads products"| node_productmodel
node_cartcontroller -.->|"prices silver"| node_silvermodel
node_productcontroller -->|"validates category"| node_categorymodel
node_productcontroller -->|"writes products"| node_productmodel
node_categorycontroller -->|"manages categories"| node_categorymodel
node_categorycontroller -->|"counts products"| node_productmodel
node_silvercontroller -->|"scrapes prices"| node_silverscraper
node_silvercontroller -->|"stores history"| node_silvermodel
node_cron -->|"schedules scraping"| node_silvercontroller
node_cron -->|"schedules updates"| node_goldcontroller
node_dashboard -.->|"uses protected access"| node_auth
node_ordercontroller -.->|"notifies admin"| node_messaging

click node_app "https://github.com/supesh10/welcomecraft/blob/main/frontend/src/App.js"
click node_api "https://github.com/supesh10/welcomecraft/blob/main/frontend/src/services/apiService.js"
click node_browse "https://github.com/supesh10/welcomecraft/blob/main/frontend/src/components/ProductsPage.js"
click node_home "https://github.com/supesh10/welcomecraft/blob/main/frontend/src/components/HomePage.js"
click node_productdetail "https://github.com/supesh10/welcomecraft/blob/main/frontend/src/components/SingleProductPage.js"
click node_cartui "https://github.com/supesh10/welcomecraft/blob/main/frontend/src/components/CartPage.js"
click node_checkoutui "https://github.com/supesh10/welcomecraft/blob/main/frontend/src/components/CheckoutPage.js"
click node_productcontroller "https://github.com/supesh10/welcomecraft/blob/main/backend/src/Controller/productController.js"
click node_categorycontroller "https://github.com/supesh10/welcomecraft/blob/main/backend/src/Controller/categoryController.js"
click node_cartcontroller "https://github.com/supesh10/welcomecraft/blob/main/backend/src/Controller/cartController.js"
click node_ordercontroller "https://github.com/supesh10/welcomecraft/blob/main/backend/src/Controller/orderController.js"
click node_messaging "https://github.com/supesh10/welcomecraft/blob/main/backend/src/Services/messagingService.js"
click node_silvercontroller "https://github.com/supesh10/welcomecraft/blob/main/backend/src/Controller/silverPriceController.js"
click node_silverscraper "https://github.com/supesh10/welcomecraft/blob/main/backend/src/Services/silverPriceScraper.js"
click node_goldcontroller "https://github.com/supesh10/welcomecraft/blob/main/backend/src/Controller/goldPriceController.js"
click node_cron "https://github.com/supesh10/welcomecraft/blob/main/backend/src/Services/cron.js"
click node_dashboard "https://github.com/supesh10/welcomecraft/blob/main/frontend/src/components/admin/AdminDashboard.js"
click node_login "https://github.com/supesh10/welcomecraft/blob/main/frontend/src/components/admin/AdminLogin.js"
click node_auth "https://github.com/supesh10/welcomecraft/blob/main/backend/src/Middleware/authMiddleware.js"
click node_server "https://github.com/supesh10/welcomecraft/blob/main/backend/app.js"
click node_database "https://github.com/supesh10/welcomecraft/blob/main/backend/src/Config/db.js"
click node_productmodel "https://github.com/supesh10/welcomecraft/blob/main/backend/src/Model/productModel.js"
click node_categorymodel "https://github.com/supesh10/welcomecraft/blob/main/backend/src/Model/categoryModel.js"
click node_silvermodel "https://github.com/supesh10/welcomecraft/blob/main/backend/src/Model/silverPriceModel.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_api,node_browse,node_home,node_productdetail,node_cartui,node_checkoutui toneBlue
class node_productcontroller,node_categorycontroller,node_cartcontroller,node_ordercontroller,node_messaging toneAmber
class node_silvercontroller,node_silverscraper,node_goldcontroller,node_cron toneMint
class node_dashboard,node_login,node_auth toneRose
class node_server,node_database,node_productmodel,node_categorymodel,node_silvermodel,node_customer toneIndigo
```

## Components

### Customer Storefront

- [React App](https://github.com/supesh10/welcomecraft/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [API Client](https://github.com/supesh10/welcomecraft/blob/main/frontend/src/services/apiService.js): `frontend/src/services/apiService.js`
- [Product Browsing](https://github.com/supesh10/welcomecraft/blob/main/frontend/src/components/ProductsPage.js): `frontend/src/components/ProductsPage.js`
- [Home And About](https://github.com/supesh10/welcomecraft/blob/main/frontend/src/components/HomePage.js): `frontend/src/components/HomePage.js`
- [Product Details](https://github.com/supesh10/welcomecraft/blob/main/frontend/src/components/SingleProductPage.js): `frontend/src/components/SingleProductPage.js`
- [Cart](https://github.com/supesh10/welcomecraft/blob/main/frontend/src/components/CartPage.js): `frontend/src/components/CartPage.js`
- [Checkout](https://github.com/supesh10/welcomecraft/blob/main/frontend/src/components/CheckoutPage.js): `frontend/src/components/CheckoutPage.js`

### Catalog And Orders

- [Product Management](https://github.com/supesh10/welcomecraft/blob/main/backend/src/Controller/productController.js): `backend/src/Controller/productController.js`
- [Category Management](https://github.com/supesh10/welcomecraft/blob/main/backend/src/Controller/categoryController.js): `backend/src/Controller/categoryController.js`
- [Cart And WhatsApp Orders](https://github.com/supesh10/welcomecraft/blob/main/backend/src/Controller/cartController.js): `backend/src/Controller/cartController.js`
- [Order Management](https://github.com/supesh10/welcomecraft/blob/main/backend/src/Controller/orderController.js): `backend/src/Controller/orderController.js`
- [WhatsApp Messaging](https://github.com/supesh10/welcomecraft/blob/main/backend/src/Services/messagingService.js): `backend/src/Services/messagingService.js`

### Metal Pricing

- [Silver Price API](https://github.com/supesh10/welcomecraft/blob/main/backend/src/Controller/silverPriceController.js): `backend/src/Controller/silverPriceController.js`
- [Silver Scraper](https://github.com/supesh10/welcomecraft/blob/main/backend/src/Services/silverPriceScraper.js): `backend/src/Services/silverPriceScraper.js`
- [Gold Price API](https://github.com/supesh10/welcomecraft/blob/main/backend/src/Controller/goldPriceController.js): `backend/src/Controller/goldPriceController.js`
- [Price Scheduler](https://github.com/supesh10/welcomecraft/blob/main/backend/src/Services/cron.js): `backend/src/Services/cron.js`

### Administration

- [Admin Dashboard](https://github.com/supesh10/welcomecraft/blob/main/frontend/src/components/admin/AdminDashboard.js): `frontend/src/components/admin/AdminDashboard.js`
- [Admin Login](https://github.com/supesh10/welcomecraft/blob/main/frontend/src/components/admin/AdminLogin.js): `frontend/src/components/admin/AdminLogin.js`
- [JWT Authentication](https://github.com/supesh10/welcomecraft/blob/main/backend/src/Middleware/authMiddleware.js): `backend/src/Middleware/authMiddleware.js`

### API And Persistence

- [Express API](https://github.com/supesh10/welcomecraft/blob/main/backend/app.js): `backend/app.js`
- [MongoDB](https://github.com/supesh10/welcomecraft/blob/main/backend/src/Config/db.js): `backend/src/Config/db.js`
- [Product Records](https://github.com/supesh10/welcomecraft/blob/main/backend/src/Model/productModel.js): `backend/src/Model/productModel.js`
- [Category Records](https://github.com/supesh10/welcomecraft/blob/main/backend/src/Model/categoryModel.js): `backend/src/Model/categoryModel.js`
- [Silver Price Records](https://github.com/supesh10/welcomecraft/blob/main/backend/src/Model/silverPriceModel.js): `backend/src/Model/silverPriceModel.js`

### Other components

- **Customer**

## Connections

- Customer → React App: uses
- React App → Product Browsing: routes to (evidence: `frontend/src/App.js`)
- React App → Home And About: routes to (evidence: `frontend/src/App.js`)
- React App → Product Details: routes to (evidence: `frontend/src/App.js`)
- React App → Cart: routes to (evidence: `frontend/src/App.js`)
- React App → Checkout: routes to (evidence: `frontend/src/App.js`)
- React App → Admin Dashboard: routes to (evidence: `frontend/src/App.js`)
- React App → Admin Login: routes to (evidence: `frontend/src/App.js`)
- Product Browsing → API Client: requests catalog (evidence: `frontend/src/components/ProductsPage.js`)
- Product Details → API Client: requests product (evidence: `frontend/src/components/SingleProductPage.js`)
- Cart → API Client: updates cart (evidence: `frontend/src/components/CartPage.js`)
- Checkout → API Client: submits checkout (evidence: `frontend/src/components/CheckoutPage.js`)
- Admin Dashboard → API Client: manages records (evidence: `frontend/src/components/admin/AdminDashboard.js`)
- Admin Login → API Client: authenticates (evidence: `frontend/src/components/admin/AdminLogin.js`)
- API Client → Express API: calls API
- Express API → MongoDB: connects (evidence: `backend/app.js`)
- Express API → Price Scheduler: starts (evidence: `backend/app.js`)
- Express API → Product Management: routes products
- Express API → Category Management: routes categories
- Express API → Cart And WhatsApp Orders: routes cart
- Express API → Order Management: routes orders
- Express API → Silver Price API: routes silver
- Express API → Gold Price API: routes gold
- Cart And WhatsApp Orders → WhatsApp Messaging: generates order link (evidence: `backend/src/Controller/cartController.js`)
- Cart And WhatsApp Orders → Product Records: reads products (evidence: `backend/src/Controller/cartController.js`)
- Cart And WhatsApp Orders → Silver Price Records: prices silver
- Product Management → Category Records: validates category (evidence: `backend/src/Controller/productController.js`)
- Product Management → Product Records: writes products (evidence: `backend/src/Controller/productController.js`)
- Category Management → Category Records: manages categories (evidence: `backend/src/Controller/categoryController.js`)
- Category Management → Product Records: counts products (evidence: `backend/src/Controller/categoryController.js`)
- Silver Price API → Silver Scraper: scrapes prices (evidence: `backend/src/Controller/silverPriceController.js`)
- Silver Price API → Silver Price Records: stores history (evidence: `backend/src/Controller/silverPriceController.js`)
- Price Scheduler → Silver Price API: schedules scraping (evidence: `backend/src/Services/cron.js`)
- Price Scheduler → Gold Price API: schedules updates (evidence: `backend/src/Services/cron.js`)
- Admin Dashboard → JWT Authentication: uses protected access
- Order Management → WhatsApp Messaging: notifies admin (evidence: `backend/src/Controller/orderController.js`)
