# anilthakor7007/portfolio architecture

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

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

## Overview

##### Project type and purpose
- This is a full-stack, single-page portfolio application built with React (Vite) on the frontend, a small Node.js server (Server.js) acting as an API proxy, integration with Google Sheets for dynamic data, and an AI assistant (Botpress) embedded for interactive Q&A.

##### File structure
- Top-level files:
- package.json, pnpm-lock.json, vite.config.js → build & dependency configurations
- Server.js, googleSheets.js → custom Node.js API server
- google-service-account.json → credentials for Google Sheets
- public/AnilResume.pdf and index.html → static assets served to the client
- src/ → React source code, split into App.jsx, main.jsx, CSS, and a Components folder
- Patterns & frameworks:
- Component-based SPA (React)
- API layer in Node.js (Express or built-in HTTP)
- External services: Google Sheets, Botpress AI agent
- Deployment target: Vercel (both frontend and serverless functions)

##### Extract key details from the README
- Frontend: React, React-Bootstrap, JavaScript, HTML, CSS
- AI Assistant: Botpress AI agent embedded in the UI
- Data source: Google Sheets (via a Node.js proxy)
- Deployment: Vercel (serves both static frontend and serverless endpoints)

##### Main components
a. Client (Browser)
- Hosts the React SPA (served from Vercel CDN)
- Contains UI components: NavBar, Banner, ProjectCardSlider, Contact form, Footer, etc.
- Embeds the AI widget (Botpress chat interface)
b. Static Asset Hosting
- Vercel CDN hosting index.html, JS/CSS bundles, public assets (resume PDF, images, fonts)
c. Serverless/API Layer
- Node.js server (Server.js) deployed as a Vercel serverless function
- googleSheets.js module handles authentication (google-service-account.json) and queries the Sheets API
d. External Data & Services
- Google Sheets (dynamic portfolio/project data)
- Botpress AI agent (hosted externally or as a service)
e. Deployment & CI/CD
- Vercel handles build, deploy, HTTPS, logging

##### Relationships and data flow
- User → React SPA:
- User loads index.html from Vercel
- Browser fetches JS/CSS assets (React app)
- React SPA → Node API:
- On startup or on-demand, React calls `/api/sheets` endpoint
- Serverless API uses googleSheets.js to fetch/update data from Google Sheets
- JSON response flows back to React, which renders dynamic content
- React SPA ↔ Botpress AI Agent:
- Embedded chat widget makes HTTP/WebSocket calls to Botpress service
- Botpress responds with Q&A messages
- All static and dynamic calls go over HTTPS via Vercel’s domain

##### Architectural patterns and design principles
- Component-based UI (modular, reusable React components)
- Separation of concerns:
- Presentation layer (React)
- API layer (Node.js server)
- Data layer (Google Sheets)
- AI service (Botpress)
- Serverless functions for light backend needs → minimal DevOps overhead
- Externalized credentials (service-account JSON) kept out of the client

##### Final checklist
[ ] All components represented (Browser UI, Vercel CDN, Serverless API, Google Sheets, Botpress)
[ ] Labels include technology names, endpoints, and data sources

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Frontend SPA
    subgraph "Frontend (React SPA)" 
        direction TB
        Main["main.jsx"]:::frontend
        AppComp["App.jsx"]:::frontend
        CSSidx["index.css"]:::frontend
        CSSapp["App.css"]:::frontend
        NavBar["NavBar.jsx"]:::frontend
        Banner["Banner.jsx"]:::frontend
        ProjectSlider["ProjectCardSlider.jsx"]:::frontend
        Contact["Contact.jsx"]:::frontend
        Footer["Footer.jsx"]:::frontend
        Skills["Skills.jsx"]:::frontend
        ProHeader["ProffesionalH.jsx"]:::frontend
        ProjectCard["ProjectCard.jsx"]:::frontend
    end

    %% Static Assets
    subgraph "Static Assets (public)" 
        direction TB
        IndexHTML["index.html"]:::frontend
        ResumePDF["AnilResume.pdf"]:::frontend
        OtherPublic["public/"]:::frontend
    end

    %% Build & Deployment Config
    subgraph "Build & Config" 
        direction TB
        ViteConfig["vite.config.js"]:::backend
        PackageJSON["package.json"]:::backend
        LockFiles["pnpm-lock.yaml"]:::backend
    end

    %% Serverless/API Layer
    subgraph "Serverless/API Layer" 
        direction TB
        Server["Server.js"]:::backend
        SheetsModule["googleSheets.js"]:::backend
        Credentials["google-service-account.json"]:::backend
    end

    %% External Services
    GoogleSheetsService["Google Sheets"]:::external
    BotpressAgent["Botpress AI Agent"]:::external
    VercelPlatform["Vercel Platform"]:::external
    Browser["User Browser"]:::frontend

    %% Connections
    VercelPlatform -->|"serves static assets"| Browser
    VercelPlatform --> IndexHTML
    VercelPlatform --> ResumePDF
    VercelPlatform --> OtherPublic

    Browser -->|"loads SPA assets"| Main
    Browser --> AppComp
    Browser --> CSSidx
    Browser --> CSSapp

    Browser -->|"renders UI"| NavBar
    Browser --> Banner
    Browser --> ProjectSlider
    Browser --> Contact
    Browser --> Footer
    Browser --> Skills
    Browser --> ProHeader
    Browser --> ProjectCard

    Browser -->|"calls /api/sheets"| Server
    Server --> SheetsModule
    SheetsModule --> Credentials
    SheetsModule --> GoogleSheetsService
    SheetsModule --> Server
    Server -->|"JSON response"| Browser

    Browser -->|"chat requests"| BotpressAgent
    BotpressAgent -->|"chat responses"| Browser

    %% Click Events
    click Main "https://github.com/anilthakor7007/portfolio/blob/master/src/main.jsx"
    click AppComp "https://github.com/anilthakor7007/portfolio/blob/master/src/App.jsx"
    click CSSidx "https://github.com/anilthakor7007/portfolio/blob/master/src/index.css"
    click CSSapp "https://github.com/anilthakor7007/portfolio/blob/master/src/App.css"
    click NavBar "https://github.com/anilthakor7007/portfolio/blob/master/src/Components/NavBar.jsx"
    click Banner "https://github.com/anilthakor7007/portfolio/blob/master/src/Components/Banner.jsx"
    click ProjectSlider "https://github.com/anilthakor7007/portfolio/blob/master/src/Components/ProjectCardSlider.jsx"
    click Contact "https://github.com/anilthakor7007/portfolio/blob/master/src/Components/Contact.jsx"
    click Footer "https://github.com/anilthakor7007/portfolio/blob/master/src/Components/Footer.jsx"
    click Skills "https://github.com/anilthakor7007/portfolio/blob/master/src/Components/Skills.jsx"
    click ProHeader "https://github.com/anilthakor7007/portfolio/blob/master/src/Components/ProffesionalH.jsx"
    click ProjectCard "https://github.com/anilthakor7007/portfolio/blob/master/src/Components/ProjectCard.jsx"
    click IndexHTML "https://github.com/anilthakor7007/portfolio/blob/master/index.html"
    click ResumePDF "https://github.com/anilthakor7007/portfolio/blob/master/public/AnilResume.pdf"
    click OtherPublic "https://github.com/anilthakor7007/portfolio/tree/master/public/"
    click Server "https://github.com/anilthakor7007/portfolio/blob/master/Server.js"
    click SheetsModule "https://github.com/anilthakor7007/portfolio/blob/master/googleSheets.js"
    click Credentials "https://github.com/anilthakor7007/portfolio/blob/master/google-service-account.json"
    click ViteConfig "https://github.com/anilthakor7007/portfolio/blob/master/vite.config.js"
    click PackageJSON "https://github.com/anilthakor7007/portfolio/blob/master/package.json"
    click LockFiles "https://github.com/anilthakor7007/portfolio/blob/master/pnpm-lock.yaml"

    %% Styles
    classDef frontend fill:#D6E8FF,stroke:#0044cc,color:#000
    classDef backend fill:#E2FFD6,stroke:#009900,color:#000
    classDef external fill:#FFE6CC,stroke:#CC6600,color:#000
```
