# visagan09-creator/creatingx architecture

> Architecture diagram of the GitHub repository visagan09-creator/creatingx, 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/visagan09-creator/creatingx
- Repository: https://github.com/visagan09-creator/creatingx

## Overview

This is a custom-apparel ecommerce storefront with a product catalog, product discovery and detail views, a cart and checkout, payment handling, and an interactive T-shirt design studio. The main flow is shopper navigation through the hash router, catalog-backed browsing, cart management, checkout, and payment return. The graph includes the documented catalog, content, and customizer capabilities. Source excerpts do not show every runtime call, so uncertain links—particularly browser-to-server payment wiring—are omitted or marked unverified.

Main entry points: [`src/App.tsx`](https://github.com/visagan09-creator/creatingx/blob/main/src/App.tsx) (App composition), [`src/hooks/useCart.ts`](https://github.com/visagan09-creator/creatingx/blob/main/src/hooks/useCart.ts) (Cart state), [`src/features/tshirt-customizer/TShirtCustomizer.tsx`](https://github.com/visagan09-creator/creatingx/blob/main/src/features/tshirt-customizer/TShirtCustomizer.tsx) (T-shirt designer), [`src/components`](https://github.com/visagan09-creator/creatingx/tree/main/src/components) (Storefront pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app["App composition<br/>[App.tsx]"]
  node_router["Hash router<br/>[useRouter.ts]"]
  node_storefront_pages["Storefront pages"]
  node_catalog_page["Product browsing<br/>[Collection.tsx]"]
  node_product_details["Product details"]
  node_totd_details["TOTD details"]
  node_search["Product search<br/>[SearchDrawer.tsx]"]
end

subgraph group_commerce["Shopping and payment"]
  node_cart["Cart state<br/>[useCart.ts]"]
  node_cart_drawer["Cart drawer<br/>[CartDrawer.tsx]"]
  node_checkout["Checkout<br/>[CheckoutPage.tsx]"]
  node_payment_return["Payment return"]
  node_payment_api["Payment API client<br/>[paymentApi.ts]"]
end

subgraph group_content["Catalog and content"]
  node_catalog_hook["Catalog hook<br/>[useCatalog.ts]"]
  node_firestore_content["Firestore content"]
  node_site_data["Static site data<br/>[siteData.ts]"]
  node_firebase["Firebase client<br/>[firebase.ts]"]
  node_firestore[("Firestore")]
end

subgraph group_customizer["Design studio"]
  node_customize_page["Customize entry<br/>[Customize.tsx]"]
  node_customizer["T-shirt designer"]
  node_viewer["3D garment viewer<br/>[TShirt3DViewer.tsx]"]
  node_presets["Design presets<br/>[presets.ts]"]
end

subgraph group_services["Backend services"]
  node_payment_gateway["Gateway adapter<br/>[index.cjs]"]
  node_cashfree["Cashfree adapter<br/>[cashfree.cjs]"]
  node_server["Payment server<br/>[server.cjs]"]
end

node_shopper(("Shopper"))

node_shopper -->|"browses"| node_app
node_app -->|"uses routing"| node_router
node_app -->|"renders"| node_storefront_pages
node_app -->|"renders"| node_catalog_page
node_app -->|"renders"| node_product_details
node_app -->|"renders"| node_totd_details
node_app -->|"renders"| node_search
node_app -->|"uses"| node_cart
node_app -->|"uses"| node_catalog_hook
node_app -->|"renders"| node_cart_drawer
node_app -->|"renders"| node_checkout
node_app -->|"renders"| node_payment_return
node_app -->|"renders"| node_customize_page
node_router -->|"selects page"| node_storefront_pages
node_catalog_hook -->|"loads content"| node_firestore_content
node_firestore_content -->|"uses client"| node_firebase
node_firebase -.->|"connects"| node_firestore
node_storefront_pages -->|"uses content"| node_site_data
node_catalog_page -.->|"shares products"| node_search
node_product_details -->|"adds items"| node_cart
node_totd_details -->|"adds items"| node_cart
node_cart_drawer -->|"displays state"| node_cart
node_checkout -->|"requests payment"| node_payment_api
node_payment_return -->|"checks status"| node_payment_api
node_server -->|"delegates payments"| node_payment_gateway
node_payment_gateway -->|"dispatches to"| node_cashfree
node_customize_page -.->|"launches"| node_customizer
node_customizer -->|"renders preview"| node_viewer
node_customizer -->|"uses designs"| node_presets
node_payment_api -.->|"calls endpoint"| node_server

click node_app "https://github.com/visagan09-creator/creatingx/blob/main/src/App.tsx"
click node_router "https://github.com/visagan09-creator/creatingx/blob/main/src/hooks/useRouter.ts"
click node_storefront_pages "https://github.com/visagan09-creator/creatingx/tree/main/src/components"
click node_catalog_page "https://github.com/visagan09-creator/creatingx/blob/main/src/components/Collection.tsx"
click node_product_details "https://github.com/visagan09-creator/creatingx/blob/main/src/components/ProductDetailsPage.tsx"
click node_totd_details "https://github.com/visagan09-creator/creatingx/blob/main/src/components/TOTDProductDetailsPage.tsx"
click node_search "https://github.com/visagan09-creator/creatingx/blob/main/src/components/SearchDrawer.tsx"
click node_cart "https://github.com/visagan09-creator/creatingx/blob/main/src/hooks/useCart.ts"
click node_cart_drawer "https://github.com/visagan09-creator/creatingx/blob/main/src/components/CartDrawer.tsx"
click node_checkout "https://github.com/visagan09-creator/creatingx/blob/main/src/components/CheckoutPage.tsx"
click node_payment_return "https://github.com/visagan09-creator/creatingx/blob/main/src/components/PaymentReturnPage.tsx"
click node_payment_api "https://github.com/visagan09-creator/creatingx/blob/main/src/lib/paymentApi.ts"
click node_payment_gateway "https://github.com/visagan09-creator/creatingx/blob/main/gateway/index.cjs"
click node_cashfree "https://github.com/visagan09-creator/creatingx/blob/main/gateway/cashfree.cjs"
click node_server "https://github.com/visagan09-creator/creatingx/blob/main/server.cjs"
click node_catalog_hook "https://github.com/visagan09-creator/creatingx/blob/main/src/hooks/useCatalog.ts"
click node_firestore_content "https://github.com/visagan09-creator/creatingx/blob/main/src/data/firestoreContent.ts"
click node_site_data "https://github.com/visagan09-creator/creatingx/blob/main/src/data/siteData.ts"
click node_firebase "https://github.com/visagan09-creator/creatingx/blob/main/src/lib/firebase.ts"
click node_customize_page "https://github.com/visagan09-creator/creatingx/blob/main/src/components/Customize.tsx"
click node_customizer "https://github.com/visagan09-creator/creatingx/blob/main/src/features/tshirt-customizer/TShirtCustomizer.tsx"
click node_viewer "https://github.com/visagan09-creator/creatingx/blob/main/src/features/tshirt-customizer/components/TShirt3DViewer.tsx"
click node_presets "https://github.com/visagan09-creator/creatingx/blob/main/src/features/tshirt-customizer/presets.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_router,node_storefront_pages,node_catalog_page,node_product_details,node_totd_details,node_search toneBlue
class node_cart,node_cart_drawer,node_checkout,node_payment_return,node_payment_api toneAmber
class node_catalog_hook,node_firestore_content,node_site_data,node_firebase,node_firestore toneMint
class node_customize_page,node_customizer,node_viewer,node_presets toneRose
class node_payment_gateway,node_cashfree,node_server,node_shopper toneIndigo
```

## Components

### Storefront

- [App composition](https://github.com/visagan09-creator/creatingx/blob/main/src/App.tsx): `src/App.tsx`
- [Hash router](https://github.com/visagan09-creator/creatingx/blob/main/src/hooks/useRouter.ts): `src/hooks/useRouter.ts`
- [Storefront pages](https://github.com/visagan09-creator/creatingx/tree/main/src/components): `src/components`
- [Product browsing](https://github.com/visagan09-creator/creatingx/blob/main/src/components/Collection.tsx): `src/components/Collection.tsx`
- [Product details](https://github.com/visagan09-creator/creatingx/blob/main/src/components/ProductDetailsPage.tsx): `src/components/ProductDetailsPage.tsx`
- [TOTD details](https://github.com/visagan09-creator/creatingx/blob/main/src/components/TOTDProductDetailsPage.tsx): `src/components/TOTDProductDetailsPage.tsx`
- [Product search](https://github.com/visagan09-creator/creatingx/blob/main/src/components/SearchDrawer.tsx): `src/components/SearchDrawer.tsx`

### Shopping and payment

- [Cart state](https://github.com/visagan09-creator/creatingx/blob/main/src/hooks/useCart.ts): `src/hooks/useCart.ts`
- [Cart drawer](https://github.com/visagan09-creator/creatingx/blob/main/src/components/CartDrawer.tsx): `src/components/CartDrawer.tsx`
- [Checkout](https://github.com/visagan09-creator/creatingx/blob/main/src/components/CheckoutPage.tsx): `src/components/CheckoutPage.tsx`
- [Payment return](https://github.com/visagan09-creator/creatingx/blob/main/src/components/PaymentReturnPage.tsx): `src/components/PaymentReturnPage.tsx`
- [Payment API client](https://github.com/visagan09-creator/creatingx/blob/main/src/lib/paymentApi.ts): `src/lib/paymentApi.ts`

### Catalog and content

- [Catalog hook](https://github.com/visagan09-creator/creatingx/blob/main/src/hooks/useCatalog.ts): `src/hooks/useCatalog.ts`
- [Firestore content](https://github.com/visagan09-creator/creatingx/blob/main/src/data/firestoreContent.ts): `src/data/firestoreContent.ts`
- [Static site data](https://github.com/visagan09-creator/creatingx/blob/main/src/data/siteData.ts): `src/data/siteData.ts`
- [Firebase client](https://github.com/visagan09-creator/creatingx/blob/main/src/lib/firebase.ts): `src/lib/firebase.ts`
- **Firestore**

### Design studio

- [Customize entry](https://github.com/visagan09-creator/creatingx/blob/main/src/components/Customize.tsx): `src/components/Customize.tsx`
- [T-shirt designer](https://github.com/visagan09-creator/creatingx/blob/main/src/features/tshirt-customizer/TShirtCustomizer.tsx): `src/features/tshirt-customizer/TShirtCustomizer.tsx`
- [3D garment viewer](https://github.com/visagan09-creator/creatingx/blob/main/src/features/tshirt-customizer/components/TShirt3DViewer.tsx): `src/features/tshirt-customizer/components/TShirt3DViewer.tsx`
- [Design presets](https://github.com/visagan09-creator/creatingx/blob/main/src/features/tshirt-customizer/presets.ts): `src/features/tshirt-customizer/presets.ts`

### Backend services

- [Gateway adapter](https://github.com/visagan09-creator/creatingx/blob/main/gateway/index.cjs): `gateway/index.cjs`
- [Cashfree adapter](https://github.com/visagan09-creator/creatingx/blob/main/gateway/cashfree.cjs): `gateway/cashfree.cjs`
- [Payment server](https://github.com/visagan09-creator/creatingx/blob/main/server.cjs): `server.cjs`

### Other components

- **Shopper**

## Connections

- Shopper → App composition: browses
- App composition → Hash router: uses routing (evidence: `src/App.tsx`)
- App composition → Storefront pages: renders (evidence: `src/App.tsx`)
- App composition → Product browsing: renders (evidence: `src/App.tsx`)
- App composition → Product details: renders (evidence: `src/App.tsx`)
- App composition → TOTD details: renders (evidence: `src/App.tsx`)
- App composition → Product search: renders (evidence: `src/App.tsx`)
- App composition → Cart state: uses (evidence: `src/App.tsx`)
- App composition → Catalog hook: uses (evidence: `src/App.tsx`)
- App composition → Cart drawer: renders (evidence: `src/App.tsx`)
- App composition → Checkout: renders (evidence: `src/App.tsx`)
- App composition → Payment return: renders (evidence: `src/App.tsx`)
- App composition → Customize entry: renders (evidence: `src/App.tsx`)
- Hash router → Storefront pages: selects page (evidence: `src/App.tsx`)
- Catalog hook → Firestore content: loads content (evidence: `src/hooks/useCatalog.ts`)
- Firestore content → Firebase client: uses client (evidence: `src/data/firestoreContent.ts`)
- Firebase client → Firestore: connects
- Storefront pages → Static site data: uses content (evidence: `src/components/About.tsx`)
- Product browsing → Product search: shares products
- Product details → Cart state: adds items (evidence: `src/App.tsx`)
- TOTD details → Cart state: adds items (evidence: `src/App.tsx`)
- Cart drawer → Cart state: displays state (evidence: `src/App.tsx`)
- Checkout → Payment API client: requests payment (evidence: `src/components/CheckoutPage.tsx`)
- Payment return → Payment API client: checks status (evidence: `src/components/PaymentReturnPage.tsx`)
- Payment server → Gateway adapter: delegates payments (evidence: `server.cjs`)
- Gateway adapter → Cashfree adapter: dispatches to (evidence: `gateway/index.cjs`)
- Customize entry → T-shirt designer: launches
- T-shirt designer → 3D garment viewer: renders preview (evidence: `src/features/tshirt-customizer/TShirtCustomizer.tsx`)
- T-shirt designer → Design presets: uses designs (evidence: `src/features/tshirt-customizer/TShirtCustomizer.tsx`)
- Payment API client → Payment server: calls endpoint
