# krestonosech/stuffbypoizon-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/krestonosech/stuffbypoizon-frontend
- Repository: https://github.com/krestonosech/stuffbypoizon-frontend

## Overview

STUFFBYPOIZON is a customer-facing ecommerce storefront with an administrative product and order interface. The main shopper flow is browsing/searching products, viewing a product, adding items to a cart, and managing account, favorites, and reviews. The graph also includes the shared authentication and API-client layer. The README gives no further capability details; several client components were only partially excerpted, so links to backend endpoints are shown only where API usage is evidenced.

Main entry points: [`lib/api.ts`](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/lib/api.ts) (API Client), [`app/catalog/CatalogClient.tsx`](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/catalog/CatalogClient.tsx) (Catalog and Filters), [`components/layout/Header.tsx`](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/components/layout/Header.tsx) (Header), [`lib/auth-context.tsx`](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/lib/auth-context.tsx) (Auth Context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_home["Home<br/>[home-client.tsx]"]
  node_catalog["Catalog and Filters<br/>[CatalogClient.tsx]"]
end

subgraph group_shopping["Shopping"]
  node_product["Product Detail<br/>[ProductClient.tsx]"]
  node_cart["Cart and Checkout<br/>[CartClient.tsx]"]
  node_favorites["Favorites"]
  node_reviews["Reviews<br/>[ReviewsClient.tsx]"]
end

subgraph group_account_ops["Account and Admin"]
  node_login["Login<br/>[LoginForm.tsx]"]
  node_register["Registration<br/>[RegisterForm.tsx]"]
  node_forgot_password["Password Recovery<br/>[page.tsx]"]
  node_profile["Profile and Orders<br/>[ProfileClient.tsx]"]
  node_admin["Admin Console<br/>[AdminClient.tsx]"]
  node_product_create["Product Creation<br/>[CreateProduct.tsx]"]
  node_product_edit["Product Editing<br/>[EditProduct.tsx]"]
end

subgraph group_shared["Shared Services"]
  node_favorite_helpers["Favorite Helpers<br/>[favorites.ts]"]
  node_app_shell["App Shell<br/>[layout.tsx]"]
  node_header["Header<br/>[Header.tsx]"]
  node_footer["Footer<br/>[Footer.tsx]"]
  node_protected_route["Route Guard<br/>[ProtectedRoute.tsx]"]
  node_auth["Auth Context<br/>[auth-context.tsx]"]
  node_api["API Client<br/>[api.ts]"]
end

node_shopper(("Shopper"))
node_backend{{"Commerce API"}}

node_shopper -->|"browses"| node_home
node_shopper -->|"searches"| node_catalog
node_shopper -->|"views"| node_product
node_shopper -->|"manages cart"| node_cart
node_shopper -->|"saves items"| node_favorites
node_shopper -->|"signs in"| node_login
node_shopper -->|"registers"| node_register
node_shopper -->|"recovers access"| node_forgot_password
node_shopper -->|"manages account"| node_profile
node_shopper -->|"reads or submits"| node_reviews
node_home -->|"fetches products"| node_api
node_catalog -->|"searches products"| node_api
node_catalog -->|"loads filters"| node_api
node_product -->|"loads product and cart"| node_api
node_cart -->|"reads and updates cart"| node_api
node_favorites -->|"manages favorites"| node_api
node_favorites -->|"adds cart items"| node_api
node_favorite_helpers -->|"uses client"| node_api
node_reviews -->|"loads and submits reviews"| node_api
node_reviews -->|"checks delivered orders"| node_api
node_login -->|"authenticates"| node_api
node_register -->|"registers account"| node_api
node_profile -->|"loads orders and reviews"| node_api
node_admin -->|"manages products and orders"| node_api
node_admin -->|"renders"| node_product_create
node_admin -->|"renders"| node_product_edit
node_admin -->|"guards console"| node_protected_route
node_profile -->|"guards profile"| node_protected_route
node_protected_route -->|"checks session"| node_auth
node_app_shell -->|"provides context"| node_auth
node_auth -->|"checks session"| node_api
node_header -->|"reads user"| node_auth
node_header -->|"fetches search and counts"| node_api
node_footer -->|"reads user"| node_auth
node_home -->|"renders"| node_header
node_home -->|"renders"| node_footer
node_catalog -->|"renders"| node_header
node_catalog -->|"renders"| node_footer
node_cart -->|"renders"| node_header
node_cart -->|"renders"| node_footer
node_api -->|"sends requests"| node_backend

click node_home "https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/home-client.tsx"
click node_catalog "https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/catalog/CatalogClient.tsx"
click node_product "https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/product/%5Bid%5D/ProductClient.tsx"
click node_cart "https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/cart/CartClient.tsx"
click node_favorites "https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/favorites/FavoritesClient.tsx"
click node_favorite_helpers "https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/lib/favorites.ts"
click node_reviews "https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/reviews/ReviewsClient.tsx"
click node_login "https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/(auth)/login/LoginForm.tsx"
click node_register "https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/(auth)/register/RegisterForm.tsx"
click node_forgot_password "https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/(auth)/forgot-password/page.tsx"
click node_profile "https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/profile/ProfileClient.tsx"
click node_admin "https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/admin/AdminClient.tsx"
click node_product_create "https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/admin/CreateProduct.tsx"
click node_product_edit "https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/admin/EditProduct.tsx"
click node_app_shell "https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/layout.tsx"
click node_header "https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/components/layout/Header.tsx"
click node_footer "https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/components/layout/Footer.tsx"
click node_protected_route "https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/components/ProtectedRoute.tsx"
click node_auth "https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/lib/auth-context.tsx"
click node_api "https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/lib/api.ts"

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 toneBlue
class node_product,node_cart,node_favorites,node_reviews toneAmber
class node_login,node_register,node_forgot_password,node_profile,node_admin,node_product_create,node_product_edit,node_backend toneMint
class node_favorite_helpers,node_app_shell,node_header,node_footer,node_protected_route,node_auth,node_api toneRose
class node_shopper toneIndigo
```

## Components

### Storefront

- [Home](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/home-client.tsx): `app/home-client.tsx`
- [Catalog and Filters](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/catalog/CatalogClient.tsx): `app/catalog/CatalogClient.tsx`

### Shopping

- [Product Detail](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/product/%5Bid%5D/ProductClient.tsx): `app/product/[id]/ProductClient.tsx`
- [Cart and Checkout](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/cart/CartClient.tsx): `app/cart/CartClient.tsx`
- [Favorites](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/favorites/FavoritesClient.tsx): `app/favorites/FavoritesClient.tsx`
- [Reviews](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/reviews/ReviewsClient.tsx): `app/reviews/ReviewsClient.tsx`

### Account and Admin

- [Login](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/(auth)/login/LoginForm.tsx): `app/(auth)/login/LoginForm.tsx`
- [Registration](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/(auth)/register/RegisterForm.tsx): `app/(auth)/register/RegisterForm.tsx`
- [Password Recovery](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/(auth)/forgot-password/page.tsx): `app/(auth)/forgot-password/page.tsx`
- [Profile and Orders](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/profile/ProfileClient.tsx): `app/profile/ProfileClient.tsx`
- [Admin Console](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/admin/AdminClient.tsx): `app/admin/AdminClient.tsx`
- [Product Creation](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/admin/CreateProduct.tsx): `app/admin/CreateProduct.tsx`
- [Product Editing](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/admin/EditProduct.tsx): `app/admin/EditProduct.tsx`

### Shared Services

- [Favorite Helpers](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/lib/favorites.ts): `lib/favorites.ts`
- [App Shell](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/app/layout.tsx): `app/layout.tsx`
- [Header](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/components/layout/Header.tsx): `components/layout/Header.tsx`
- [Footer](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/components/layout/Footer.tsx): `components/layout/Footer.tsx`
- [Route Guard](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/components/ProtectedRoute.tsx): `components/ProtectedRoute.tsx`
- [Auth Context](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/lib/auth-context.tsx): `lib/auth-context.tsx`
- [API Client](https://github.com/krestonosech/stuffbypoizon-frontend/blob/main/lib/api.ts): `lib/api.ts`

### Other components

- **Shopper**
- **Commerce API**

## Connections

- Shopper → Home: browses
- Shopper → Catalog and Filters: searches
- Shopper → Product Detail: views
- Shopper → Cart and Checkout: manages cart
- Shopper → Favorites: saves items
- Shopper → Login: signs in
- Shopper → Registration: registers
- Shopper → Password Recovery: recovers access
- Shopper → Profile and Orders: manages account
- Shopper → Reviews: reads or submits (evidence: `app/reviews/ReviewsClient.tsx`)
- Home → API Client: fetches products (evidence: `app/home-client.tsx`)
- Catalog and Filters → API Client: searches products (evidence: `app/catalog/CatalogClient.tsx`)
- Catalog and Filters → API Client: loads filters (evidence: `app/catalog/CatalogClient.tsx`)
- Product Detail → API Client: loads product and cart (evidence: `app/product/[id]/ProductClient.tsx`)
- Cart and Checkout → API Client: reads and updates cart (evidence: `app/cart/CartClient.tsx`)
- Favorites → API Client: manages favorites (evidence: `app/favorites/FavoritesClient.tsx`)
- Favorites → API Client: adds cart items (evidence: `app/favorites/FavoritesClient.tsx`)
- Favorite Helpers → API Client: uses client (evidence: `lib/favorites.ts`)
- Reviews → API Client: loads and submits reviews (evidence: `app/reviews/ReviewsClient.tsx`)
- Reviews → API Client: checks delivered orders (evidence: `app/reviews/ReviewsClient.tsx`)
- Login → API Client: authenticates (evidence: `app/(auth)/login/LoginForm.tsx`)
- Registration → API Client: registers account (evidence: `app/(auth)/register/RegisterForm.tsx`)
- Profile and Orders → API Client: loads orders and reviews (evidence: `app/profile/ProfileClient.tsx`)
- Admin Console → API Client: manages products and orders (evidence: `app/admin/AdminClient.tsx`)
- Admin Console → Product Creation: renders (evidence: `app/admin/AdminClient.tsx`)
- Admin Console → Product Editing: renders (evidence: `app/admin/AdminClient.tsx`)
- Admin Console → Route Guard: guards console (evidence: `app/admin/AdminClient.tsx`)
- Profile and Orders → Route Guard: guards profile (evidence: `app/profile/ProfileClient.tsx`)
- Route Guard → Auth Context: checks session (evidence: `components/ProtectedRoute.tsx`)
- App Shell → Auth Context: provides context (evidence: `app/layout.tsx`)
- Auth Context → API Client: checks session (evidence: `lib/auth-context.tsx`)
- Header → Auth Context: reads user (evidence: `components/layout/Header.tsx`)
- Header → API Client: fetches search and counts (evidence: `components/layout/Header.tsx`)
- Footer → Auth Context: reads user (evidence: `components/layout/Footer.tsx`)
- Home → Header: renders (evidence: `app/home-client.tsx`)
- Home → Footer: renders (evidence: `app/home-client.tsx`)
- Catalog and Filters → Header: renders (evidence: `app/catalog/CatalogClient.tsx`)
- Catalog and Filters → Footer: renders (evidence: `app/catalog/CatalogClient.tsx`)
- Cart and Checkout → Header: renders (evidence: `app/cart/CartClient.tsx`)
- Cart and Checkout → Footer: renders (evidence: `app/cart/CartClient.tsx`)
- API Client → Commerce API: sends requests (evidence: `lib/api.ts`)
