# malikdanish71/small-business- architecture

> Architecture diagram of the GitHub repository malikdanish71/small-business-, 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/malikdanish71/small-business-
- Repository: https://github.com/malikdanish71/small-business-

## Overview

SmartB2B is a local B2B marketplace and agreement-management prototype. Buyers browse and filter supplier products, submit quote requests or RFQs, and view or create draft agreements; the Express API validates requests and reads or writes SQLite records. The site also provides a landing page and placeholder destinations. Browser-to-API and API-to-database interactions are visible in the sampled JavaScript and server code; page-to-script bindings and unsampled page details are not shown.

Main entry points: [`server/app.js`](https://github.com/malikdanish71/small-business-/blob/main/server/app.js) (Product and quote API), [`server/database.js`](https://github.com/malikdanish71/small-business-/blob/main/server/database.js) (SQLite records), [`js/marketplace.js`](https://github.com/malikdanish71/small-business-/blob/main/js/marketplace.js) (Product browsing), [`js/agreements.js`](https://github.com/malikdanish71/small-business-/blob/main/js/agreements.js) (Agreement management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser experience"]
  node_home["Landing page<br/>[index.html]"]
  node_marketplace["Marketplace page<br/>[marketplace.html]"]
  node_agreements_page["Agreements page<br/>[agreements.html]"]
  node_coming_soon["Placeholder pages<br/>[coming-soon.html]"]
  node_landing_interactions["Landing interactions<br/>[landing.js]"]
  node_shared_interactions["Shared interactions<br/>[main.js]"]
end

subgraph group_workflows["Marketplace workflows"]
  node_product_browsing["Product browsing<br/>[marketplace.js]"]
  node_agreement_management["Agreement management<br/>[agreements.js]"]
end

subgraph group_api["API services"]
  node_product_api["Product and quote API<br/>[app.js]"]
  node_agreement_api["Agreement API<br/>[app.js]"]
  node_rfq_api["RFQ API<br/>[app.js]"]
end

subgraph group_storage["Runtime and storage"]
  node_sqlite[("SQLite records<br/>[database.js]")]
  node_server_startup["HTTP server startup<br/>[index.js]"]
end

node_buyer(("Buyer"))

node_buyer -->|"visits"| node_home
node_buyer -->|"browses"| node_marketplace
node_buyer -->|"manages"| node_agreements_page
node_buyer -->|"visits"| node_coming_soon
node_product_browsing -->|"fetches products"| node_product_api
node_product_browsing -->|"submits quotes"| node_product_api
node_product_browsing -->|"submits RFQs"| node_rfq_api
node_agreement_management -->|"loads agreements"| node_agreement_api
node_agreement_management -->|"creates drafts"| node_agreement_api
node_agreement_management -->|"opens modals"| node_shared_interactions
node_product_browsing -->|"opens modals"| node_shared_interactions
node_product_api -->|"reads products"| node_sqlite
node_product_api -->|"writes quotes"| node_sqlite
node_agreement_api -->|"reads and writes"| node_sqlite
node_rfq_api -->|"writes RFQs"| node_sqlite
node_server_startup -->|"opens database"| node_sqlite
node_server_startup -->|"starts app"| node_product_api
node_landing_interactions -.->|"animates landing"| node_home

click node_home "https://github.com/malikdanish71/small-business-/blob/main/index.html"
click node_marketplace "https://github.com/malikdanish71/small-business-/blob/main/marketplace.html"
click node_agreements_page "https://github.com/malikdanish71/small-business-/blob/main/agreements.html"
click node_coming_soon "https://github.com/malikdanish71/small-business-/blob/main/coming-soon.html"
click node_landing_interactions "https://github.com/malikdanish71/small-business-/blob/main/js/landing.js"
click node_shared_interactions "https://github.com/malikdanish71/small-business-/blob/main/js/main.js"
click node_product_browsing "https://github.com/malikdanish71/small-business-/blob/main/js/marketplace.js"
click node_agreement_management "https://github.com/malikdanish71/small-business-/blob/main/js/agreements.js"
click node_product_api "https://github.com/malikdanish71/small-business-/blob/main/server/app.js"
click node_agreement_api "https://github.com/malikdanish71/small-business-/blob/main/server/app.js"
click node_rfq_api "https://github.com/malikdanish71/small-business-/blob/main/server/app.js"
click node_sqlite "https://github.com/malikdanish71/small-business-/blob/main/server/database.js"
click node_server_startup "https://github.com/malikdanish71/small-business-/blob/main/server/index.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_home,node_marketplace,node_agreements_page,node_coming_soon,node_landing_interactions,node_shared_interactions toneBlue
class node_product_browsing,node_agreement_management toneAmber
class node_product_api,node_agreement_api,node_rfq_api toneMint
class node_sqlite,node_server_startup toneRose
class node_buyer toneIndigo
```

## Components

### Browser experience

- [Landing page](https://github.com/malikdanish71/small-business-/blob/main/index.html): `index.html`
- [Marketplace page](https://github.com/malikdanish71/small-business-/blob/main/marketplace.html): `marketplace.html`
- [Agreements page](https://github.com/malikdanish71/small-business-/blob/main/agreements.html): `agreements.html`
- [Placeholder pages](https://github.com/malikdanish71/small-business-/blob/main/coming-soon.html): `coming-soon.html`
- [Landing interactions](https://github.com/malikdanish71/small-business-/blob/main/js/landing.js): `js/landing.js`
- [Shared interactions](https://github.com/malikdanish71/small-business-/blob/main/js/main.js): `js/main.js`

### Marketplace workflows

- [Product browsing](https://github.com/malikdanish71/small-business-/blob/main/js/marketplace.js): `js/marketplace.js`
- [Agreement management](https://github.com/malikdanish71/small-business-/blob/main/js/agreements.js): `js/agreements.js`

### API services

- [Product and quote API](https://github.com/malikdanish71/small-business-/blob/main/server/app.js): `server/app.js`
- [Agreement API](https://github.com/malikdanish71/small-business-/blob/main/server/app.js): `server/app.js`
- [RFQ API](https://github.com/malikdanish71/small-business-/blob/main/server/app.js): `server/app.js`

### Runtime and storage

- [SQLite records](https://github.com/malikdanish71/small-business-/blob/main/server/database.js): `server/database.js`
- [HTTP server startup](https://github.com/malikdanish71/small-business-/blob/main/server/index.js): `server/index.js`

### Other components

- **Buyer**

## Connections

- Buyer → Landing page: visits (evidence: `README.md`)
- Buyer → Marketplace page: browses (evidence: `README.md`)
- Buyer → Agreements page: manages (evidence: `README.md`)
- Buyer → Placeholder pages: visits (evidence: `README.md`)
- Product browsing → Product and quote API: fetches products (evidence: `js/marketplace.js`)
- Product browsing → Product and quote API: submits quotes (evidence: `js/marketplace.js`)
- Product browsing → RFQ API: submits RFQs (evidence: `js/marketplace.js`)
- Agreement management → Agreement API: loads agreements (evidence: `js/agreements.js`)
- Agreement management → Agreement API: creates drafts (evidence: `js/agreements.js`)
- Agreement management → Shared interactions: opens modals (evidence: `js/agreements.js`)
- Product browsing → Shared interactions: opens modals (evidence: `js/marketplace.js`)
- Product and quote API → SQLite records: reads products (evidence: `server/app.js`)
- Product and quote API → SQLite records: writes quotes (evidence: `server/app.js`)
- Agreement API → SQLite records: reads and writes (evidence: `server/app.js`)
- RFQ API → SQLite records: writes RFQs (evidence: `server/app.js`)
- HTTP server startup → SQLite records: opens database (evidence: `server/index.js`)
- HTTP server startup → Product and quote API: starts app (evidence: `server/index.js`)
- Landing interactions → Landing page: animates landing
