# raohamzatariq/next-js-projects architecture

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

- Interactive diagram: https://gitdiagram.com/raohamzatariq/next-js-projects
- Repository: https://github.com/raohamzatariq/next-js-projects

## Overview

##### High-Level Architecture Overview

- Ecommerce Website
- Portfolio Website
- Recipe Website
- Blog Website
- Figma UI Cloning Website

##### Shared Technical Stack (Common Layer)
- Next.js (Framework)
- Tailwind CSS (Styling)
- Shadcn UI (Component Library)
- TypeScript (Programming Language)

##### Individual Application Architecture

a) Client Layer:
- Pages (src/app directory)
- Components (src/components)
- UI Components (src/components/ui)
- Hooks (where applicable)
- Context Providers

b) API Layer:
- API Routes
- External Services Integration

c) Data Management:
- For Blog & Portfolio websites: Sanity.io Integration
- For Ecommerce: Product Management System
- Local State Management (Context API)

##### Specific Implementation Details

- Rectangle: Components and Pages
- Hexagon: API Endpoints

##### Component Organization

Hierarchy of:
- Layout Components
- Shared UI Components
- Page-Specific Components
- Theme Providers
- Authentication Components (where applicable)

##### Key Elements to Highlight

For each application, emphasize:
- Routing Structure (Next.js App Router)
- API Integration Points
- State Management
- Theme Switching Capability
- Responsive Design Implementation

##### Integration Points

Connections between:
- Frontend Components and API Routes
- External Services (Sanity, etc.)
- Shared Utilities and Hooks
- Theme Provider and UI Components

##### Clear labels for
- Component Names
- API Endpoints
- Data Flow Direction
- State Management Solutions
- External Service Connections

- UI Layer (Components)
- Business Logic Layer (Hooks/Context)
- Data Access Layer (API/External Services)
- Infrastructure Layer (Next.js/Framework)

Remember to:
- Clear boundaries between different applications
- Shared components and utilities
- Version information and date
- Document any significant architectural decisions

This structure will provide a clear understanding of how the different applications are organized while maintaining the ability to drill down into specific implementation details when needed.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Legend
        A[Frontend Component]:::frontend
        B[API Route]:::api
        C[(External Service)]:::external
        D{State Management}:::state
        E[[Shared Utility]]:::utility
    end

    subgraph "Technical Stack"
        NextJS["Next.js Framework"]
        TailwindCSS["Tailwind CSS"]
        ShadcnUI["Shadcn UI"]
        TypeScript["TypeScript"]
    end

    subgraph "Ecommerce Website"
        EPages["Pages"]:::frontend
        click EPages "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/Ecommerce-Website/src/app"
        EComponents["Components"]:::frontend
        click EComponents "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/Ecommerce-Website/src/components"
        EUI["UI Components"]:::frontend
        click EUI "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/Ecommerce-Website/src/components/ui"
        EAPI["API Layer"]:::api
        click EAPI "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/Ecommerce-Website/src/app/api"
        ETheme["Theme Provider"]:::frontend
        click ETheme "https://github.com/RaoHamzaTariq/Next-JS-Projects/blob/master/Ecommerce-Website/src/components/theme-provider.tsx"
        EContext["Cart Context"]:::state
        click EContext "https://github.com/RaoHamzaTariq/Next-JS-Projects/blob/master/Ecommerce-Website/src/components/ContextForCart.tsx"
        EHooks["Hooks"]:::utility
        click EHooks "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/Ecommerce-Website/src/hooks"
        EUtils["Utilities"]:::utility
        click EUtils "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/Ecommerce-Website/src/lib"
        EData["Data Management"]:::utility
        click EData "https://github.com/RaoHamzaTariq/Next-JS-Projects/blob/master/Ecommerce-Website/src/app/data.ts"
    end

    subgraph "Portfolio Website"
        PPages["Pages"]:::frontend
        click PPages "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/Porfolio-Website/src/app"
        PComponents["Components"]:::frontend
        click PComponents "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/Porfolio-Website/src/components"
        PUI["UI Components"]:::frontend
        click PUI "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/Porfolio-Website/src/components/ui"
        PAPI["API Layer"]:::api
        click PAPI "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/Porfolio-Website/src/app/api"
        PSanity["Sanity Integration"]:::external
        click PSanity "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/Porfolio-Website/src/sanity"
        PTheme["Theme Provider"]:::frontend
        click PTheme "https://github.com/RaoHamzaTariq/Next-JS-Projects/blob/master/Porfolio-Website/src/components/theme-provider.tsx"
        PUtils["Utilities"]:::utility
        click PUtils "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/Porfolio-Website/src/lib"
        PData["Data Management"]:::utility
        click PData "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/Porfolio-Website/src/data"
    end

    subgraph "Blog Website"
        BPages["Pages"]:::frontend
        click BPages "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/blog-website/src/app"
        BComponents["Components"]:::frontend
        click BComponents "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/blog-website/src/components"
        BUI["UI Components"]:::frontend
        click BUI "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/blog-website/src/components/ui"
        BAPI["API Layer"]:::api
        click BAPI "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/blog-website/src/app/api"
        BSanity["Sanity Integration"]:::external
        click BSanity "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/blog-website/src/sanity"
        BTheme["Theme Provider"]:::frontend
        click BTheme "https://github.com/RaoHamzaTariq/Next-JS-Projects/blob/master/blog-website/src/components/theme-provider.tsx"
        BUtils["Utilities"]:::utility
        click BUtils "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/blog-website/src/lib"
        BData["Data Management"]:::utility
        click BData "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/blog-website/src/data"
    end

    subgraph "Recipe Website"
        RPages["Pages"]:::frontend
        click RPages "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/RecipeWebsite/src/app"
        RComponents["Components"]:::frontend
        click RComponents "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/RecipeWebsite/src/components"
        RUI["UI Components"]:::frontend
        click RUI "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/RecipeWebsite/src/components/ui"
        RAPI["API Layer"]:::api
        click RAPI "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/RecipeWebsite/src/app/api"
        RTheme["Theme Provider"]:::frontend
        click RTheme "https://github.com/RaoHamzaTariq/Next-JS-Projects/blob/master/RecipeWebsite/src/components/theme-provider.tsx"
        RUtils["Utilities"]:::utility
        click RUtils "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/RecipeWebsite/src/lib"
    end

    subgraph "Figma UI Website"
        FContext["Context"]:::state
        click FContext "https://github.com/RaoHamzaTariq/Next-JS-Projects/tree/master/figma-ui-cloning-website/src/context"
    end

    %% Connections
    NextJS --> EPages & PPages & BPages & RPages
    TailwindCSS --> EComponents & PComponents & BComponents & RComponents
    ShadcnUI --> EUI & PUI & BUI & RUI

    %% Styles
    classDef frontend fill:#3b82f6,color:white
    classDef api fill:#22c55e,color:white
    classDef external fill:#a855f7,color:white
    classDef state fill:#f97316,color:white
    classDef utility fill:#6b7280,color:white
```
