# sharathkumarnp/profile architecture

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

- Interactive diagram: https://gitdiagram.com/sharathkumarnp/profile
- Repository: https://github.com/sharathkumarnp/profile

## Overview

##### Project type and purpose (what you’re diagramming)
This repository is a **static, client-side portfolio web app**:
- **Tech**: Vite + React + TypeScript + TailwindCSS (PostCSS).
- **Runtime**: Runs entirely in the browser (no server-side backend indicated).
- **Purpose**: “github profile portfolio” with multiple sections (Hero, Skills, Projects, etc.) plus an **AI/assistant-like UX** fed by local JSON data in `public/ai/*`.
- **Deployment**: A GitHub Actions workflow exists at `.github/workflows/deploy.yml`, strongly implying **CI/CD to static hosting** (commonly GitHub Pages).

- **Static hosting + client application**
- **Build pipeline**
- **Data assets (JSON)**
- **UI component architecture and data flow**

##### Top-level build/runtime boundaries
- **Source code**: `src/`
- **Static assets served as-is**: `public/`
- `public/ai/faq.json`, `public/ai/profile.json` (key “data sources” for the assistant/chatbot features)
- `public/index.css` (global styles)
- **App entry**:
- `index.html` (Vite entry HTML)
- `src/main.tsx` (React mount/bootstrap)
- `src/App.tsx` (root component composition)
- **UI modules**: `src/components/*.tsx` (section components + chatbot/assistant components)
- **Tooling/config**:
- `vite.config.ts` (build + dev server)
- `tailwind.config.js`, `postcss.config.js` (styling pipeline)
- `tsconfig*.json` (TS build targets)
- `eslint.config.js` (linting)
- **CI/CD**:
- `.github/workflows/deploy.yml` (build + deploy automation)

##### Component inventory worth explicitly diagramming
In `src/components/`:
- Page/section components: `Header`, `Hero`, `Skills`, `Experience`, `Certificates`, `Projects`, `Contact`
- Animation/UX wrapper: `SectionFade` (indicates a cross-cutting concern: transitions/visibility)
- “AI” UX: `Chatbot`, `PortfolioAssistant` (likely consumes the JSON files in `public/ai/`)

This is effectively a **single-page application (SPA)** composed of reusable sections.

##### Browser (runtime container)
- React SPA executed here
##### Static Host/CDN
- Serves `index.html`, JS bundle(s), CSS, and `public/ai/*.json`
##### Build pipeline (CI/CD container)
- GitHub Actions: checks out code → installs deps → builds via Vite → publishes artifacts

**Developer workstation** as an actor/container:
- Vite dev server (`npm run dev`) serving app locally.

- **Bootstrap layer**
- `index.html` → `src/main.tsx` → mounts `App`
- **Composition/root**
- `src/App.tsx` orchestrates page layout and section ordering
- **UI Sections**
- `Header`, `Hero`, `Skills`, `Experience`, `Certificates`, `Projects`, `Contact`
- **Cross-cutting UI**
- `SectionFade` used by multiple sections (call this out as “shared animation wrapper”)
- **Assistant/Chat**
- `Chatbot` + `PortfolioAssistant`
- **Data dependency**: `public/ai/profile.json`, `public/ai/faq.json`

##### User → Static Host
- HTTP GET `/` → returns `index.html`
##### Browser → Static Host
- Fetch JS/CSS bundles produced by Vite
##### React App initialization
- `main.tsx` mounts `App.tsx`
##### Assistant data loading
- `Chatbot` / `PortfolioAssistant` → HTTP GET `/ai/profile.json` and `/ai/faq.json` (or equivalent fetch/import)
- Data → UI rendering / response generation

If the chatbot is fully local (rule-based / search over JSON), annotate:
- “No external AI API calls; responses derived from local JSON knowledge base.”

##### Architectural patterns / principles present
- **SPA (Single Page Application)**: all routing/sections rendered client-side.
- **Component-based UI architecture**: each portfolio section is a React component.
- **Static knowledge base** for “AI assistant” features: JSON files in `public/ai/`.
- **Separation of concerns**:
- Presentation components (`Hero`, `Skills`, etc.)
- Shared behavior/visual wrapper (`SectionFade`)
- Data assets (`public/ai/*.json`)
- **Build-time styling pipeline**: Tailwind + PostCSS integrated into Vite build.

- Browser container: “React + TypeScript”
- Build container: “Vite”
- Styling: “TailwindCSS + PostCSS”
- CI/CD: “GitHub Actions”
- Host: “Static Hosting (e.g., GitHub Pages)”

##### User Browser (runtime execution)

This prevents a common mistake: showing Vite or Tailwind as runtime services (they’re build-time).

##### Step 2: Inside “Browser”, decompose by entrypoints and components
Minimum accurate internal decomposition:
- `main.tsx` (bootstrap)
- `App.tsx` (composition root)
- Section components (Header/Hero/Skills/…)
- Assistant components (Chatbot/PortfolioAssistant)
- Shared utility component (`SectionFade`)

##### Step 3: Add explicit data nodes for `public/ai/*`
- They feed application behavior (assistant/chat)
- They are fetched/loaded at runtime
- `public/ai/profile.json`
- `public/ai/faq.json`

##### Step 4: Add the CI/CD pipeline as a first-class flow
From `.github/workflows/deploy.yml`:

Even without reading the YAML contents, the presence of the workflow means deployment is part of the system.

##### C4 Component (Browser SPA): main/App/components + assistant + JSON assets.

This set is detailed without overthinking: it separates the project into as many meaningful components as exist in the repo and makes the real dependencies (static assets + build/deploy) explicit.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% =========================================================
    %% System Context + Container + Component (vertical layout)
    %% =========================================================

    %% ---------- Actors ----------
    subgraph "Actors"
        User["Visitor/User"]:::actor
        Dev["Developer/Engineer"]:::actor
    end

    %% ---------- Source Control / CI ----------
    subgraph "Build & Deploy (GitHub)"
        Repo["GitHub Repository"]:::infra

        subgraph "CI/CD Pipeline"
            GHA["GitHub Actions<br/>Deploy Workflow"]:::cicd
            Build["Build Step<br/>(Vite build)"]:::build
            Lint["Quality Checks<br/>(TypeScript + ESLint)"]:::build
            StylesPipe["Styling Pipeline<br/>(TailwindCSS + PostCSS)"]:::build
        end
    end

    %% ---------- Hosting ----------
    subgraph "Production Infrastructure"
        Host["Static Hosting/CDN<br/>(e.g., GitHub Pages)"]:::infra
        Artifacts[("Static Artifacts<br/>index.html, JS/CSS, assets")]:::data
        AiData[("Static JSON Knowledge Base<br/>/public/ai/*.json")]:::data
        PublicCss[("Global Static Styles<br/>/public/index.css")]:::data
    end

    %% ---------- Browser Runtime ----------
    subgraph "User Runtime (Browser)"
        Browser["Web Browser"]:::external

        subgraph "React SPA (Client-side)"
            Entry["Vite HTML Entry<br/>index.html"]:::runtime
            Main["React Bootstrap<br/>main.tsx"]:::runtime
            App["Root Composition<br/>App.tsx"]:::runtime

            subgraph "UI Sections (Components)"
                Header["Header"]:::component
                Hero["Hero"]:::component
                Skills["Skills"]:::component
                Experience["Experience"]:::component
                Certificates["Certificates"]:::component
                Projects["Projects"]:::component
                Contact["Contact"]:::component
            end

            subgraph "Assistant UX (Components)"
                Chatbot["Chatbot"]:::component
                Assistant["PortfolioAssistant"]:::component
                NoteLocalAI["Note: No external AI API<br/>Responses derived from local JSON"]:::note
            end

            subgraph "Shared UX"
                SectionFade["SectionFade<br/>(shared animation wrapper)"]:::shared
            end

            BundledCss["Bundled App Styles<br/>src/index.css"]:::shared
        end
    end

    %% =========================================================
    %% Runtime flows (solid)
    %% =========================================================
    User -->|"HTTP_GET /"| Host
    Host -->|"serves"| Artifacts
    Host -->|"serves"| PublicCss
    Host -->|"serves"| AiData

    Browser -->|"loads"| Entry
    Entry -->|"loads_bundle"| Main
    Main -->|"mounts"| App

    App -->|"renders"| Header
    App -->|"renders"| Hero
    App -->|"renders"| Skills
    App -->|"renders"| Experience
    App -->|"renders"| Certificates
    App -->|"renders"| Projects
    App -->|"renders"| Contact
    App -->|"renders"| Chatbot
    App -->|"renders"| Assistant

    %% Cross-cutting wrapper usage
    SectionFade -->|"wraps"| Hero
    SectionFade -->|"wraps"| Skills
    SectionFade -->|"wraps"| Experience
    SectionFade -->|"wraps"| Certificates
    SectionFade -->|"wraps"| Projects
    SectionFade -->|"wraps"| Contact

    %% Assistant data loads
    Chatbot -->|"fetches_/ai/faq.json"| AiData
    Assistant -->|"fetches_/ai/profile.json"| AiData
    Chatbot -->|"delegates_logic"| Assistant
    Assistant -->|"uses_local_JSON"| NoteLocalAI

    %% Styling usage
    App -->|"imports"| BundledCss
    Browser -->|"applies"| PublicCss

    %% =========================================================
    %% Build/deploy flows (dashed)
    %% =========================================================
    Dev -.->|"git_push"| Repo
    Repo -.->|"triggers"| GHA
    GHA -.->|"runs"| Lint
    GHA -.->|"runs"| Build
    Build -.->|"uses_config"| StylesPipe
    Build -.->|"produces"| Artifacts
    GHA -.->|"publishes"| Host

    %% Tooling/config dependencies (dashed)
    Lint -.->|"reads"| Repo
    Build -.->|"reads"| Repo

    %% =========================================================
    %% Legend
    %% =========================================================
    subgraph "Legend"
        L1["Solid arrow = runtime HTTP/load/render flow"]:::note
        L2["Dashed arrow = build-time/CI dependency"]:::note
        L3["Blue = runtime (browser)"]:::runtime
        L4["Green = infrastructure/hosting"]:::infra
        L5["Gray = build/CI tooling"]:::build
        L6["Orange = UI components"]:::component
        L7["Purple = shared/cross-cutting UI"]:::shared
        L8[("Cylinder = static data/assets")]:::data
    end

    %% =========================================================
    %% Click Events (from component_mapping)
    %% =========================================================
    click GHA "https://github.com/sharathkumarnp/profile/blob/master/.github/workflows/deploy.yml"
    click Entry "https://github.com/sharathkumarnp/profile/blob/master/index.html"
    click Main "https://github.com/sharathkumarnp/profile/blob/master/src/main.tsx"
    click App "https://github.com/sharathkumarnp/profile/blob/master/src/App.tsx"
    click PublicCss "https://github.com/sharathkumarnp/profile/blob/master/public/index.css"
    click BundledCss "https://github.com/sharathkumarnp/profile/blob/master/src/index.css"
    click AiData "https://github.com/sharathkumarnp/profile/tree/master/public/ai"
    click Header "https://github.com/sharathkumarnp/profile/blob/master/src/components/Header.tsx"
    click Hero "https://github.com/sharathkumarnp/profile/blob/master/src/components/Hero.tsx"
    click Skills "https://github.com/sharathkumarnp/profile/blob/master/src/components/Skills.tsx"
    click Experience "https://github.com/sharathkumarnp/profile/blob/master/src/components/Experience.tsx"
    click Certificates "https://github.com/sharathkumarnp/profile/blob/master/src/components/Certificates.tsx"
    click Projects "https://github.com/sharathkumarnp/profile/blob/master/src/components/Projects.tsx"
    click Contact "https://github.com/sharathkumarnp/profile/blob/master/src/components/Contact.tsx"
    click SectionFade "https://github.com/sharathkumarnp/profile/blob/master/src/components/SectionFade.tsx"
    click Chatbot "https://github.com/sharathkumarnp/profile/blob/master/src/components/Chatbot.tsx"
    click Assistant "https://github.com/sharathkumarnp/profile/blob/master/src/components/PortfolioAssistant.tsx"
    click Build "https://github.com/sharathkumarnp/profile/blob/master/vite.config.ts"
    click StylesPipe "https://github.com/sharathkumarnp/profile/blob/master/tailwind.config.js"
    click StylesPipe "https://github.com/sharathkumarnp/profile/blob/master/postcss.config.js"
    click Lint "https://github.com/sharathkumarnp/profile/blob/master/eslint.config.js"
    click Lint "https://github.com/sharathkumarnp/profile/blob/master/tsconfig.json"
    click Lint "https://github.com/sharathkumarnp/profile/blob/master/tsconfig.app.json"
    click Lint "https://github.com/sharathkumarnp/profile/blob/master/tsconfig.node.json"

    %% Direct clicks to specific JSON files
    click AiData "https://github.com/sharathkumarnp/profile/blob/master/public/ai/faq.json"
    click AiData "https://github.com/sharathkumarnp/profile/blob/master/public/ai/profile.json"

    %% =========================================================
    %% Styles
    %% =========================================================
    classDef actor fill:#ffffff,stroke:#111827,stroke-width:1.2px,color:#111827
    classDef external fill:#f8fafc,stroke:#334155,stroke-width:1.2px,color:#0f172a
    classDef infra fill:#dcfce7,stroke:#166534,stroke-width:1.4px,color:#052e16
    classDef cicd fill:#e0f2fe,stroke:#075985,stroke-width:1.4px,color:#082f49
    classDef build fill:#e5e7eb,stroke:#374151,stroke-width:1.2px,color:#111827
    classDef runtime fill:#dbeafe,stroke:#1d4ed8,stroke-width:1.4px,color:#0b1b4a
    classDef component fill:#ffedd5,stroke:#c2410c,stroke-width:1.2px,color:#431407
    classDef shared fill:#f3e8ff,stroke:#7e22ce,stroke-width:1.2px,color:#2e1065
    classDef data fill:#fff7ed,stroke:#9a3412,stroke-width:1.2px,color:#431407
    classDef note fill:#fef9c3,stroke:#a16207,stroke-width:1px,color:#422006
```
