# clifmedak-lgtm/global-mart architecture

> Architecture diagram of the GitHub repository clifmedak-lgtm/global-mart, 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/clifmedak-lgtm/global-mart
- Repository: https://github.com/clifmedak-lgtm/global-mart

## Overview

GlobalMart is a marketplace storefront with a static browser UI and an Express/Prisma backend. The main customer journey is browsing products, signing in, checking out, and paying through NotchPay; the repository also includes reviews, wishlists, vendor and admin experiences, and bilingual/theme controls. The sampled excerpts show browser API calls, database access, and payment verification, but not every route or page integration, so uncertain links are omitted. Multiple backend responsibilities share server.js because no separate implementation files appear in the tree.

Main entry points: [`server.js`](https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/server.js) (HTTP API), [`public/app.js`](https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/public/app.js) (Storefront UI), [`prisma/schema.prisma`](https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/prisma/schema.prisma) (Marketplace Database), [`public/product.html`](https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/public/product.html) (Product Pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_storefront_ui["Storefront UI<br/>[app.js]"]
  node_product_pages["Product Pages<br/>[product.html]"]
  node_account_pages["Account Pages<br/>[account.html]"]
  node_checkout_page["Checkout Page<br/>[checkout.html]"]
  node_translations["Translations<br/>[i18n.js]"]
  node_appearance["Appearance Controls<br/>[theme-controls.js]"]
end

subgraph group_marketplace["Marketplace Services"]
  node_api_server["HTTP API<br/>[server.js]"]
  node_catalog["Product Catalog<br/>[server.js]"]
  node_accounts["Accounts &amp; Sessions<br/>[server.js]"]
  node_checkout_orders["Checkout &amp; Orders<br/>[server.js]"]
  node_reviews_wishlist["Reviews &amp; Wishlist<br/>[server.js]"]
  node_payments["Payment Handling<br/>[server.js]"]
end

subgraph group_operations["Marketplace Operations"]
  node_vendor_portal["Vendor Portal"]
  node_admin_portal["Admin Portal<br/>[admin.html]"]
  node_admin_api["Admin Operations<br/>[server.js]"]
end

subgraph group_persistence["Persistence"]
  node_database[("Marketplace Database<br/>[schema.prisma]")]
end

node_shopper(("Shopper"))
node_notchpay["NotchPay"]

node_shopper -->|"uses"| node_storefront_ui
node_storefront_ui -->|"requests data"| node_api_server
node_product_pages -.->|"hosts product view"| node_storefront_ui
node_account_pages -.->|"hosts account view"| node_storefront_ui
node_checkout_page -.->|"hosts checkout"| node_storefront_ui
node_storefront_ui -.->|"translates UI"| node_translations
node_storefront_ui -.->|"offers controls"| node_appearance
node_api_server -->|"routes requests"| node_catalog
node_api_server -->|"routes requests"| node_accounts
node_api_server -->|"routes requests"| node_checkout_orders
node_api_server -->|"routes requests"| node_reviews_wishlist
node_api_server -->|"routes requests"| node_payments
node_api_server -->|"routes requests"| node_admin_api
node_catalog -->|"reads products"| node_database
node_accounts -->|"reads/writes users"| node_database
node_checkout_orders -->|"reads/writes orders"| node_database
node_reviews_wishlist -->|"reads/writes records"| node_database
node_payments -->|"updates payment status"| node_database
node_payments -->|"verifies transactions"| node_notchpay
node_admin_api -->|"manages records"| node_database
node_vendor_portal -.->|"uses API"| node_api_server
node_admin_portal -.->|"uses admin routes"| node_admin_api

click node_storefront_ui "https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/public/app.js"
click node_product_pages "https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/public/product.html"
click node_account_pages "https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/public/account.html"
click node_checkout_page "https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/public/checkout.html"
click node_translations "https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/public/i18n.js"
click node_appearance "https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/public/theme-controls.js"
click node_api_server "https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/server.js"
click node_catalog "https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/server.js"
click node_accounts "https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/server.js"
click node_checkout_orders "https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/server.js"
click node_reviews_wishlist "https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/server.js"
click node_payments "https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/server.js"
click node_vendor_portal "https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/public/vendor-dashboard.html"
click node_admin_portal "https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/public/admin.html"
click node_admin_api "https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/server.js"
click node_database "https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/prisma/schema.prisma"

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_storefront_ui,node_product_pages,node_account_pages,node_checkout_page,node_translations,node_appearance toneBlue
class node_api_server,node_catalog,node_accounts,node_checkout_orders,node_reviews_wishlist,node_payments toneAmber
class node_vendor_portal,node_admin_portal,node_admin_api toneMint
class node_database toneRose
class node_shopper,node_notchpay toneIndigo
```

## Components

### Storefront

- [Storefront UI](https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/public/app.js): `public/app.js`
- [Product Pages](https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/public/product.html): `public/product.html`
- [Account Pages](https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/public/account.html): `public/account.html`
- [Checkout Page](https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/public/checkout.html): `public/checkout.html`
- [Translations](https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/public/i18n.js): `public/i18n.js`
- [Appearance Controls](https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/public/theme-controls.js): `public/theme-controls.js`

### Marketplace Services

- [HTTP API](https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/server.js): `server.js`
- [Product Catalog](https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/server.js): `server.js`
- [Accounts & Sessions](https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/server.js): `server.js`
- [Checkout & Orders](https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/server.js): `server.js`
- [Reviews & Wishlist](https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/server.js): `server.js`
- [Payment Handling](https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/server.js): `server.js`

### Marketplace Operations

- [Vendor Portal](https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/public/vendor-dashboard.html): `public/vendor-dashboard.html`
- [Admin Portal](https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/public/admin.html): `public/admin.html`
- [Admin Operations](https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/server.js): `server.js`

### Persistence

- [Marketplace Database](https://github.com/clifmedak-lgtm/global-mart/blob/global-mart/prisma/schema.prisma): `prisma/schema.prisma`

### Other components

- **Shopper**
- **NotchPay**

## Connections

- Shopper → Storefront UI: uses
- Storefront UI → HTTP API: requests data (evidence: `public/app.js`)
- Product Pages → Storefront UI: hosts product view
- Account Pages → Storefront UI: hosts account view
- Checkout Page → Storefront UI: hosts checkout
- Storefront UI → Translations: translates UI
- Storefront UI → Appearance Controls: offers controls
- HTTP API → Product Catalog: routes requests (evidence: `server.js`)
- HTTP API → Accounts & Sessions: routes requests (evidence: `server.js`)
- HTTP API → Checkout & Orders: routes requests (evidence: `server.js`)
- HTTP API → Reviews & Wishlist: routes requests (evidence: `server.js`)
- HTTP API → Payment Handling: routes requests (evidence: `server.js`)
- HTTP API → Admin Operations: routes requests (evidence: `server.js`)
- Product Catalog → Marketplace Database: reads products (evidence: `server.js`)
- Accounts & Sessions → Marketplace Database: reads/writes users (evidence: `server.js`)
- Checkout & Orders → Marketplace Database: reads/writes orders (evidence: `server.js`)
- Reviews & Wishlist → Marketplace Database: reads/writes records (evidence: `server.js`)
- Payment Handling → Marketplace Database: updates payment status (evidence: `server.js`)
- Payment Handling → NotchPay: verifies transactions (evidence: `server.js`)
- Admin Operations → Marketplace Database: manages records (evidence: `server.js`)
- Vendor Portal → HTTP API: uses API
- Admin Portal → Admin Operations: uses admin routes
