# adityaas2268/webtech architecture

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

- Interactive diagram: https://gitdiagram.com/adityaas2268/webtech
- Repository: https://github.com/adityaas2268/webtech

## Overview

This is a shopping marketplace with a React storefront and a checkout flow for saved addresses, delivery speed, and payment. The storefront manages product discovery, wishlisting, and cart state; checkout collects an address, calculates delivery totals, and submits payment through Express. The backend also exposes address operations backed by MySQL, while payment records are held in server memory. The excerpts show page composition and address/payment API calls, but not the storefront’s product-fetch implementation or all backend routes, so those links are omitted.

Main entry points: [`client/src/components/DeliveryOptionsPage/DeliveryOptionsPage.jsx`](https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryOptionsPage/DeliveryOptionsPage.jsx) (Delivery selection), [`client/src/components/DeliveryAddressPage/DeliveryAddressPage.jsx`](https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryAddressPage/DeliveryAddressPage.jsx) (Address selection), [`server/server.js`](https://github.com/adityaas2268/webtech/blob/main/server/server.js) (Express routes), [`client/src/components/DeliveryAddressPage/AddressSection/AddressSection.jsx`](https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryAddressPage/AddressSection/AddressSection.jsx) (Address cards)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Marketplace"]
  node_app["Storefront<br/>[App.jsx]"]
  node_products["Product catalog data<br/>[products.js]"]
end

subgraph group_checkout["Checkout"]
  node_address["Address selection"]
  node_addressstate["Address defaults"]
  node_addresssection["Address cards<br/>[AddressSection.jsx]"]
  node_addresscards["Saved address controls<br/>[AddressCards.jsx]"]
  node_addressmodal["Address editor"]
  node_addresstips["Editor side tips"]
  node_continue["Address continuation"]
  node_addressheader["Address page header<br/>[PageHeader.jsx]"]
  node_addressicons["Address icons<br/>[Icons.jsx]"]
  node_delivery["Delivery selection"]
  node_destpreview["Destination preview"]
  node_deliveryopts["Delivery options"]
  node_ordersummary["Order summary<br/>[OrderSummary.jsx]"]
  node_ordertotal["Order total<br/>[OrderTotal.jsx]"]
  node_deliveryheader["Delivery header<br/>[Header.jsx]"]
  node_payment["Payment page<br/>[PaymentPage.jsx]"]
end

subgraph group_backend["Backend API"]
  node_server["Express routes<br/>[server.js]"]
  node_pool["MySQL connection pool<br/>[db.js]"]
  node_paymentrecords[("In-memory payments<br/>[server.js]")]
end

subgraph group_persistence["Persistence"]
  node_mysql[("MySQL database<br/>[schema.sql]")]
end

node_shopper(("Shopper"))

node_shopper -->|"browses"| node_app
node_app -.->|"uses catalog"| node_products
node_shopper -->|"enters address"| node_address
node_address -->|"loads defaults"| node_addressstate
node_address -->|"renders"| node_addresssection
node_address -->|"renders"| node_addressheader
node_address -->|"renders"| node_addressmodal
node_addresssection -->|"renders"| node_addresscards
node_addressmodal -->|"renders"| node_addresstips
node_addresssection -->|"imports icons"| node_addressicons
node_address -->|"requests address APIs"| node_server
node_shopper -->|"chooses delivery"| node_delivery
node_delivery -->|"renders"| node_destpreview
node_delivery -->|"renders"| node_deliveryopts
node_delivery -->|"renders"| node_ordersummary
node_delivery -->|"renders"| node_ordertotal
node_delivery -->|"renders"| node_deliveryheader
node_destpreview -->|"navigates to"| node_address
node_delivery -->|"navigates to"| node_payment
node_shopper -->|"submits payment"| node_payment
node_payment -->|"posts transaction"| node_server
node_server -->|"stores payment"| node_paymentrecords
node_server -->|"queries"| node_pool
node_pool -->|"connects to"| node_mysql
node_server -->|"reads and writes addresses"| node_mysql

click node_app "https://github.com/adityaas2268/webtech/blob/main/client/src/App.jsx"
click node_products "https://github.com/adityaas2268/webtech/blob/main/client/src/data/products.js"
click node_address "https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryAddressPage/DeliveryAddressPage.jsx"
click node_addressstate "https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryAddressPage/DeliveryAddressPage.js"
click node_addresssection "https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryAddressPage/AddressSection/AddressSection.jsx"
click node_addresscards "https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryAddressPage/AddressSection/Elements/AddressCards.jsx"
click node_addressmodal "https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryAddressPage/AddressSection/Elements/EditAddressModal.jsx"
click node_addresstips "https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryAddressPage/AddressSection/Elements/EditAddressModalSideTips.jsx"
click node_continue "https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryAddressPage/AddressSection/Elements/SelectedDeliveryContinue.jsx"
click node_addressheader "https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryAddressPage/Elements/PageHeader.jsx"
click node_addressicons "https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryAddressPage/Elements/Icons.jsx"
click node_delivery "https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryOptionsPage/DeliveryOptionsPage.jsx"
click node_destpreview "https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryOptionsPage/Elements/SelectedDestinationPreview.jsx"
click node_deliveryopts "https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryOptionsPage/Elements/DeliveryOptions.jsx"
click node_ordersummary "https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryOptionsPage/Elements/OrderSummary.jsx"
click node_ordertotal "https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryOptionsPage/Elements/OrderTotal.jsx"
click node_deliveryheader "https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryOptionsPage/Elements/Header.jsx"
click node_payment "https://github.com/adityaas2268/webtech/blob/main/client/src/pages/PaymentPage/PaymentPage.jsx"
click node_server "https://github.com/adityaas2268/webtech/blob/main/server/server.js"
click node_pool "https://github.com/adityaas2268/webtech/blob/main/server/db.js"
click node_mysql "https://github.com/adityaas2268/webtech/blob/main/database/schema.sql"
click node_paymentrecords "https://github.com/adityaas2268/webtech/blob/main/server/server.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_products toneBlue
class node_address,node_addressstate,node_addresssection,node_addresscards,node_addressmodal,node_addresstips,node_continue,node_addressheader,node_addressicons,node_delivery,node_destpreview,node_deliveryopts,node_ordersummary,node_ordertotal,node_deliveryheader,node_payment toneAmber
class node_server,node_pool,node_paymentrecords toneMint
class node_mysql toneRose
class node_shopper toneIndigo
```

## Components

### Marketplace

- [Storefront](https://github.com/adityaas2268/webtech/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Product catalog data](https://github.com/adityaas2268/webtech/blob/main/client/src/data/products.js): `client/src/data/products.js`

### Checkout

- [Address selection](https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryAddressPage/DeliveryAddressPage.jsx): `client/src/components/DeliveryAddressPage/DeliveryAddressPage.jsx`
- [Address defaults](https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryAddressPage/DeliveryAddressPage.js): `client/src/components/DeliveryAddressPage/DeliveryAddressPage.js`
- [Address cards](https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryAddressPage/AddressSection/AddressSection.jsx): `client/src/components/DeliveryAddressPage/AddressSection/AddressSection.jsx`
- [Saved address controls](https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryAddressPage/AddressSection/Elements/AddressCards.jsx): `client/src/components/DeliveryAddressPage/AddressSection/Elements/AddressCards.jsx`
- [Address editor](https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryAddressPage/AddressSection/Elements/EditAddressModal.jsx): `client/src/components/DeliveryAddressPage/AddressSection/Elements/EditAddressModal.jsx`
- [Editor side tips](https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryAddressPage/AddressSection/Elements/EditAddressModalSideTips.jsx): `client/src/components/DeliveryAddressPage/AddressSection/Elements/EditAddressModalSideTips.jsx`
- [Address continuation](https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryAddressPage/AddressSection/Elements/SelectedDeliveryContinue.jsx): `client/src/components/DeliveryAddressPage/AddressSection/Elements/SelectedDeliveryContinue.jsx`
- [Address page header](https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryAddressPage/Elements/PageHeader.jsx): `client/src/components/DeliveryAddressPage/Elements/PageHeader.jsx`
- [Address icons](https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryAddressPage/Elements/Icons.jsx): `client/src/components/DeliveryAddressPage/Elements/Icons.jsx`
- [Delivery selection](https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryOptionsPage/DeliveryOptionsPage.jsx): `client/src/components/DeliveryOptionsPage/DeliveryOptionsPage.jsx`
- [Destination preview](https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryOptionsPage/Elements/SelectedDestinationPreview.jsx): `client/src/components/DeliveryOptionsPage/Elements/SelectedDestinationPreview.jsx`
- [Delivery options](https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryOptionsPage/Elements/DeliveryOptions.jsx): `client/src/components/DeliveryOptionsPage/Elements/DeliveryOptions.jsx`
- [Order summary](https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryOptionsPage/Elements/OrderSummary.jsx): `client/src/components/DeliveryOptionsPage/Elements/OrderSummary.jsx`
- [Order total](https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryOptionsPage/Elements/OrderTotal.jsx): `client/src/components/DeliveryOptionsPage/Elements/OrderTotal.jsx`
- [Delivery header](https://github.com/adityaas2268/webtech/blob/main/client/src/components/DeliveryOptionsPage/Elements/Header.jsx): `client/src/components/DeliveryOptionsPage/Elements/Header.jsx`
- [Payment page](https://github.com/adityaas2268/webtech/blob/main/client/src/pages/PaymentPage/PaymentPage.jsx): `client/src/pages/PaymentPage/PaymentPage.jsx`

### Backend API

- [Express routes](https://github.com/adityaas2268/webtech/blob/main/server/server.js): `server/server.js`
- [MySQL connection pool](https://github.com/adityaas2268/webtech/blob/main/server/db.js): `server/db.js`
- [In-memory payments](https://github.com/adityaas2268/webtech/blob/main/server/server.js): `server/server.js`

### Persistence

- [MySQL database](https://github.com/adityaas2268/webtech/blob/main/database/schema.sql): `database/schema.sql`

### Other components

- **Shopper**

## Connections

- Shopper → Storefront: browses
- Storefront → Product catalog data: uses catalog
- Shopper → Address selection: enters address
- Address selection → Address defaults: loads defaults (evidence: `client/src/components/DeliveryAddressPage/DeliveryAddressPage.jsx`)
- Address selection → Address cards: renders (evidence: `client/src/components/DeliveryAddressPage/DeliveryAddressPage.jsx`)
- Address selection → Address page header: renders (evidence: `client/src/components/DeliveryAddressPage/DeliveryAddressPage.jsx`)
- Address selection → Address editor: renders (evidence: `client/src/components/DeliveryAddressPage/DeliveryAddressPage.jsx`)
- Address cards → Saved address controls: renders (evidence: `client/src/components/DeliveryAddressPage/AddressSection/AddressSection.jsx`)
- Address editor → Editor side tips: renders (evidence: `client/src/components/DeliveryAddressPage/AddressSection/Elements/EditAddressModal.jsx`)
- Address cards → Address icons: imports icons (evidence: `client/src/components/DeliveryAddressPage/AddressSection/AddressSection.jsx`)
- Address selection → Express routes: requests address APIs (evidence: `client/src/components/DeliveryAddressPage/DeliveryAddressPage.jsx`)
- Shopper → Delivery selection: chooses delivery
- Delivery selection → Destination preview: renders (evidence: `client/src/components/DeliveryOptionsPage/DeliveryOptionsPage.jsx`)
- Delivery selection → Delivery options: renders (evidence: `client/src/components/DeliveryOptionsPage/DeliveryOptionsPage.jsx`)
- Delivery selection → Order summary: renders (evidence: `client/src/components/DeliveryOptionsPage/DeliveryOptionsPage.jsx`)
- Delivery selection → Order total: renders (evidence: `client/src/components/DeliveryOptionsPage/DeliveryOptionsPage.jsx`)
- Delivery selection → Delivery header: renders (evidence: `client/src/components/DeliveryOptionsPage/DeliveryOptionsPage.jsx`)
- Destination preview → Address selection: navigates to (evidence: `client/src/components/DeliveryOptionsPage/Elements/SelectedDestinationPreview.jsx`)
- Delivery selection → Payment page: navigates to (evidence: `client/src/components/DeliveryOptionsPage/DeliveryOptionsPage.jsx`)
- Shopper → Payment page: submits payment
- Payment page → Express routes: posts transaction (evidence: `client/src/pages/PaymentPage/PaymentPage.jsx`)
- Express routes → In-memory payments: stores payment (evidence: `server/server.js`)
- Express routes → MySQL connection pool: queries (evidence: `server/server.js`)
- MySQL connection pool → MySQL database: connects to (evidence: `server/db.js`)
- Express routes → MySQL database: reads and writes addresses (evidence: `server/server.js`)
