# rockykj/e-commerce-campus-project architecture

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

- Interactive diagram: https://gitdiagram.com/rockykj/e-commerce-campus-project
- Repository: https://github.com/rockykj/e-commerce-campus-project

## Overview

Trident Fashion is a React storefront: shoppers browse products, inspect details, add items to a persistent cart, and fill out checkout; a separate screen simulates sign-in and account creation. The sampled checkout and authentication code is client-side only: no order, payment, or account service is evidenced. The graph shows routed pages and cart state ownership; UI primitives are grouped as an internal layer. Some page and product relationships are supported only by the SOURCE INDEX rather than full excerpts.

Main entry points: [`src/App.tsx`](https://github.com/rockykj/e-commerce-campus-project/blob/main/src/App.tsx) (App Router), [`src/contexts/CartContext.tsx`](https://github.com/rockykj/e-commerce-campus-project/blob/main/src/contexts/CartContext.tsx) (Cart State), [`src/components/ProductCard.tsx`](https://github.com/rockykj/e-commerce-campus-project/blob/main/src/components/ProductCard.tsx) (Product Card), [`src/components/Header.tsx`](https://github.com/rockykj/e-commerce-campus-project/blob/main/src/components/Header.tsx) (Store Header)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app["App Router<br/>[App.tsx]"]
  node_header["Store Header<br/>[Header.tsx]"]
  node_home["Home Page<br/>[Home.tsx]"]
  node_products["Product Listing<br/>[Products.tsx]"]
  node_detail["Product Detail<br/>[ProductDetail.tsx]"]
  node_productcard["Product Card<br/>[ProductCard.tsx]"]
end

subgraph group_commerce["Shopping Flow"]
  node_cart["Cart Page<br/>[Cart.tsx]"]
  node_cartstate["Cart State<br/>[CartContext.tsx]"]
  node_localstore[("Browser Storage")]
  node_checkout["Checkout Form<br/>[Checkout.tsx]"]
end

subgraph group_account["Account"]
  node_auth["Auth Forms<br/>[Auth.tsx]"]
end

subgraph group_ui["UI Layer"]
  node_uicomponents["UI Primitives"]
  node_toaststate["Toast State<br/>[use-toast.ts]"]
  node_toastview["Toast View<br/>[toast.tsx]"]
  node_classutils["Class Utilities<br/>[utils.ts]"]
end

node_shopper(("Shopper"))

node_shopper -->|"opens storefront"| node_app
node_app -->|"renders"| node_header
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_products
node_app -->|"routes to"| node_detail
node_app -->|"routes to"| node_cart
node_app -->|"routes to"| node_checkout
node_app -->|"routes to"| node_auth
node_home -->|"renders"| node_productcard
node_products -->|"renders"| node_productcard
node_productcard -->|"adds item"| node_cartstate
node_detail -->|"uses cart"| node_cartstate
node_header -->|"reads count"| node_cartstate
node_cart -->|"manages items"| node_cartstate
node_checkout -->|"reads and clears"| node_cartstate
node_cartstate -->|"persists cart"| node_localstore
node_auth -->|"simulates sign-in"| node_shopper
node_app -->|"uses providers"| node_uicomponents
node_app -->|"mounts toaster"| node_toaststate
node_toaststate -->|"uses toast types"| node_toastview
node_uicomponents -.->|"merges classes"| node_classutils

click node_app "https://github.com/rockykj/e-commerce-campus-project/blob/main/src/App.tsx"
click node_header "https://github.com/rockykj/e-commerce-campus-project/blob/main/src/components/Header.tsx"
click node_home "https://github.com/rockykj/e-commerce-campus-project/blob/main/src/pages/Home.tsx"
click node_products "https://github.com/rockykj/e-commerce-campus-project/blob/main/src/pages/Products.tsx"
click node_detail "https://github.com/rockykj/e-commerce-campus-project/blob/main/src/pages/ProductDetail.tsx"
click node_productcard "https://github.com/rockykj/e-commerce-campus-project/blob/main/src/components/ProductCard.tsx"
click node_cart "https://github.com/rockykj/e-commerce-campus-project/blob/main/src/pages/Cart.tsx"
click node_cartstate "https://github.com/rockykj/e-commerce-campus-project/blob/main/src/contexts/CartContext.tsx"
click node_checkout "https://github.com/rockykj/e-commerce-campus-project/blob/main/src/pages/Checkout.tsx"
click node_auth "https://github.com/rockykj/e-commerce-campus-project/blob/main/src/pages/Auth.tsx"
click node_uicomponents "https://github.com/rockykj/e-commerce-campus-project/tree/main/src/components/ui"
click node_toaststate "https://github.com/rockykj/e-commerce-campus-project/blob/main/src/hooks/use-toast.ts"
click node_toastview "https://github.com/rockykj/e-commerce-campus-project/blob/main/src/components/ui/toast.tsx"
click node_classutils "https://github.com/rockykj/e-commerce-campus-project/blob/main/src/lib/utils.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_app,node_header,node_home,node_products,node_detail,node_productcard toneBlue
class node_cart,node_cartstate,node_localstore,node_checkout toneAmber
class node_auth toneMint
class node_uicomponents,node_toaststate,node_toastview,node_classutils toneRose
class node_shopper toneIndigo
```

## Components

### Storefront

- [App Router](https://github.com/rockykj/e-commerce-campus-project/blob/main/src/App.tsx): `src/App.tsx`
- [Store Header](https://github.com/rockykj/e-commerce-campus-project/blob/main/src/components/Header.tsx): `src/components/Header.tsx`
- [Home Page](https://github.com/rockykj/e-commerce-campus-project/blob/main/src/pages/Home.tsx): `src/pages/Home.tsx`
- [Product Listing](https://github.com/rockykj/e-commerce-campus-project/blob/main/src/pages/Products.tsx): `src/pages/Products.tsx`
- [Product Detail](https://github.com/rockykj/e-commerce-campus-project/blob/main/src/pages/ProductDetail.tsx): `src/pages/ProductDetail.tsx`
- [Product Card](https://github.com/rockykj/e-commerce-campus-project/blob/main/src/components/ProductCard.tsx): `src/components/ProductCard.tsx`

### Shopping Flow

- [Cart Page](https://github.com/rockykj/e-commerce-campus-project/blob/main/src/pages/Cart.tsx): `src/pages/Cart.tsx`
- [Cart State](https://github.com/rockykj/e-commerce-campus-project/blob/main/src/contexts/CartContext.tsx): `src/contexts/CartContext.tsx`
- **Browser Storage**
- [Checkout Form](https://github.com/rockykj/e-commerce-campus-project/blob/main/src/pages/Checkout.tsx): `src/pages/Checkout.tsx`

### Account

- [Auth Forms](https://github.com/rockykj/e-commerce-campus-project/blob/main/src/pages/Auth.tsx): `src/pages/Auth.tsx`

### UI Layer

- [UI Primitives](https://github.com/rockykj/e-commerce-campus-project/tree/main/src/components/ui): `src/components/ui`
- [Toast State](https://github.com/rockykj/e-commerce-campus-project/blob/main/src/hooks/use-toast.ts): `src/hooks/use-toast.ts`
- [Toast View](https://github.com/rockykj/e-commerce-campus-project/blob/main/src/components/ui/toast.tsx): `src/components/ui/toast.tsx`
- [Class Utilities](https://github.com/rockykj/e-commerce-campus-project/blob/main/src/lib/utils.ts): `src/lib/utils.ts`

### Other components

- **Shopper**

## Connections

- Shopper → App Router: opens storefront (evidence: `src/App.tsx`)
- App Router → Store Header: renders (evidence: `src/App.tsx`)
- App Router → Home Page: routes to (evidence: `src/App.tsx`)
- App Router → Product Listing: routes to (evidence: `src/App.tsx`)
- App Router → Product Detail: routes to (evidence: `src/App.tsx`)
- App Router → Cart Page: routes to (evidence: `src/App.tsx`)
- App Router → Checkout Form: routes to (evidence: `src/App.tsx`)
- App Router → Auth Forms: routes to (evidence: `src/App.tsx`)
- Home Page → Product Card: renders (evidence: `src/pages/Home.tsx`)
- Product Listing → Product Card: renders (evidence: `src/pages/Products.tsx`)
- Product Card → Cart State: adds item (evidence: `src/components/ProductCard.tsx`)
- Product Detail → Cart State: uses cart (evidence: `src/pages/ProductDetail.tsx`)
- Store Header → Cart State: reads count (evidence: `src/components/Header.tsx`)
- Cart Page → Cart State: manages items (evidence: `src/pages/Cart.tsx`)
- Checkout Form → Cart State: reads and clears (evidence: `src/pages/Checkout.tsx`)
- Cart State → Browser Storage: persists cart (evidence: `src/contexts/CartContext.tsx`)
- Auth Forms → Shopper: simulates sign-in (evidence: `src/pages/Auth.tsx`)
- App Router → UI Primitives: uses providers (evidence: `src/App.tsx`)
- App Router → Toast State: mounts toaster (evidence: `src/App.tsx`)
- Toast State → Toast View: uses toast types (evidence: `src/hooks/use-toast.ts`)
- UI Primitives → Class Utilities: merges classes (evidence: `src/components/ui/button.tsx`)
