# mr-ja9s/cartooe_com3 architecture

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

- Interactive diagram: https://gitdiagram.com/mr-ja9s/cartooe_com3
- Repository: https://github.com/mr-ja9s/cartooe_com3

## Overview

#### Purpose and runtime
This is a storefront-style Next.js 15 application using the App Router, React 19, TypeScript, and Tailwind CSS. It is a frontend-focused catalog, search, cart, checkout, and wishlist experience backed by in-repo product data rather than visible API routes or database integrations.

Primary runtime entry points are `src/app/layout.tsx` for global shell/providers and `src/app/page.tsx` for the home route. Next.js configuration is in `next.config.mjs`.

#### Route composition
The App Router defines the customer journey:
- Home merchandising page: `src/app/page.tsx`
- Product browse/listing: `src/app/product-listing/page.tsx`
- Product detail: `src/app/product-detail/page.tsx`
- Search: `src/app/search/page.tsx`
- Cart and checkout: `src/app/cart/page.tsx`, `src/app/checkout/page.tsx`

Route-specific feature components isolate major presentation logic, notably `src/app/product-listing/components/ProductListing.tsx` and `src/app/product-detail/components/ProductDetail.tsx`.

#### Global application shell
`src/app/layout.tsx` establishes the shared document/layout boundary for every route. Shared navigation and persistent UI are implemented through `src/components/Header.tsx`, `src/components/Footer.tsx`, and `src/components/ToastContainer.tsx`.

This is the principal cross-route integration point: header actions can expose cart/wishlist state, while toast rendering surfaces transient feedback generated by client interactions.

#### Catalog and merchandising data
Product and likely category/catalog content is supplied locally from `src/lib/cartoonData.ts`; no server data-fetching layer, API endpoint, or persistence adapter appears in the repository tree. Product imagery is served from static assets under `public/assets/images/products`, with categories and avatars similarly local.

Home-page merchandising is composed from specialized sections: `src/app/components/HeroSection.tsx`, `src/app/components/FeaturedProducts.tsx`, and `src/app/components/CategoryBanner.tsx`. These consume or present catalog-oriented content rather than define a backend boundary.

#### Client state boundaries
Three client-side stores hold interactive commerce state:
- Cart: `src/store/cartStore.ts`
- Wishlist: `src/store/wishlistStore.ts`
- Notifications: `src/store/toastStore.ts`

The expected flow is catalog/detail/search UI → store mutation → shared header/cart/wishlist indicators and toast feedback. Checkout is therefore a UI-stage continuation of local cart state (`src/app/checkout/page.tsx`), not evidence of payment or order-service integration.

#### Reusable product presentation
`src/components/ProductCard.tsx` is the reusable catalog-card boundary likely shared by featured, listing, and search surfaces. Supporting display primitives include `src/components/StarRating.tsx`, `src/components/SkeletonCard.tsx`, and image abstraction `src/components/ui/AppImage.tsx`.

Search has an explicit client-interaction boundary in `src/app/search/SearchClient.tsx`; its server route wrapper is `src/app/search/page.tsx`.

#### Delivery, styling, and discoverability
Tailwind and global CSS are rooted in `src/styles/tailwind.css` and `src/styles/index.css`, with theme/build configuration in `tailwind.config.js`. Static image management includes `scripts/download-images.mjs` and remote-host configuration in `image-hosts.config.mjs`.

SEO/discoverability is handled through App Router metadata endpoints: `src/app/robots.ts`, `src/app/sitemap.ts`, plus `src/app/not-found.tsx` for unmatched routes. No external infrastructure or service clients are represented beyond Next.js runtime and configured image hosting.

Main entry points: [`next.config.mjs`](https://github.com/mr-ja9s/cartooe_com3/blob/main/next.config.mjs) (Next.js runtime), [`src/lib/cartoonData.ts`](https://github.com/mr-ja9s/cartooe_com3/blob/main/src/lib/cartoonData.ts) (Catalog data), [`src/app/layout.tsx`](https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/layout.tsx) (Root layout), [`src/app/product-detail/components/ProductDetail.tsx`](https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/product-detail/components/ProductDetail.tsx) (Detail UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routes["App Router"]
  node_home["Home<br/>route<br/>[page.tsx]"]
  node_home_sections["Merchandising sections<br/>home components"]
  node_listing["Product listing<br/>route<br/>[page.tsx]"]
  node_listing_ui["Listing UI<br/>feature component<br/>[ProductListing.tsx]"]
  node_detail["Product detail<br/>route<br/>[page.tsx]"]
  node_detail_ui["Detail UI<br/>feature component<br/>[ProductDetail.tsx]"]
  node_search["Search<br/>route<br/>[page.tsx]"]
  node_search_client["Search client<br/>client feature<br/>[SearchClient.tsx]"]
  node_cart_checkout["Cart and checkout<br/>commerce routes<br/>[page.tsx]"]
  node_seo["SEO endpoints<br/>metadata routes<br/>[robots.ts]"]
end

subgraph group_shell["Shared UI"]
  node_layout["Root layout<br/>app shell<br/>[layout.tsx]"]
  node_header["Header<br/>shared navigation<br/>[Header.tsx]"]
  node_footer["Footer<br/>[Footer.tsx]"]
  node_toast_container["Toast container<br/>feedback UI<br/>[ToastContainer.tsx]"]
  node_product_card["Product card<br/>catalog component<br/>[ProductCard.tsx]"]
end

subgraph group_state["Client State"]
  node_cart_store[("Cart store<br/>client store<br/>[cartStore.ts]")]
  node_wishlist_store[("Wishlist store<br/>client store<br/>[wishlistStore.ts]")]
  node_toast_store[("Toast store<br/>client store<br/>[toastStore.ts]")]
end

subgraph group_content["Local Content"]
  node_catalog[("Catalog data<br/>local data<br/>[cartoonData.ts]")]
  node_product_images["Product images<br/>static assets"]
end

node_next{{"Next.js runtime<br/>framework<br/>[next.config.mjs]"}}

node_next -->|"renders"| node_layout
node_layout -->|"includes"| node_header
node_layout -->|"includes"| node_footer
node_layout -->|"includes"| node_toast_container
node_next -->|"routes"| node_home
node_next -->|"routes"| node_listing
node_next -->|"routes"| node_detail
node_next -->|"routes"| node_search
node_next -->|"routes"| node_cart_checkout
node_home -->|"composes"| node_home_sections
node_listing -->|"composes"| node_listing_ui
node_detail -->|"composes"| node_detail_ui
node_search -->|"hosts"| node_search_client
node_home_sections -->|"uses"| node_product_card
node_listing_ui -->|"uses"| node_product_card
node_search_client -->|"uses"| node_product_card
node_catalog -->|"supplies content"| node_home_sections
node_catalog -->|"supplies products"| node_listing_ui
node_catalog -->|"supplies product"| node_detail_ui
node_catalog -->|"searches"| node_search_client
node_product_images -->|"renders in"| node_product_card
node_detail_ui -->|"adds items"| node_cart_store
node_detail_ui -->|"toggles items"| node_wishlist_store
node_header -->|"displays state"| node_cart_store
node_header -->|"displays state"| node_wishlist_store
node_cart_checkout -->|"reads and updates"| node_cart_store
node_toast_store -->|"drives messages"| node_toast_container
node_next -->|"serves"| node_seo

click node_next "https://github.com/mr-ja9s/cartooe_com3/blob/main/next.config.mjs"
click node_layout "https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/layout.tsx"
click node_header "https://github.com/mr-ja9s/cartooe_com3/blob/main/src/components/Header.tsx"
click node_footer "https://github.com/mr-ja9s/cartooe_com3/blob/main/src/components/Footer.tsx"
click node_toast_container "https://github.com/mr-ja9s/cartooe_com3/blob/main/src/components/ToastContainer.tsx"
click node_product_card "https://github.com/mr-ja9s/cartooe_com3/blob/main/src/components/ProductCard.tsx"
click node_home "https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/page.tsx"
click node_home_sections "https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/components/FeaturedProducts.tsx"
click node_listing "https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/product-listing/page.tsx"
click node_listing_ui "https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/product-listing/components/ProductListing.tsx"
click node_detail "https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/product-detail/page.tsx"
click node_detail_ui "https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/product-detail/components/ProductDetail.tsx"
click node_search "https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/search/page.tsx"
click node_search_client "https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/search/SearchClient.tsx"
click node_cart_checkout "https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/cart/page.tsx"
click node_cart_store "https://github.com/mr-ja9s/cartooe_com3/blob/main/src/store/cartStore.ts"
click node_wishlist_store "https://github.com/mr-ja9s/cartooe_com3/blob/main/src/store/wishlistStore.ts"
click node_toast_store "https://github.com/mr-ja9s/cartooe_com3/blob/main/src/store/toastStore.ts"
click node_catalog "https://github.com/mr-ja9s/cartooe_com3/blob/main/src/lib/cartoonData.ts"
click node_product_images "https://github.com/mr-ja9s/cartooe_com3/tree/main/public/assets/images/products"
click node_seo "https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/robots.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_home_sections,node_listing,node_listing_ui,node_detail,node_detail_ui,node_search,node_search_client,node_cart_checkout,node_seo toneBlue
class node_layout,node_header,node_footer,node_toast_container,node_product_card toneAmber
class node_cart_store,node_wishlist_store,node_toast_store toneMint
class node_catalog,node_product_images toneRose
class node_next toneNeutral
```

## Components

### App Router

Customer-facing route composition.

- [Home](https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/page.tsx): route · Merchandising landing page. · `src/app/page.tsx`
- [Merchandising sections](https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/components/FeaturedProducts.tsx): home components · Hero, featured products, and category banner. · `src/app/components/FeaturedProducts.tsx`
- [Product listing](https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/product-listing/page.tsx): route · `src/app/product-listing/page.tsx`
- [Listing UI](https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/product-listing/components/ProductListing.tsx): feature component · `src/app/product-listing/components/ProductListing.tsx`
- [Product detail](https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/product-detail/page.tsx): route · `src/app/product-detail/page.tsx`
- [Detail UI](https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/product-detail/components/ProductDetail.tsx): feature component · `src/app/product-detail/components/ProductDetail.tsx`
- [Search](https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/search/page.tsx): route · `src/app/search/page.tsx`
- [Search client](https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/search/SearchClient.tsx): client feature · Interactive search boundary. · `src/app/search/SearchClient.tsx`
- [Cart and checkout](https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/cart/page.tsx): commerce routes · Local-state cart review and checkout UI. · `src/app/cart/page.tsx`
- [SEO endpoints](https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/robots.ts): metadata routes · Robots and sitemap discovery endpoints. · `src/app/robots.ts`

### Shared UI

Cross-route shell and reusable presentation.

- [Root layout](https://github.com/mr-ja9s/cartooe_com3/blob/main/src/app/layout.tsx): app shell · Shared document and provider boundary for all routes. · `src/app/layout.tsx`
- [Header](https://github.com/mr-ja9s/cartooe_com3/blob/main/src/components/Header.tsx): shared navigation · `src/components/Header.tsx`
- [Footer](https://github.com/mr-ja9s/cartooe_com3/blob/main/src/components/Footer.tsx): shared footer · `src/components/Footer.tsx`
- [Toast container](https://github.com/mr-ja9s/cartooe_com3/blob/main/src/components/ToastContainer.tsx): feedback UI · `src/components/ToastContainer.tsx`
- [Product card](https://github.com/mr-ja9s/cartooe_com3/blob/main/src/components/ProductCard.tsx): catalog component · Reusable product presentation across catalog surfaces. · `src/components/ProductCard.tsx`

### Client State

In-memory commerce interaction state.

- [Cart store](https://github.com/mr-ja9s/cartooe_com3/blob/main/src/store/cartStore.ts): client store · `src/store/cartStore.ts`
- [Wishlist store](https://github.com/mr-ja9s/cartooe_com3/blob/main/src/store/wishlistStore.ts): client store · `src/store/wishlistStore.ts`
- [Toast store](https://github.com/mr-ja9s/cartooe_com3/blob/main/src/store/toastStore.ts): client store · `src/store/toastStore.ts`

### Local Content

In-repository catalog and image assets.

- [Catalog data](https://github.com/mr-ja9s/cartooe_com3/blob/main/src/lib/cartoonData.ts): local data · In-repository product and category source. · `src/lib/cartoonData.ts`
- [Product images](https://github.com/mr-ja9s/cartooe_com3/tree/main/public/assets/images/products): static assets · `public/assets/images/products`

### Other components

- [Next.js runtime](https://github.com/mr-ja9s/cartooe_com3/blob/main/next.config.mjs): framework · `next.config.mjs`

## Connections

- Next.js runtime → Root layout: renders
- Root layout → Header: includes
- Root layout → Footer: includes
- Root layout → Toast container: includes
- Next.js runtime → Home: routes
- Next.js runtime → Product listing: routes
- Next.js runtime → Product detail: routes
- Next.js runtime → Search: routes
- Next.js runtime → Cart and checkout: routes
- Home → Merchandising sections: composes
- Product listing → Listing UI: composes
- Product detail → Detail UI: composes
- Search → Search client: hosts
- Merchandising sections → Product card: uses
- Listing UI → Product card: uses
- Search client → Product card: uses
- Catalog data → Merchandising sections: supplies content
- Catalog data → Listing UI: supplies products
- Catalog data → Detail UI: supplies product
- Catalog data → Search client: searches
- Product images → Product card: renders in
- Detail UI → Cart store: adds items
- Detail UI → Wishlist store: toggles items
- Header → Cart store: displays state
- Header → Wishlist store: displays state
- Cart and checkout → Cart store: reads and updates
- Toast store → Toast container: drives messages
- Next.js runtime → SEO endpoints: serves
