# mohamedbrzan/hippo_digital_app architecture

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

- Interactive diagram: https://gitdiagram.com/mohamedbrzan/hippo_digital_app
- Repository: https://github.com/mohamedbrzan/hippo_digital_app

## Overview

DigitalHippo is a digital-goods marketplace: shoppers browse approved products, add them to a locally persisted cart, authenticate, pay, and receive order confirmation. Sellers and admins manage products through Payload, which also supplies authentication and marketplace data. The sampled server and routers show the API and payment flow; the README documents additional admin, seller, and verification capabilities whose detailed wiring is not shown. Dashed links mark external integrations or documented capabilities without sampled call sites.

Main entry points: [`src/webhooks.ts`](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/webhooks.ts) (Payment Webhook), [`src/get-payload.ts`](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/get-payload.ts) (Payload CMS), [`src/trpc/payment-router.ts`](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/trpc/payment-router.ts) (Payment API), [`src/app/product/[productId]/page.tsx`](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/app/product/%5BproductId%5D/page.tsx) (Product Detail)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_home["Landing Page<br/>[page.tsx]"]
  node_catalog["Product Catalog<br/>[page.tsx]"]
  node_product_page["Product Detail<br/>[page.tsx]"]
  node_product_reel["Product Reel<br/>[ProductReel.tsx]"]
  node_listing["Product Listing<br/>[ProductListing.tsx]"]
  node_image_slider["Image Slider<br/>[ImageSlider.tsx]"]
end

subgraph group_identity["Identity"]
  node_auth_pages["Sign-in / Sign-up<br/>[page.tsx]"]
  node_auth_api["Authentication API<br/>[auth-router.ts]"]
  node_verify_page["Email Verification<br/>[page.tsx]"]
  node_users["User Collection<br/>[Users.ts]"]
end

subgraph group_commerce["Commerce"]
  node_cart_page["Cart &amp; Checkout<br/>[page.tsx]"]
  node_cart_state["Cart State<br/>[use-cart.ts]"]
  node_payment_api["Payment API<br/>[payment-router.ts]"]
  node_stripe["Stripe Checkout<br/>[stripe.ts]"]
  node_webhook["Payment Webhook<br/>[webhooks.ts]"]
  node_orders[("Orders<br/>[Orders.ts]")]
  node_thanks["Order Confirmation<br/>[page.tsx]"]
  node_receipt["Receipt Email<br/>[ReceiptEmail.tsx]"]
end

subgraph group_platform["Marketplace Platform"]
  node_trpc_api["tRPC API<br/>[index.ts]"]
  node_server["Application Server<br/>[server.ts]"]
  node_payload["Payload CMS<br/>[get-payload.ts]"]
  node_product_admin["Product Management<br/>[Products.ts]"]
  node_product_files["Product Files<br/>[ProductFile.ts]"]
  node_media["Media Collection<br/>[Media.ts]"]
end

node_shopper(("Shopper"))
node_admin(("Seller / Admin"))
node_email_service["Email Service"]

node_shopper -->|"browses"| node_home
node_shopper -->|"browses"| node_catalog
node_shopper -->|"views"| node_product_page
node_home -->|"renders"| node_product_reel
node_catalog -->|"renders"| node_product_reel
node_product_page -->|"renders"| node_product_reel
node_product_reel -->|"renders"| node_listing
node_product_page -->|"renders"| node_image_slider
node_product_page -->|"adds products"| node_cart_state
node_shopper -->|"manages cart"| node_cart_page
node_cart_page -->|"reads cart"| node_cart_state
node_auth_pages -->|"calls"| node_auth_api
node_verify_page -->|"verifies through"| node_auth_api
node_auth_api -->|"authenticates users"| node_payload
node_auth_api -->|"creates users"| node_users
node_server -->|"mounts"| node_trpc_api
node_trpc_api -->|"registers"| node_auth_api
node_trpc_api -->|"registers"| node_payment_api
node_trpc_api -->|"queries products"| node_payload
node_admin -.->|"manages products"| node_product_admin
node_admin -.->|"uploads assets"| node_product_files
node_product_admin -.->|"configures collection"| node_payload
node_product_page -->|"loads product"| node_payload
node_cart_page -->|"starts checkout"| node_payment_api
node_payment_api -->|"loads products"| node_payload
node_payment_api -->|"creates order"| node_orders
node_payment_api -->|"creates session"| node_stripe
node_stripe -.->|"sends event"| node_webhook
node_server -->|"mounts handler"| node_webhook
node_webhook -->|"validates event"| node_stripe
node_webhook -->|"loads and updates"| node_payload
node_webhook -->|"marks paid"| node_orders
node_thanks -->|"loads order"| node_payload
node_thanks -->|"polls status"| node_payment_api
node_webhook -->|"renders"| node_receipt
node_webhook -->|"sends receipt"| node_email_service
node_product_admin -.->|"uses media"| node_media

click node_home "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/app/page.tsx"
click node_catalog "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/app/products/page.tsx"
click node_product_page "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/app/product/%5BproductId%5D/page.tsx"
click node_product_reel "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/components/ProductReel.tsx"
click node_listing "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/components/ProductListing.tsx"
click node_image_slider "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/components/ImageSlider.tsx"
click node_cart_page "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/app/cart/page.tsx"
click node_cart_state "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/hooks/use-cart.ts"
click node_auth_pages "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/app/(auth)/sign-in/page.tsx"
click node_auth_api "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/trpc/auth-router.ts"
click node_verify_page "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/app/(auth)/verify-email/page.tsx"
click node_trpc_api "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/trpc/index.ts"
click node_server "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/server.ts"
click node_payload "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/get-payload.ts"
click node_product_admin "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/collections/Products/Products.ts"
click node_product_files "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/collections/ProductFile.ts"
click node_media "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/collections/Media.ts"
click node_users "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/collections/Users.ts"
click node_payment_api "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/trpc/payment-router.ts"
click node_stripe "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/lib/stripe.ts"
click node_webhook "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/webhooks.ts"
click node_orders "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/collections/Orders.ts"
click node_thanks "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/app/thank-you/page.tsx"
click node_receipt "https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/components/emails/ReceiptEmail.tsx"

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_catalog,node_product_page,node_product_reel,node_listing,node_image_slider toneBlue
class node_auth_pages,node_auth_api,node_verify_page,node_users toneAmber
class node_cart_page,node_cart_state,node_payment_api,node_stripe,node_webhook,node_orders,node_thanks,node_receipt toneMint
class node_trpc_api,node_server,node_payload,node_product_admin,node_product_files,node_media toneRose
class node_shopper,node_admin,node_email_service toneIndigo
```

## Components

### Storefront

- [Landing Page](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/app/page.tsx): `src/app/page.tsx`
- [Product Catalog](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/app/products/page.tsx): `src/app/products/page.tsx`
- [Product Detail](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/app/product/%5BproductId%5D/page.tsx): `src/app/product/[productId]/page.tsx`
- [Product Reel](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/components/ProductReel.tsx): `src/components/ProductReel.tsx`
- [Product Listing](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/components/ProductListing.tsx): `src/components/ProductListing.tsx`
- [Image Slider](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/components/ImageSlider.tsx): `src/components/ImageSlider.tsx`

### Identity

- [Sign-in / Sign-up](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/app/(auth)/sign-in/page.tsx): `src/app/(auth)/sign-in/page.tsx`
- [Authentication API](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/trpc/auth-router.ts): `src/trpc/auth-router.ts`
- [Email Verification](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/app/(auth)/verify-email/page.tsx): `src/app/(auth)/verify-email/page.tsx`
- [User Collection](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/collections/Users.ts): `src/collections/Users.ts`

### Commerce

- [Cart & Checkout](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/app/cart/page.tsx): `src/app/cart/page.tsx`
- [Cart State](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/hooks/use-cart.ts): `src/hooks/use-cart.ts`
- [Payment API](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/trpc/payment-router.ts): `src/trpc/payment-router.ts`
- [Stripe Checkout](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/lib/stripe.ts): `src/lib/stripe.ts`
- [Payment Webhook](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/webhooks.ts): `src/webhooks.ts`
- [Orders](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/collections/Orders.ts): `src/collections/Orders.ts`
- [Order Confirmation](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/app/thank-you/page.tsx): `src/app/thank-you/page.tsx`
- [Receipt Email](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/components/emails/ReceiptEmail.tsx): `src/components/emails/ReceiptEmail.tsx`

### Marketplace Platform

- [tRPC API](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/trpc/index.ts): `src/trpc/index.ts`
- [Application Server](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/server.ts): `src/server.ts`
- [Payload CMS](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/get-payload.ts): `src/get-payload.ts`
- [Product Management](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/collections/Products/Products.ts): `src/collections/Products/Products.ts`
- [Product Files](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/collections/ProductFile.ts): `src/collections/ProductFile.ts`
- [Media Collection](https://github.com/mohamedbrzan/hippo_digital_app/blob/master/src/collections/Media.ts): `src/collections/Media.ts`

### Other components

- **Shopper**
- **Seller / Admin**
- **Email Service**

## Connections

- Shopper → Landing Page: browses
- Shopper → Product Catalog: browses
- Shopper → Product Detail: views (evidence: `src/app/product/[productId]/page.tsx`)
- Landing Page → Product Reel: renders (evidence: `src/app/page.tsx`)
- Product Catalog → Product Reel: renders (evidence: `src/app/products/page.tsx`)
- Product Detail → Product Reel: renders (evidence: `src/app/product/[productId]/page.tsx`)
- Product Reel → Product Listing: renders (evidence: `src/components/ProductReel.tsx`)
- Product Detail → Image Slider: renders (evidence: `src/app/product/[productId]/page.tsx`)
- Product Detail → Cart State: adds products
- Shopper → Cart & Checkout: manages cart
- Cart & Checkout → Cart State: reads cart (evidence: `src/app/cart/page.tsx`)
- Sign-in / Sign-up → Authentication API: calls (evidence: `src/app/(auth)/sign-in/page.tsx`)
- Email Verification → Authentication API: verifies through (evidence: `src/app/(auth)/verify-email/page.tsx`)
- Authentication API → Payload CMS: authenticates users (evidence: `src/trpc/auth-router.ts`)
- Authentication API → User Collection: creates users (evidence: `src/trpc/auth-router.ts`)
- Application Server → tRPC API: mounts (evidence: `src/server.ts`)
- tRPC API → Authentication API: registers (evidence: `src/trpc/index.ts`)
- tRPC API → Payment API: registers (evidence: `src/trpc/index.ts`)
- tRPC API → Payload CMS: queries products (evidence: `src/trpc/index.ts`)
- Seller / Admin → Product Management: manages products
- Seller / Admin → Product Files: uploads assets
- Product Management → Payload CMS: configures collection
- Product Detail → Payload CMS: loads product (evidence: `src/app/product/[productId]/page.tsx`)
- Cart & Checkout → Payment API: starts checkout (evidence: `src/app/cart/page.tsx`)
- Payment API → Payload CMS: loads products (evidence: `src/trpc/payment-router.ts`)
- Payment API → Orders: creates order (evidence: `src/trpc/payment-router.ts`)
- Payment API → Stripe Checkout: creates session (evidence: `src/trpc/payment-router.ts`)
- Stripe Checkout → Payment Webhook: sends event (evidence: `src/webhooks.ts`)
- Application Server → Payment Webhook: mounts handler (evidence: `src/server.ts`)
- Payment Webhook → Stripe Checkout: validates event (evidence: `src/webhooks.ts`)
- Payment Webhook → Payload CMS: loads and updates (evidence: `src/webhooks.ts`)
- Payment Webhook → Orders: marks paid (evidence: `src/webhooks.ts`)
- Order Confirmation → Payload CMS: loads order (evidence: `src/app/thank-you/page.tsx`)
- Order Confirmation → Payment API: polls status
- Payment Webhook → Receipt Email: renders (evidence: `src/webhooks.ts`)
- Payment Webhook → Email Service: sends receipt (evidence: `src/webhooks.ts`)
- Product Management → Media Collection: uses media
