# silent20m/capstone-b- architecture

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

- Interactive diagram: https://gitdiagram.com/silent20m/capstone-b-
- Repository: https://github.com/silent20m/capstone-b-

## Overview

This is a Costco smart-shopping web app backed by SQLite. A shopper loads the product catalogue, filters or searches it, adds items to an in-browser cart, and can use catalogue-based shopping-list suggestions. The Node server serves the frontend and exposes product and health endpoints; a separate Python server provides read endpoints for additional database tables. The database schema also models orders, payments, reviews, and saved shopping lists, but the sampled runtime does not show checkout or persistence for the UI cart. Evidence is limited to the sampled source; the README is empty.

Main entry points: [`frontend/app.js`](https://github.com/silent20m/capstone-b-/blob/main/frontend/app.js) (Catalogue and filters), [`backend/server.js`](https://github.com/silent20m/capstone-b-/blob/main/backend/server.js) (Node API and static server), [`database/capstone_b.db`](https://github.com/silent20m/capstone-b-/blob/main/database/capstone_b.db) (Shopping database), [`backend/server.py`](https://github.com/silent20m/capstone-b-/blob/main/backend/server.py) (Python read API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shopper_ui["Shopping interface"]
  node_catalog_ui["Catalogue and filters<br/>[app.js]"]
  node_cart["In-memory cart<br/>[app.js]"]
  node_list_suggestions["List suggestions<br/>[app.js]"]
end

subgraph group_api["API services"]
  node_node_api["Node API and static server<br/>[server.js]"]
  node_python_api["Python read API<br/>[server.py]"]
end

subgraph group_storage["SQLite data"]
  node_sqlite[("Shopping database<br/>[capstone_b.db]")]
  node_schema["Relational schema<br/>[setup_database.py]"]
end

node_shopper(("Shopper"))

node_shopper -->|"browses"| node_catalog_ui
node_catalog_ui -->|"fetches products"| node_node_api
node_node_api -->|"queries products"| node_sqlite
node_node_api -->|"serves frontend"| node_catalog_ui
node_catalog_ui -->|"adds items"| node_cart
node_shopper -->|"manages quantities"| node_cart
node_catalog_ui -->|"suggests matches"| node_list_suggestions
node_python_api -->|"queries tables"| node_sqlite
node_schema -->|"creates tables"| node_sqlite

click node_catalog_ui "https://github.com/silent20m/capstone-b-/blob/main/frontend/app.js"
click node_cart "https://github.com/silent20m/capstone-b-/blob/main/frontend/app.js"
click node_list_suggestions "https://github.com/silent20m/capstone-b-/blob/main/frontend/app.js"
click node_node_api "https://github.com/silent20m/capstone-b-/blob/main/backend/server.js"
click node_python_api "https://github.com/silent20m/capstone-b-/blob/main/backend/server.py"
click node_sqlite "https://github.com/silent20m/capstone-b-/blob/main/database/capstone_b.db"
click node_schema "https://github.com/silent20m/capstone-b-/blob/main/database/setup_database.py"

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_catalog_ui,node_cart,node_list_suggestions toneBlue
class node_node_api,node_python_api toneAmber
class node_sqlite,node_schema toneMint
class node_shopper toneIndigo
```

## Components

### Shopping interface

- [Catalogue and filters](https://github.com/silent20m/capstone-b-/blob/main/frontend/app.js): `frontend/app.js`
- [In-memory cart](https://github.com/silent20m/capstone-b-/blob/main/frontend/app.js): `frontend/app.js`
- [List suggestions](https://github.com/silent20m/capstone-b-/blob/main/frontend/app.js): `frontend/app.js`

### API services

- [Node API and static server](https://github.com/silent20m/capstone-b-/blob/main/backend/server.js): `backend/server.js`
- [Python read API](https://github.com/silent20m/capstone-b-/blob/main/backend/server.py): `backend/server.py`

### SQLite data

- [Shopping database](https://github.com/silent20m/capstone-b-/blob/main/database/capstone_b.db): `database/capstone_b.db`
- [Relational schema](https://github.com/silent20m/capstone-b-/blob/main/database/setup_database.py): `database/setup_database.py`

### Other components

- **Shopper**

## Connections

- Shopper → Catalogue and filters: browses (evidence: `frontend/app.js`)
- Catalogue and filters → Node API and static server: fetches products (evidence: `frontend/app.js`)
- Node API and static server → Shopping database: queries products (evidence: `backend/server.js`)
- Node API and static server → Catalogue and filters: serves frontend (evidence: `backend/server.js`)
- Catalogue and filters → In-memory cart: adds items (evidence: `frontend/app.js`)
- Shopper → In-memory cart: manages quantities (evidence: `frontend/app.js`)
- Catalogue and filters → List suggestions: suggests matches (evidence: `frontend/app.js`)
- Python read API → Shopping database: queries tables (evidence: `backend/server.py`)
- Relational schema → Shopping database: creates tables (evidence: `database/setup_database.py`)
