# yuvrajsinh5252/website architecture

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

- Interactive diagram: https://gitdiagram.com/yuvrajsinh5252/website
- Repository: https://github.com/yuvrajsinh5252/website

## Overview

##### Main Components
- Pages & Routing:
- The src/app directory is central. It houses pages for About, Blog (with dynamic [slug] routing), Projects, and the base homepage (page.tsx). This clearly represents the routing and view layer.
- UI Components & Effects:
- Under src/components, there are subdirectories for navbar, themes, about, blog, cursor, effects, and ui. These are reusable components that build up the UI and offer interactive effects (typewriter, sparkles, animated-post, etc.).
- Content and Data:
- The src/content directory (with MDX blog posts) and src/data (project details and social links) are used for dynamic content population.
- Library and Utilities:
- The src/lib folder contains helper functions for blog processing and utilities, indicating business logic separation.
- Core Configurations:
- The presence of configuration files (next.config.ts, tailwind.config.ts, postcss.config.mjs, tsconfig.json, etc.) shows reliance on tools and frameworks to structure the build, styling, and type-checking.

##### Out Relationships & Interactions
- Frontend/Pages Layer:
- UI Components Layer:
- Content/Data Layer:
- Library/Utilities Layer:
- “lib” module which offers helper functions and business logic. Indicate how these utilities are used by the components and pages to handle tasks like blog data fetching.
- Configuration & Styling:

##### Architectural Patterns & Design Principles
- Next.js/React Architecture:
- Component-based design typical of React with reusable UI modules.
- Separation of Concerns:
- Dynamic Routing & Content Injection:
- The use of MDX for blog posts and dynamic [slug] routes indicates content-driven page generation.
- Utilization of Third-Party Tools:
- Technologies like Tailwind CSS, TypeScript, ESLint, and PostCSS should be noted as key supporting frameworks.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Pages
    subgraph "Frontend Pages (src/app)"
        direction TB
        Home["Home Page (page.tsx)"]:::pages
        About["About Page (about/page.tsx)"]:::pages
        Blog["Blog Page (blog/page.tsx)"]:::pages
        BlogPost["Blog Post Page (blog/[slug]/page.tsx)"]:::pages
        Projects["Projects Page (projects/page.tsx)"]:::pages
    end

    %% UI Components
    subgraph "UI Components (src/components)"
        direction TB
        Navbar["Navbar"]:::ui
        Themes["Themes"]:::ui
        AboutComp["About Component"]:::ui
        BlogComp["Blog Component"]:::ui
        Cursor["Custom Cursor"]:::ui
        Effects["Effects"]:::ui
        UIWrappers["UI Wrappers"]:::ui
    end

    %% Content and Data
    subgraph "Content & Data"
        direction TB
        Content["Content (MDX posts)"]:::content
        Data["Data (Project & Social Details)"]:::content
    end

    %% Libraries and Utilities
    subgraph "Libraries & Utilities (src/lib)"
        direction TB
        BlogUtils["Blog Utilities (blog.ts)"]:::util
        HelperFuncs["Helper Functions (utils.ts)"]:::util
    end

    %% Configurations and Styling
    subgraph "Configurations & Styling"
        direction TB
        NextConfig["Next.js Config (next.config.ts)"]:::config
        TailwindConfig["Tailwind CSS Config (tailwind.config.ts)"]:::config
        PostCSS["PostCSS Config (postcss.config.mjs)"]:::config
        TSConfig["TypeScript Config (tsconfig.json)"]:::config
        ESLint["ESLint Config (.eslintrc.json)"]:::config
        GlobalStyles["Global Styles (globals.css)"]:::config
    end

    %% Interactions: Pages rendering UI Components
    Home -->|"renders"| Navbar
    Home -->|"renders"| Themes
    About -->|"renders"| AboutComp
    Blog -->|"renders"| BlogComp
    BlogPost -->|"renders"| Effects
    Projects -->|"renders"| UIWrappers
    Home -->|"applies"| GlobalStyles

    %% Interactions: Pages fetching content
    Blog -->|"populates"| Content
    Projects -->|"populates"| Data

    %% Interactions: Pages and Components using Libraries
    Blog -->|"calls"| BlogUtils
    About -->|"calls"| HelperFuncs
    Navbar -->|"utilizes"| HelperFuncs
    BlogComp -->|"utilizes"| BlogUtils

    %% Interactions: Components & Pages using Configurations (implicit dependency)
    Themes -->|"styles via"| TailwindConfig

    %% Click Event Mappings
    click Home "https://github.com/yuvrajsinh5252/website/blob/main/src/app/page.tsx"
    click About "https://github.com/yuvrajsinh5252/website/blob/main/src/app/about/page.tsx"
    click Blog "https://github.com/yuvrajsinh5252/website/blob/main/src/app/blog/page.tsx"
    click BlogPost "https://github.com/yuvrajsinh5252/website/blob/main/src/app/blog/[slug]/page.tsx"
    click Projects "https://github.com/yuvrajsinh5252/website/blob/main/src/app/projects/page.tsx"

    click Navbar "https://github.com/yuvrajsinh5252/website/tree/main/src/components/navbar"
    click Themes "https://github.com/yuvrajsinh5252/website/tree/main/src/components/themes"
    click AboutComp "https://github.com/yuvrajsinh5252/website/tree/main/src/components/about"
    click BlogComp "https://github.com/yuvrajsinh5252/website/tree/main/src/components/blog"
    click Cursor "https://github.com/yuvrajsinh5252/website/tree/main/src/components/cursor"
    click Effects "https://github.com/yuvrajsinh5252/website/tree/main/src/components/effects"
    click UIWrappers "https://github.com/yuvrajsinh5252/website/tree/main/src/components/ui"

    click Content "https://github.com/yuvrajsinh5252/website/tree/main/src/content"
    click Data "https://github.com/yuvrajsinh5252/website/tree/main/src/data"

    click BlogUtils "https://github.com/yuvrajsinh5252/website/blob/main/src/lib/blog.ts"
    click HelperFuncs "https://github.com/yuvrajsinh5252/website/blob/main/src/lib/utils.ts"

    click NextConfig "https://github.com/yuvrajsinh5252/website/blob/main/next.config.ts"
    click TailwindConfig "https://github.com/yuvrajsinh5252/website/blob/main/tailwind.config.ts"
    click PostCSS "https://github.com/yuvrajsinh5252/website/blob/main/postcss.config.mjs"
    click TSConfig "https://github.com/yuvrajsinh5252/website/blob/main/tsconfig.json"
    click ESLint "https://github.com/yuvrajsinh5252/website/blob/main/.eslintrc.json"
    click GlobalStyles "https://github.com/yuvrajsinh5252/website/blob/main/src/app/globals.css"

    %% Class Definitions for Colors and Styles
    classDef pages fill:#fde2e2,stroke:#e85d04,stroke-width:2px;
    classDef ui fill:#e8f4f8,stroke:#3aafa9,stroke-width:2px;
    classDef content fill:#e7f6f2,stroke:#2b9348,stroke-width:2px;
    classDef util fill:#f0efeb,stroke:#393e46,stroke-width:2px;
    classDef config fill:#fefae0,stroke:#f4ac45,stroke-width:2px;
```
