# haritssr/haritssr architecture

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

- Interactive diagram: https://gitdiagram.com/haritssr/haritssr
- Repository: https://github.com/haritssr/haritssr

## Overview

##### Project type and purpose
- This is a full-stack, content-rich Next.js website (v13+). It serves as a personal portfolio/blog/experiments site with a mix of static pages (SSG), server-rendered pages (SSR), client-side React interactivity, MDX-based content, and serverless API routes.
- Key features from README: Experiences, Experiments, Blog, Technology, Pure (design system), About.

##### File structure
- “app/” directory: Next.js App Router pages (TypeScript/TSX), layouts, parallel routes, dynamic segments.
- “pages/” directory: legacy pages router for the /experiments section and API endpoints under “pages/api/”.
- “components/”: reusable React UI components and design system primitives.
- “content/”: .mdx files representing blog posts/content.
- “data/”: JSON/TS/JS files with structured data (ExperiencesData, ExperimentsData, TechStackData, comments, etc.).
- “context/”: React context providers.
- “utils/”: helper functions (TOC generator, word count, MDX transforms, data loaders).
- Config/build files: next.config.js, contentlayer.config.js, tailwind.config.js, postcss.config.js.

##### README for additional insights
- Shows logical site structure: haritssr.com → experiences, experiments, blog, technology, pure, about.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Build Process
    subgraph "Build Process"
        MDX_Files["MDX Content Files"]:::content
        Local_Data["Local Data Sources"]:::content
        Static_Assets["Static Public Assets"]:::static
        Contentlayer_Build["Contentlayer Build"]:::buildProcess
        Next_Build["Next.js Build"]:::buildProcess

        MDX_Files --> Contentlayer_Build
        Local_Data --> Contentlayer_Build
        Static_Assets --> Contentlayer_Build
        Contentlayer_Build --> Next_Build
    end

    %% Server Runtime
    subgraph "Server Runtime (Next.js Project)"
        NextJS_Server["Next.js Server"]:::runtimeServer
        AppRouter["App Router"]:::runtimeServer
        PagesRouter["Pages Router"]:::runtimeServer
        API_Functions["Serverless API Endpoints"]:::runtimeServer
        Component_Library["React Component Library"]:::library
        Context_Providers["React Context Providers"]:::library
        Utility_Modules["Utility Modules"]:::library
        GlobalLayout["Global Layout and Shell"]:::library
        SharedLayout["Additional Layout Component"]:::library
        Next_Config["Next.js Configuration"]:::config
        Tailwind_Config["Tailwind CSS Configuration"]:::config
        PostCSS_Config["PostCSS Configuration"]:::config
        ManifestFile["Manifest File"]:::static
        Favicons["Favicons Directory"]:::static

        Next_Build --> NextJS_Server
        NextJS_Server --> AppRouter
        NextJS_Server --> PagesRouter
        NextJS_Server --> API_Functions
        AppRouter --> GlobalLayout
        AppRouter --> SharedLayout
        NextJS_Server --> Component_Library
        NextJS_Server --> Context_Providers
        NextJS_Server --> Utility_Modules
        NextJS_Server --> ManifestFile
        NextJS_Server --> Favicons
        NextJS_Server --> Next_Config
        NextJS_Server --> Tailwind_Config
        NextJS_Server --> PostCSS_Config
    end

    %% Client
    subgraph "Client"
        Browser["Browser (User Agent)"]:::client
        Browser -->|"Request Page"| NextJS_Server
        NextJS_Server -->|"HTML + JS"| Browser
        Browser -->|"API Call"| API_Functions
    end

    %% Click Events
    click AppRouter "https://github.com/haritssr/haritssr/tree/main/app/"
    click PagesRouter "https://github.com/haritssr/haritssr/tree/main/pages/"
    click MDX_Files "https://github.com/haritssr/haritssr/tree/main/content/"
    click Local_Data "https://github.com/haritssr/haritssr/tree/main/data/"
    click Contentlayer_Build "https://github.com/haritssr/haritssr/blob/main/contentlayer.config.js"
    click API_Functions "https://github.com/haritssr/haritssr/tree/main/pages/api/"
    click Component_Library "https://github.com/haritssr/haritssr/tree/main/components/"
    click Context_Providers "https://github.com/haritssr/haritssr/tree/main/context/"
    click Utility_Modules "https://github.com/haritssr/haritssr/tree/main/utils/"
    click GlobalLayout "https://github.com/haritssr/haritssr/blob/main/app/layout.tsx"
    click SharedLayout "https://github.com/haritssr/haritssr/blob/main/components/Layout.tsx"
    click Next_Config "https://github.com/haritssr/haritssr/blob/main/next.config.js"
    click Tailwind_Config "https://github.com/haritssr/haritssr/blob/main/tailwind.config.js"
    click PostCSS_Config "https://github.com/haritssr/haritssr/blob/main/postcss.config.js"
    click Static_Assets "https://github.com/haritssr/haritssr/tree/main/public/"
    click ManifestFile "https://github.com/haritssr/haritssr/blob/main/app/manifest.ts"
    click Favicons "https://github.com/haritssr/haritssr/tree/main/public/static/favicons/"

    %% Styles
    classDef runtimeServer fill:#87CEEB,stroke:#333,stroke-width:1px
    classDef buildProcess fill:#FFA500,stroke:#333,stroke-width:1px
    classDef content fill:#32CD32,stroke:#333,stroke-width:1px
    classDef static fill:#7FFFD4,stroke:#333,stroke-width:1px
    classDef config fill:#FFD700,stroke:#333,stroke-width:1px
    classDef library fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef client fill:#ADD8E6,stroke:#333,stroke-width:1px
```
