# vipulmadavi/my-portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/vipulmadavi/my-portfolio
- Repository: https://github.com/vipulmadavi/my-portfolio

## Overview

##### Project Type and Purpose
- This is a static, single‐page portfolio website built with vanilla HTML, CSS, and JavaScript, packaged with Vite and deployed on GitHub Pages.
- It showcases a public GUI mode (graphical portfolio) and a hidden CLI mode (“terminal” view) behind a URL flag or command.

##### File Structure
- Top-level:
- index.html – entry point
- package.json / vite.config.js / tsconfig.json – build and TS config
- public/ – assets for GitHub Pages
- src/:
- main.ts / main.js – mode manager (decides GUI vs terminal)
- loader.js – dynamic module loader
- gui.css / style.css – theme and global styles
- gui/ – component‐based UI (hero, skills, projects, contact, qualifications, ticker)
- effects/ – custom Canvas API background (network graph)
- terminal/ – hidden CLI interface (filesystem simulation, terminal-app.js, CSS)
- No backend or database: purely client‐side.

##### README for Additional Insights
- Highlights dual‐mode interface, Canvas API for dynamic network background, responsive design, and GitHub Pages for hosting.
- No microservices or server components—static hosting only.

a. Client Browser
- Loads index.html, CSS, JS bundles.
- Renders either GUI-mode components or Terminal-mode components.
b. Build System (Vite)
- Dev server for local testing.
- Bundles and outputs static assets to public/ for deployment.
c. Static Hosting (GitHub Pages / CDN)
- Serves index.html and built assets over HTTPS.
d. External Services
- Canvas API for in-browser graphics.
- External links: LinkedIn, GitHub, Email, Resume PDF.

##### Relationships and Data Flow
- Developer runs “npm run dev” → Vite dev server → Browser (hot-reload).
- “npm run build” → Vite bundles src/ → Outputs to public/ → Git pushes to GitHub Pages.
- User browser GETs index.html → Static server responds → Browser fetches CSS/JS → main.js → decides GUI vs Terminal → dynamically loads gui-app.js or terminal-app.js → renders components/effects.
- Components invoke Canvas API for network effect or handle user interactions (e.g., typing commands in the terminal).
- Contact/component links trigger outbound requests to external URLs.

##### Architectural Patterns and Principles
- Component-based front-end (each section is a self-contained JS module + CSS).
- Single-Page Application (SPA) behavior via dynamic module loading.
- Static site deployment—no server logic.
- Separation of concerns: GUI vs Terminal code kept in separate folders.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer and Build Tools
    Developer["Developer"]:::devtools
    Developer -->|"npm run dev"| ViteDev["Vite Dev Server"]:::devtools
    ViteDev -->|"serves/app|hot-reload"| Browser
    Developer -->|"npm run build"| ViteBuild["Vite Build Process"]:::devtools
    ViteBuild -->|"outputs static"| Public["Build Output (public/)"]:::hosting
    Public -->|"git push"| GHPages["GitHub Pages"]:::hosting

    %% Browser and SPA
    GHPages -->|"GET index.html, assets"| Browser["Client Browser"]:::client
    Browser -->|"load index.html"| Entry["index.html"]:::client
    Browser -->|"fetch CSS/JS"| Assets["CSS & JS Bundles"]:::client

    subgraph "Mode Management" 
        Entry -->|"\nmain.js or main.ts chooses mode\n"| ModeMgr["Mode Manager"]:::client
        ModeMgr -->|"uses loader"| Loader["Dynamic Module Loader"]:::client
        click Entry "https://github.com/vipulmadavi/my-portfolio/blob/main/index.html"
        click mainjs "https://github.com/vipulmadavi/my-portfolio/blob/main/src/main.js"
        click maints "https://github.com/vipulmadavi/my-portfolio/blob/main/src/main.ts"
        click Loader "https://github.com/vipulmadavi/my-portfolio/blob/main/src/loader.js"
    end

    %% GUI vs Terminal Branch
    ModeMgr -->|"GUI mode"| GUIStack
    ModeMgr -->|"Terminal mode"| TermStack

    subgraph "GUI Stack" 
        GUIStyle["gui.css"]:::client
        GlobalStyle["style.css"]:::client
        GUIApp["gui-app.js"]:::client
        Effects["network-graph.js\n(Canvas API)"]:::client
        ComponentsDir["Components Directory"]:::client

        GUIStack --> GUIStyle
        GUIStack --> GlobalStyle
        GUIStack --> GUIApp
        GUIStack --> Effects
        GUIStack --> ComponentsDir

        subgraph "GUI Components"
            Hero["hero.js"]:::client
            Skills["skills.js"]:::client
            Projects["projects.js"]:::client
            Qualifications["qualifications.js"]:::client
            Contact["contact.js"]:::client
            Ticker["ticker.js"]:::client
        end
        ComponentsDir --> Hero
        ComponentsDir --> Skills
        ComponentsDir --> Projects
        ComponentsDir --> Qualifications
        ComponentsDir --> Contact
        ComponentsDir --> Ticker

        click GUIStyle "https://github.com/vipulmadavi/my-portfolio/blob/main/src/gui.css"
        click GlobalStyle "https://github.com/vipulmadavi/my-portfolio/blob/main/src/style.css"
        click GUIApp "https://github.com/vipulmadavi/my-portfolio/blob/main/src/gui/gui-app.js"
        click Effects "https://github.com/vipulmadavi/my-portfolio/blob/main/src/effects/network-graph.js"
        click ComponentsDir "https://github.com/vipulmadavi/my-portfolio/tree/main/src/gui/components/"
        click Hero "https://github.com/vipulmadavi/my-portfolio/blob/main/src/gui/components/hero.js"
        click Skills "https://github.com/vipulmadavi/my-portfolio/blob/main/src/gui/components/skills.js"
        click Projects "https://github.com/vipulmadavi/my-portfolio/blob/main/src/gui/components/projects.js"
        click Qualifications "https://github.com/vipulmadavi/my-portfolio/blob/main/src/gui/components/qualifications.js"
        click Contact "https://github.com/vipulmadavi/my-portfolio/blob/main/src/gui/components/contact.js"
        click Ticker "https://github.com/vipulmadavi/my-portfolio/blob/main/src/gui/components/ticker.js"
    end

    subgraph "Terminal Stack"
        TermCSS["terminal.css"]:::client
        TermApp["terminal-app.js"]:::client
        FileSys["filesystem.js"]:::client

        TermStack --> TermCSS
        TermStack --> TermApp
        TermStack --> FileSys

        click TermCSS "https://github.com/vipulmadavi/my-portfolio/blob/main/src/terminal/terminal.css"
        click TermApp "https://github.com/vipulmadavi/my-portfolio/blob/main/src/terminal/terminal-app.js"
        click FileSys "https://github.com/vipulmadavi/my-portfolio/blob/main/src/terminal/filesystem.js"
    end

    %% External Integrations
    Browser -->|Canvas API| CanvasAPI["Canvas API"]:::external
    Browser -->|outbound links| ExtLinks["External Links\n(LinkedIn, GitHub,\nEmail, Resume)"]:::external

    %% Project Config Files
    subgraph "Project Config"
        PKG["package.json"]:::devtools
        VConfig["vite.config.js"]:::devtools
        TSConfig["tsconfig.json"]:::devtools
    end
    click PKG "https://github.com/vipulmadavi/my-portfolio/blob/main/package.json"
    click VConfig "https://github.com/vipulmadavi/my-portfolio/blob/main/vite.config.js"
    click TSConfig "https://github.com/vipulmadavi/my-portfolio/blob/main/tsconfig.json"

    %% Counter Demo Module
    Counter["counter.ts"]:::client
    ModeMgr -->|"(optional) demo"| Counter
    click Counter "https://github.com/vipulmadavi/my-portfolio/blob/main/src/counter.ts"

    %% Styles for classes
    classDef devtools fill:#cce5ff,stroke:#004085,color:#004085
    classDef client fill:#d4edda,stroke:#155724,color:#155724
    classDef hosting fill:#fff3cd,stroke:#856404,color:#856404
    classDef external fill:#f8d7da,stroke:#721c24,color:#721c24
```
