# imnakul/my_portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/imnakul/my_portfolio
- Repository: https://github.com/imnakul/my_portfolio

## Overview

##### Project type and purpose
- This is a front‑end single‑page application (SPA) built with React and Vite.
- Its purpose is to serve static content (portfolio pages, media assets, data-driven components) delivered via a modern dev/build toolchain and deployed as a static site (e.g. on Vercel).

##### File structure
- Top‑level config files:
- package.json, package-lock.json – NPM dependencies and scripts
- vite.config.js – Vite build/dev server config
- tailwind.config.js, postcss.config.js – Tailwind CSS & PostCSS setup
- eslint.config.js – linting rules
- vercel.json – deployment config
- Public assets:
- index.html – SPA bootstrap
- Source code under src/:
- main.jsx – entry point that renders <App/>
- App.jsx + App.css – root layout
- components/ – React UI components (Home, About, Projects, Navbar, etc.)
- data/ – JSON‑like modules (ProjectsData.js) passed into components
- design/ – custom cursor & design‑specific components + CSS

##### README for insights
- Confirms React + Vite template, using either @vitejs/plugin-react (Babel) or plugin-react-swc (SWC) for Fast Refresh.
- No backend or API layers—pure front‑end.

##### Main components
a. Developer Workstation
– Code editor
– npm/yarn scripts (dev, build, lint)
b. Build & Dev Toolchain (Node.js processes)
– Vite Dev Server (with HMR)
– Vite Production Build (Rollup under the hood)
– ESLint stage
– PostCSS/Tailwind CSS processor
c. React Application
– src/main.jsx → ReactDOM.render(App)
– App and nested components (Navbar, Home, Projects…)
– Data layer (ProjectsData.js)
– Custom design components (CustomCursor)
d. Static Assets
– index.html
e. Deployment Host
– Vercel (serves built static files)

##### Relationships and data flow
- Developer edits src/ → Vite Dev Server bundles & serves index.html + JS/CSS with HMR → Browser
- On build: Vite bundles React code, applies PostCSS/Tailwind, outputs static files → Vercel deployment
- At runtime: Browser fetches index.html, JS bundle, CSS → React hydrates UI, loads media assets via static URLs

##### Architectural patterns & design principles
- SPA architecture with component‑based UI
- Data‑driven rendering (ProjectsData.js)
- Modular CSS (App.css, CustomCursor.css) + utility‑first Tailwind
- Plugin‑based build pipeline (ESLint, Babel/SWC, PostCSS)

##### Final checklist
- All major components (Developer, Toolchain, React App, Assets, Deployment)
- Optional: annotate where HMR and Fast Refresh occur in Dev mode

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer Workstation
    subgraph "Developer Workstation"
        direction TB
        Editor["Code Editor"]:::dev
        PackageJSON["npm/yarn scripts"]:::dev
    end

    %% Dev-Time Toolchain
    subgraph "Dev-Time Toolchain"
        direction TB
        ESLint["ESLint"]:::dev
        ViteDev["Vite Dev Server\n(with HMR)"]:::dev
        PostCSS["PostCSS/Tailwind CSS"]:::dev
    end

    %% Build-Time Toolchain
    subgraph "Build-Time Toolchain"
        direction TB
        BabelSWC["Babel/SWC Plugin"]:::dev
        Rollup["Rollup Bundler"]:::dev
        ViteBuild["Vite Production Build"]:::dev
    end

    %% Deployment Host
    subgraph "Deployment Host"
        direction TB
        Vercel["Vercel"]:::host
    end

    %% Browser & Runtime
    subgraph "Browser / Runtime"
        direction TB
        Browser["Browser"]:::client
        IndexHTML["index.html"]:::asset
        ReactApp["React App"]:::app
        Assets["public/assets"]:::asset
    end

    %% React Application Code
    subgraph "React Application (src/)"
        direction TB
        Entry["src/main.jsx"]:::app
        AppRoot["src/App.jsx"]:::app
        AppCSS["src/App.css\nsrc/index.css"]:::asset
        subgraph "UI Components (src/components)" 
            direction TB
            About["About.jsx"]:::app
            Contact["Contact.jsx"]:::app
            Copy["Copy.jsx"]:::app
            Home["Home.jsx"]:::app
            Navbar["Navbar.jsx"]:::app
            ProjectComp["Project.jsx"]:::app
            ProjectsComp["Projects.jsx"]:::app
            Quotes["Quotes.jsx"]:::app
            ScrollTop["Scrolltotop.jsx"]:::app
        end
        ProjectsData["ProjectsData.js"]:::data
        CustomCursor["CustomCursor.jsx"]:::app
        CustomCursorCSS["CustomCursor.css"]:::asset
    end

    %% Relationships
    Editor -->|edits code| PackageJSON
    PackageJSON -->|runs dev| ESLint
    ESLint -->|lint| ViteDev
    ViteDev -->|serves| Browser
    Browser -->|fetch| IndexHTML
    IndexHTML -->|loads| Entry
    Entry -->|renders| AppRoot
    AppRoot -->|uses| About
    AppRoot -->|uses| Contact
    AppRoot -->|uses| Copy
    AppRoot -->|uses| Home
    AppRoot -->|uses| Navbar
    AppRoot -->|uses| ProjectsComp
    ProjectsComp -->|renders| ProjectComp
    AppRoot -->|uses| Quotes
    AppRoot -->|uses| ScrollTop
    AppRoot -->|uses data| ProjectsData
    AppRoot -->|uses design| CustomCursor
    CustomCursor -->|styles| CustomCursorCSS
    AppRoot -->|styles| AppCSS
    Browser -->|requests| Assets

    BabelSWC --> Rollup
    PostCSS --> Rollup
    Rollup --> ViteBuild
    ViteBuild --> Vercel
    Vercel -->|serves| Browser

    %% Click Events
    click PackageJSON "https://github.com/imnakul/my_portfolio/blob/main/package.json"
    click ViteDev "https://github.com/imnakul/my_portfolio/blob/main/vite.config.js"
    click ViteBuild "https://github.com/imnakul/my_portfolio/blob/main/vite.config.js"
    click ESLint "https://github.com/imnakul/my_portfolio/blob/main/eslint.config.js"
    click PostCSS "https://github.com/imnakul/my_portfolio/blob/main/postcss.config.js"
    click PostCSS "https://github.com/imnakul/my_portfolio/blob/main/tailwind.config.js"
    click Vercel "https://github.com/imnakul/my_portfolio/blob/main/vercel.json"
    click IndexHTML "https://github.com/imnakul/my_portfolio/blob/main/index.html"
    click Assets "https://github.com/imnakul/my_portfolio/tree/main/public/assets/"
    click Entry "https://github.com/imnakul/my_portfolio/blob/main/src/main.jsx"
    click AppRoot "https://github.com/imnakul/my_portfolio/blob/main/src/App.jsx"
    click AppCSS "https://github.com/imnakul/my_portfolio/blob/main/src/App.css"
    click AppCSS "https://github.com/imnakul/my_portfolio/blob/main/src/index.css"
    click About "https://github.com/imnakul/my_portfolio/blob/main/src/components/About.jsx"
    click Contact "https://github.com/imnakul/my_portfolio/blob/main/src/components/Contact.jsx"
    click Copy "https://github.com/imnakul/my_portfolio/blob/main/src/components/Copy.jsx"
    click Home "https://github.com/imnakul/my_portfolio/blob/main/src/components/Home.jsx"
    click Navbar "https://github.com/imnakul/my_portfolio/blob/main/src/components/Navbar.jsx"
    click ProjectComp "https://github.com/imnakul/my_portfolio/blob/main/src/components/Project.jsx"
    click ProjectsComp "https://github.com/imnakul/my_portfolio/blob/main/src/components/Projects.jsx"
    click Quotes "https://github.com/imnakul/my_portfolio/blob/main/src/components/Quotes.jsx"
    click ScrollTop "https://github.com/imnakul/my_portfolio/blob/main/src/components/Scrolltotop.jsx"
    click ProjectsData "https://github.com/imnakul/my_portfolio/blob/main/src/data/ProjectsData.js"
    click CustomCursor "https://github.com/imnakul/my_portfolio/blob/main/src/design/designComponents/CustomCursor.jsx"
    click CustomCursorCSS "https://github.com/imnakul/my_portfolio/blob/main/src/design/designComponentsCss/CustomCursor.css"

    %% Styles
    classDef dev fill:#D0E6FF,stroke:#0066CC,color:#000
    classDef app fill:#DFFFE0,stroke:#28A745,color:#000
    classDef asset fill:#FFF3CD,stroke:#FFC107,color:#000
    classDef host fill:#E2E3E5,stroke:#6C757D,color:#000
    classDef client fill:#F0F4FF,stroke:#5A9BD4,color:#000
    classDef data fill:#D1E7DD,stroke:#198754,color:#000
```
