# clifmedak-lgtm/pethaven architecture

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

## Overview

MyPetshoppy is a pet-and-supplies marketplace. Customers browse and search listings, view product details and recommendations, manage a cart, apply coupons, and proceed through checkout and payment; they can also use accounts, wishlists, and reviews. Vendors and administrators have separate management surfaces. The sampled code shows a single Express server implementing these capabilities and using Prisma-backed persistence. The README is empty, and excerpts are partial, so links for unsampled workflows and page wiring are omitted rather than inferred.

Main entry points: [`public/app.js`](https://github.com/clifmedak-lgtm/pethaven/blob/main/public/app.js) (Storefront client), [`prisma/schema.prisma`](https://github.com/clifmedak-lgtm/pethaven/blob/main/prisma/schema.prisma) (Marketplace database), [`server.js`](https://github.com/clifmedak-lgtm/pethaven/blob/main/server.js) (Payment handling), [`admin-tools.mjs`](https://github.com/clifmedak-lgtm/pethaven/blob/main/admin-tools.mjs) (Admin CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Customer storefront"]
  node_storefront["Storefront client<br/>[app.js]"]
  node_product_detail["Product details<br/>[app.js]"]
  node_cart_checkout["Cart and checkout<br/>[app.js]"]
  node_wishlist["Wishlist<br/>[app.js]"]
end

subgraph group_commerce["Marketplace services"]
  node_catalog["Product catalog<br/>[server.js]"]
  node_recommendations["Recommendations<br/>[server.js]"]
  node_coupons["Coupon validation<br/>[server.js]"]
  node_payment["Payment handling<br/>[server.js]"]
  node_reviews["Product reviews<br/>[server.js]"]
end

subgraph group_management["Account and management"]
  node_accounts["Authentication<br/>[server.js]"]
  node_vendor["Vendor management<br/>[server.js]"]
  node_admin["Admin management<br/>[server.js]"]
  node_admin_cli["Admin CLI<br/>[admin-tools.mjs]"]
end

subgraph group_data["Persistence and payments"]
  node_database[("Marketplace database<br/>[schema.prisma]")]
  node_notchpay["NotchPay"]
end

node_customer(("Customer"))

node_customer -->|"uses"| node_storefront
node_storefront -->|"requests listings"| node_catalog
node_storefront -->|"requests suggestions"| node_recommendations
node_storefront -->|"renders listing"| node_product_detail
node_storefront -->|"renders checkout"| node_cart_checkout
node_cart_checkout -->|"validates coupon"| node_coupons
node_cart_checkout -->|"checks payment"| node_payment
node_storefront -->|"loads wishlist"| node_wishlist
node_storefront -->|"loads reviews"| node_reviews
node_catalog -->|"queries products"| node_database
node_recommendations -->|"queries products"| node_database
node_reviews -->|"reads and writes"| node_database
node_payment -->|"updates orders"| node_database
node_payment -->|"verifies transactions"| node_notchpay
node_accounts -->|"reads and writes"| node_database
node_vendor -->|"queries listings"| node_database
node_admin -->|"queries marketplace"| node_database
node_admin_cli -->|"manages records"| node_database

click node_storefront "https://github.com/clifmedak-lgtm/pethaven/blob/main/public/app.js"
click node_catalog "https://github.com/clifmedak-lgtm/pethaven/blob/main/server.js"
click node_recommendations "https://github.com/clifmedak-lgtm/pethaven/blob/main/server.js"
click node_product_detail "https://github.com/clifmedak-lgtm/pethaven/blob/main/public/app.js"
click node_cart_checkout "https://github.com/clifmedak-lgtm/pethaven/blob/main/public/app.js"
click node_coupons "https://github.com/clifmedak-lgtm/pethaven/blob/main/server.js"
click node_payment "https://github.com/clifmedak-lgtm/pethaven/blob/main/server.js"
click node_accounts "https://github.com/clifmedak-lgtm/pethaven/blob/main/server.js"
click node_wishlist "https://github.com/clifmedak-lgtm/pethaven/blob/main/public/app.js"
click node_reviews "https://github.com/clifmedak-lgtm/pethaven/blob/main/server.js"
click node_vendor "https://github.com/clifmedak-lgtm/pethaven/blob/main/server.js"
click node_admin "https://github.com/clifmedak-lgtm/pethaven/blob/main/server.js"
click node_admin_cli "https://github.com/clifmedak-lgtm/pethaven/blob/main/admin-tools.mjs"
click node_database "https://github.com/clifmedak-lgtm/pethaven/blob/main/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,node_product_detail,node_cart_checkout,node_wishlist toneBlue
class node_catalog,node_recommendations,node_coupons,node_payment,node_reviews toneAmber
class node_accounts,node_vendor,node_admin,node_admin_cli toneMint
class node_database,node_notchpay toneRose
class node_customer toneIndigo
```

## Components

### Customer storefront

- [Storefront client](https://github.com/clifmedak-lgtm/pethaven/blob/main/public/app.js): `public/app.js`
- [Product details](https://github.com/clifmedak-lgtm/pethaven/blob/main/public/app.js): `public/app.js`
- [Cart and checkout](https://github.com/clifmedak-lgtm/pethaven/blob/main/public/app.js): `public/app.js`
- [Wishlist](https://github.com/clifmedak-lgtm/pethaven/blob/main/public/app.js): `public/app.js`

### Marketplace services

- [Product catalog](https://github.com/clifmedak-lgtm/pethaven/blob/main/server.js): `server.js`
- [Recommendations](https://github.com/clifmedak-lgtm/pethaven/blob/main/server.js): `server.js`
- [Coupon validation](https://github.com/clifmedak-lgtm/pethaven/blob/main/server.js): `server.js`
- [Payment handling](https://github.com/clifmedak-lgtm/pethaven/blob/main/server.js): `server.js`
- [Product reviews](https://github.com/clifmedak-lgtm/pethaven/blob/main/server.js): `server.js`

### Account and management

- [Authentication](https://github.com/clifmedak-lgtm/pethaven/blob/main/server.js): `server.js`
- [Vendor management](https://github.com/clifmedak-lgtm/pethaven/blob/main/server.js): `server.js`
- [Admin management](https://github.com/clifmedak-lgtm/pethaven/blob/main/server.js): `server.js`
- [Admin CLI](https://github.com/clifmedak-lgtm/pethaven/blob/main/admin-tools.mjs): `admin-tools.mjs`

### Persistence and payments

- [Marketplace database](https://github.com/clifmedak-lgtm/pethaven/blob/main/prisma/schema.prisma): `prisma/schema.prisma`
- **NotchPay**

### Other components

- **Customer**

## Connections

- Customer → Storefront client: uses
- Storefront client → Product catalog: requests listings (evidence: `public/app.js`)
- Storefront client → Recommendations: requests suggestions (evidence: `public/app.js`)
- Storefront client → Product details: renders listing (evidence: `public/app.js`)
- Storefront client → Cart and checkout: renders checkout (evidence: `public/app.js`)
- Cart and checkout → Coupon validation: validates coupon (evidence: `public/app.js`)
- Cart and checkout → Payment handling: checks payment (evidence: `public/app.js`)
- Storefront client → Wishlist: loads wishlist (evidence: `public/app.js`)
- Storefront client → Product reviews: loads reviews (evidence: `public/app.js`)
- Product catalog → Marketplace database: queries products (evidence: `server.js`)
- Recommendations → Marketplace database: queries products (evidence: `server.js`)
- Product reviews → Marketplace database: reads and writes (evidence: `server.js`)
- Payment handling → Marketplace database: updates orders (evidence: `server.js`)
- Payment handling → NotchPay: verifies transactions (evidence: `server.js`)
- Authentication → Marketplace database: reads and writes (evidence: `server.js`)
- Vendor management → Marketplace database: queries listings (evidence: `server.js`)
- Admin management → Marketplace database: queries marketplace (evidence: `server.js`)
- Admin CLI → Marketplace database: manages records (evidence: `admin-tools.mjs`)
