# spoojarideepak-hub/vendorconectorg architecture

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

- Interactive diagram: https://gitdiagram.com/spoojarideepak-hub/vendorconectorg
- Repository: https://github.com/spoojarideepak-hub/vendorconectorg

## Overview

VendorConnect is a buyer–supplier marketplace. Buyers register or log in, browse products, request quotations, and place orders from accepted quotations; suppliers manage products, respond to quotations, and manage orders. Express routes implement these stages, with MySQL persistence, JWT/role checks, and image uploads as supporting layers. The README is empty, and HTML page contents and most product-route code were not sampled, so frontend interactions and some endpoint details are not mapped beyond what the excerpts establish.

Main entry points: [`VendorConnect/server.js`](https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/server.js) (HTTP server), [`VendorConnect/config/database.js`](https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/config/database.js) (MySQL connection pool), [`VendorConnect/middleware/authMiddleware.js`](https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/middleware/authMiddleware.js) (JWT and role checks), [`VendorConnect/routes/products.js`](https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/routes/products.js) (Seller product management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_server["HTTP server<br/>[server.js]"]
  node_db_pool["MySQL connection pool<br/>[database.js]"]
end

subgraph group_identity["Identity and access"]
  node_auth["Registration and login<br/>[auth.js]"]
  node_access["JWT and role checks<br/>[authMiddleware.js]"]
end

subgraph group_market["Marketplace workflows"]
  node_catalog["Product catalog<br/>[products.js]"]
  node_seller_products["Seller product management<br/>[products.js]"]
  node_quotations["Quotation requests<br/>[products.js]"]
  node_orders["Order lifecycle<br/>[products.js]"]
  node_uploads["Product image uploads<br/>[upload.js]"]
end

subgraph group_frontend["Web interface"]
  node_home["Marketplace landing<br/>[index.html]"]
  node_login_page["Login<br/>[login.html]"]
  node_buyer_pages["Buyer dashboards"]
  node_seller_pages["Supplier dashboards"]
  node_product_pages["Product pages<br/>[marketplace.html]"]
  node_add_product["Add product page<br/>[add-product.html]"]
  node_my_products["My products page<br/>[my-products.html]"]
  node_search_script["Product search script<br/>[script.js]"]
end

node_mysql[("MySQL database")]
node_buyer(("Buyer"))
node_supplier(("Supplier"))

node_server -->|"mounts routes"| node_auth
node_server -->|"mounts routes"| node_catalog
node_server -->|"checks dashboards"| node_access
node_server -->|"checks health"| node_db_pool
node_server -->|"serves static"| node_home
node_server -->|"serves static"| node_login_page
node_server -->|"serves static"| node_buyer_pages
node_server -->|"serves static"| node_seller_pages
node_server -->|"serves static"| node_product_pages
node_server -->|"serves static"| node_add_product
node_server -->|"serves static"| node_my_products
node_auth -->|"queries users"| node_db_pool
node_catalog -->|"queries catalog"| node_db_pool
node_seller_products -->|"manages products"| node_db_pool
node_quotations -->|"handles requests"| node_db_pool
node_orders -->|"manages orders"| node_db_pool
node_catalog -->|"checks roles"| node_access
node_seller_products -->|"checks roles"| node_access
node_quotations -->|"checks roles"| node_access
node_orders -->|"checks roles"| node_access
node_seller_products -->|"accepts images"| node_uploads
node_db_pool -->|"connects to"| node_mysql
node_buyer -->|"registers or logs in"| node_auth
node_supplier -->|"registers or logs in"| node_auth
node_buyer -.->|"browses products"| node_catalog
node_buyer -->|"requests quotes"| node_quotations
node_buyer -->|"places orders"| node_orders
node_supplier -->|"manages listings"| node_seller_products
node_supplier -->|"handles quotes"| node_quotations
node_supplier -->|"updates orders"| node_orders
node_search_script -->|"updates message"| node_search_script

click node_server "https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/server.js"
click node_auth "https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/routes/auth.js"
click node_access "https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/middleware/authMiddleware.js"
click node_catalog "https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/routes/products.js"
click node_seller_products "https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/routes/products.js"
click node_quotations "https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/routes/products.js"
click node_orders "https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/routes/products.js"
click node_uploads "https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/middleware/upload.js"
click node_db_pool "https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/config/database.js"
click node_home "https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/public/index.html"
click node_login_page "https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/public/login.html"
click node_buyer_pages "https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/public/buyer-dashboard.html"
click node_seller_pages "https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/public/seller-dashboard.html"
click node_product_pages "https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/public/marketplace.html"
click node_add_product "https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/public/add-product.html"
click node_my_products "https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/public/my-products.html"
click node_search_script "https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/public/js/script.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_server,node_db_pool toneBlue
class node_auth,node_access,node_mysql toneAmber
class node_catalog,node_seller_products,node_quotations,node_orders,node_uploads toneMint
class node_home,node_login_page,node_buyer_pages,node_seller_pages,node_product_pages,node_add_product,node_my_products,node_search_script toneRose
class node_buyer,node_supplier toneIndigo
```

## Components

### Application entry

- [HTTP server](https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/server.js): `VendorConnect/server.js`
- [MySQL connection pool](https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/config/database.js): `VendorConnect/config/database.js`

### Identity and access

- [Registration and login](https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/routes/auth.js): `VendorConnect/routes/auth.js`
- [JWT and role checks](https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/middleware/authMiddleware.js): `VendorConnect/middleware/authMiddleware.js`

### Marketplace workflows

- [Product catalog](https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/routes/products.js): `VendorConnect/routes/products.js`
- [Seller product management](https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/routes/products.js): `VendorConnect/routes/products.js`
- [Quotation requests](https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/routes/products.js): `VendorConnect/routes/products.js`
- [Order lifecycle](https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/routes/products.js): `VendorConnect/routes/products.js`
- [Product image uploads](https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/middleware/upload.js): `VendorConnect/middleware/upload.js`

### Web interface

- [Marketplace landing](https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/public/index.html): `VendorConnect/public/index.html`
- [Login](https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/public/login.html): `VendorConnect/public/login.html`
- [Buyer dashboards](https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/public/buyer-dashboard.html): `VendorConnect/public/buyer-dashboard.html`
- [Supplier dashboards](https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/public/seller-dashboard.html): `VendorConnect/public/seller-dashboard.html`
- [Product pages](https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/public/marketplace.html): `VendorConnect/public/marketplace.html`
- [Add product page](https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/public/add-product.html): `VendorConnect/public/add-product.html`
- [My products page](https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/public/my-products.html): `VendorConnect/public/my-products.html`
- [Product search script](https://github.com/spoojarideepak-hub/vendorconectorg/blob/main/VendorConnect/public/js/script.js): `VendorConnect/public/js/script.js`

### Other components

- **MySQL database**
- **Buyer**
- **Supplier**

## Connections

- HTTP server → Registration and login: mounts routes (evidence: `VendorConnect/server.js`)
- HTTP server → Product catalog: mounts routes (evidence: `VendorConnect/server.js`)
- HTTP server → JWT and role checks: checks dashboards (evidence: `VendorConnect/server.js`)
- HTTP server → MySQL connection pool: checks health (evidence: `VendorConnect/server.js`)
- HTTP server → Marketplace landing: serves static (evidence: `VendorConnect/server.js`)
- HTTP server → Login: serves static (evidence: `VendorConnect/server.js`)
- HTTP server → Buyer dashboards: serves static (evidence: `VendorConnect/server.js`)
- HTTP server → Supplier dashboards: serves static (evidence: `VendorConnect/server.js`)
- HTTP server → Product pages: serves static (evidence: `VendorConnect/server.js`)
- HTTP server → Add product page: serves static (evidence: `VendorConnect/server.js`)
- HTTP server → My products page: serves static (evidence: `VendorConnect/server.js`)
- Registration and login → MySQL connection pool: queries users (evidence: `VendorConnect/routes/auth.js`)
- Product catalog → MySQL connection pool: queries catalog (evidence: `VendorConnect/routes/products.js`)
- Seller product management → MySQL connection pool: manages products (evidence: `VendorConnect/routes/products.js`)
- Quotation requests → MySQL connection pool: handles requests (evidence: `VendorConnect/routes/products.js`)
- Order lifecycle → MySQL connection pool: manages orders (evidence: `VendorConnect/routes/products.js`)
- Product catalog → JWT and role checks: checks roles (evidence: `VendorConnect/routes/products.js`)
- Seller product management → JWT and role checks: checks roles (evidence: `VendorConnect/routes/products.js`)
- Quotation requests → JWT and role checks: checks roles (evidence: `VendorConnect/routes/products.js`)
- Order lifecycle → JWT and role checks: checks roles (evidence: `VendorConnect/routes/products.js`)
- Seller product management → Product image uploads: accepts images (evidence: `VendorConnect/routes/products.js`)
- MySQL connection pool → MySQL database: connects to (evidence: `VendorConnect/config/database.js`)
- Buyer → Registration and login: registers or logs in (evidence: `VendorConnect/routes/auth.js`)
- Supplier → Registration and login: registers or logs in (evidence: `VendorConnect/routes/auth.js`)
- Buyer → Product catalog: browses products
- Buyer → Quotation requests: requests quotes (evidence: `VendorConnect/routes/products.js`)
- Buyer → Order lifecycle: places orders (evidence: `VendorConnect/routes/products.js`)
- Supplier → Seller product management: manages listings (evidence: `VendorConnect/routes/products.js`)
- Supplier → Quotation requests: handles quotes (evidence: `VendorConnect/routes/products.js`)
- Supplier → Order lifecycle: updates orders (evidence: `VendorConnect/routes/products.js`)
- Product search script → Product search script: updates message (evidence: `VendorConnect/public/js/script.js`)
