# muhammadhamza78/nextjs_design_jam_2024 architecture

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

- Interactive diagram: https://gitdiagram.com/muhammadhamza78/nextjs_design_jam_2024
- Repository: https://github.com/muhammadhamza78/nextjs_design_jam_2024

## Overview

##### Main Components Identification

a) Client-Side Layer:
- Next.js Frontend (App Router)
- Component Structure
- Context Providers (Cart & Wishlist)

b) Server-Side Layer:
- Next.js Server Components
- API Routes

c) Content Management:
- Sanity CMS Integration
- Content Models

##### Detailed Component Breakdown

Frontend Architecture:
- Pages & Routing
- Main Page (/)
- Product Pages (/product/[id])
- Sanity Studio (/studio)

- Core Components
- Navigation (Header, Navbar)
- Product Display (FeaturedProduct, LatestProducts, TrendingProduct)
- Shopping (Cart, OrderTracking)
- Marketing (Banner, Discount, Gift)

- State Management
- CartContext
- WishlistContext

##### Data Flow Representation

- Client-server communication
- Data flow between Sanity CMS and Next.js
- Context providers' state management flow
- Image optimization pipeline

##### Key Technical Elements to Highlight

- Next.js 13+ App Router architecture
- Sanity CMS integration points
- Static and dynamic routes
- Image optimization pipeline
- TypeScript integration
- Tailwind CSS styling system

**┌─────────────────────────┐**
- Client Layer         │
- ┤
- Application Layer    │
- ┤
- Data Layer          │
- ┘

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        FE[Next.js Frontend]
        AR["App Router"]
        click AR "https://github.com/muhammadhamza78/Nextjs_Design_Jam_2024/tree/main/src/app"
        
        subgraph Pages
            MP["Main Page"]
            click MP "https://github.com/muhammadhamza78/Nextjs_Design_Jam_2024/blob/main/src/app/page.tsx"
            PP["Product Pages"]
            click PP "https://github.com/muhammadhamza78/Nextjs_Design_Jam_2024/blob/main/src/app/product/[id].tsx"
            SS["Sanity Studio"]
            click SS "https://github.com/muhammadhamza78/Nextjs_Design_Jam_2024/blob/main/src/app/studio/[[...tool]]/page.tsx"
        end
        
        subgraph "Core Components"
            direction TB
            subgraph Navigation
                HD[Header]
                click HD "https://github.com/muhammadhamza78/Nextjs_Design_Jam_2024/blob/main/src/components/Header.tsx"
                NB[Navbar]
                click NB "https://github.com/muhammadhamza78/Nextjs_Design_Jam_2024/blob/main/src/components/Navbar.tsx"
            end
            
            subgraph "Product Display"
                FP[FeaturedProduct]
                click FP "https://github.com/muhammadhamza78/Nextjs_Design_Jam_2024/blob/main/src/components/FeaturedProduct.tsx"
                LP[LatestProducts]
                click LP "https://github.com/muhammadhamza78/Nextjs_Design_Jam_2024/blob/main/src/components/LatestProducts.tsx"
                TP[TrendingProduct]
                click TP "https://github.com/muhammadhamza78/Nextjs_Design_Jam_2024/blob/main/src/components/TrendingProduct.tsx"
            end
            
            subgraph Shopping
                CT[Cart]
                click CT "https://github.com/muhammadhamza78/Nextjs_Design_Jam_2024/blob/main/src/components/Cart.tsx"
                OT[OrderTracking]
                click OT "https://github.com/muhammadhamza78/Nextjs_Design_Jam_2024/blob/main/src/components/OrderTracking.tsx"
            end
            
            subgraph Marketing
                BN[Banner]
                click BN "https://github.com/muhammadhamza78/Nextjs_Design_Jam_2024/blob/main/src/components/Banner.tsx"
                DC[Discount]
                click DC "https://github.com/muhammadhamza78/Nextjs_Design_Jam_2024/blob/main/src/components/Discount.tsx"
                GF[Gift]
                click GF "https://github.com/muhammadhamza78/Nextjs_Design_Jam_2024/blob/main/src/components/Gift.tsx"
            end
        end
    end
    
    subgraph "State Management"
        CC[CartContext]:::state
        click CC "https://github.com/muhammadhamza78/Nextjs_Design_Jam_2024/blob/main/src/content/CartContext.tsx"
        WC[WishlistContext]:::state
        click WC "https://github.com/muhammadhamza78/Nextjs_Design_Jam_2024/blob/main/src/content/WishlistContext.tsx"
    end
    
    subgraph "Sanity CMS Integration"
        SC[Sanity Client]:::sanity
        click SC "https://github.com/muhammadhamza78/Nextjs_Design_Jam_2024/blob/main/src/sanity/lib/client.ts"
        CM[Content Models]:::sanity
        click CM "https://github.com/muhammadhamza78/Nextjs_Design_Jam_2024/blob/main/src/sanity/schemaTypes/products.ts"
        DF[Data Fetching]:::sanity
        click DF "https://github.com/muhammadhamza78/Nextjs_Design_Jam_2024/blob/main/src/sanity/lib/Fetch.ts"
        QR[Queries]:::sanity
        click QR "https://github.com/muhammadhamza78/Nextjs_Design_Jam_2024/blob/main/src/sanity/lib/queries.ts"
        IP[Image Pipeline]:::sanity
        click IP "https://github.com/muhammadhamza78/Nextjs_Design_Jam_2024/blob/main/src/sanity/lib/image.ts"
    end
    
    subgraph Layout
        RL[Root Layout]:::layout
        click RL "https://github.com/muhammadhamza78/Nextjs_Design_Jam_2024/blob/main/src/app/layout.tsx"
    end
    
    %% Relationships
    FE --> AR
    AR --> Pages
    CC --> CT
    WC --> CT
    SC --> DF
    DF --> QR
    SC --> IP
    RL --> MP
    
    %% Styling
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:2px
    classDef state fill:#FFA500,stroke:#333,stroke-width:2px
    classDef sanity fill:#90EE90,stroke:#333,stroke-width:2px
    classDef layout fill:#ADD8E6,stroke:#333,stroke-width:2px
    
    %% Legend
    subgraph Legend
        L1[Frontend Components]
        L2[State Management]:::state
        L3[Sanity Integration]:::sanity
        L4[Layout Components]:::layout
    end
```
