# subhankarpradhan18me06/subhankar-portfolio architecture

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

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

## Overview

##### Project type & purpose (from file tree + README)
This repository is a **single-page frontend web application**: a **personal portfolio site** built with **React + Vite + TypeScript** (with some JSX components as well). There is **no backend service** or database represented in the repo—everything appears to be **static content + UI state**.

Key indicators:
- `vite.config.ts`, `index.html`, `src/main.tsx` → Vite + React SPA entry.
- `src/components/*` → component-driven UI.
- `src/store/themeSlice.js` and `src/context/ThemeContext.jsx` → explicit client-side state management for theme.
- `src/constants/index.js` → local/static data powering sections (projects, skills, etc.).
- `src/assets/*` → static assets (markdown, resume docx).
- No `server/`, no API client modules, no DB config → frontend-only architecture.

##### Runtime / Execution environment
- **User Browser**
- Loads HTML/JS/CSS
- Executes the React app
- Handles navigation/scrolling (portfolio sections)

##### App entry + composition
- `index.html` (Vite entry HTML)
- `src/main.tsx` (bootstraps React, mounts to DOM)
- `src/App.tsx` (top-level composition of page sections)

##### UI “feature” sections (component layer)
From `src/components/`:
- `Navbar.jsx` (navigation)
- `Hero.jsx` (landing section)
- `About.jsx`
- `Skills.jsx`
- `Experience.jsx`
- `Projects.jsx`
- `Contact.jsx`
- `Footer.jsx`

##### Cross-cutting UI state (theme)
- `src/context/ThemeContext.jsx` (React Context provider/consumer)
- `src/store/themeSlice.js` + `src/store/index.js` (Redux-style slice + store)

Even if only one is actively used at runtime, the repo structure suggests theme state is a key architectural element. Show:
- Where theme state is stored (Context and/or Store)
- Which components read it (likely `Navbar`, potentially all sections)
- Which components update it (theme toggle action)

##### Hooks & UI behavior utilities
- `src/hooks/useInView.js` → likely used for scroll-based animations / section-in-view detection.

##### Content/data inputs (static, local)
- `src/constants/index.js` → structured data (projects list, skills list, etc.)
- `src/assets/MarkdownFile.md` → content source
- `src/assets/Subhankar_Pradhan_resume.docx` → downloadable resource

As “static resources” consumed by components.

##### Tooling & build pipeline (non-runtime but important in architecture)
- `vite.config.ts` → build + dev server config
- `tsconfig*.json` → TypeScript build config
- `eslint.config.js` → linting rules
- `package.json` / `package-lock.json` → dependencies and scripts

##### Level 1: System Context (very small, but include it)
**Actor:** Site visitor
**System:** Portfolio SPA
**External systems (optional):**
- Static hosting/CDN (e.g., Netlify/Vercel/GitHub Pages)—not in repo, but realistically required.

##### Static Hosting/CDN
- Serves `index.html`, Vite bundles, `assets/*`
##### React SPA (Vite build output)
- Contains:
- App bootstrap (`main.tsx`)
- Root component (`App.tsx`)
- Feature sections (components)
- Theme state (Context/Store)
- Constants/assets
- Styling

- `main.tsx` → mounts → `App.tsx`
- `App.tsx` → composes → (Navbar, Hero, About, Skills, Experience, Projects, Contact, Footer)
- Components → read → `constants/index.js`
- Components → load/download → `assets/*`
- Components ↔ Theme state (Context/Redux slice)
- Components → use → `useInView` hook
- Theme state → affects → CSS classes / styling application (`index.css`, `Portfolio.css`)

- **Composition**
- `App.tsx` (layout & section order)
- **Navigation**
- `Navbar.jsx` (likely triggers scroll / section navigation; may host theme toggle)
- **Sections**
- Hero/About/Skills/Experience/Projects/Contact/Footer
- **State**
- ThemeContext Provider (Context)
- Redux Store + themeSlice
- **Hooks**
- `useInView` (used by sections for animations)
- **Data**
- constants (project/skills data)
- assets (resume docx, markdown)
- **Styling**
- global CSS + Portfolio CSS

- `Projects.jsx` → constants.projects
- `Skills.jsx` → constants.skills
- `Navbar.jsx` → theme toggle → dispatch/setTheme
- `Hero/About/...` → useInView for intersection observer behavior (if that’s what it is)

##### Architectural patterns/design principles to highlight
- **Component-based UI architecture** (React components per section).
- **Separation of concerns** by folder:
- `components/` for view
- `hooks/` for reusable behavior
- `store/` and `context/` for state
- `constants/` for data
- `assets/` for static content
- `styles/` for styling
- **State management layering**:
- Theme state is centralized (Context/Redux), not scattered across components.
- **Static-site deployment model**:
- Build step produces static artifacts; runtime is purely client-side.

##### Required elements
- **Clear labels** using file/folder names where helpful:
- “App Root (`App.tsx`)", “Bootstrap (`main.tsx`)", “Theme Store (`themeSlice.js`)"
- “composes”, “reads”, “dispatches”, “uses hook”, “loads asset”
- Blue: runtime containers (Browser, SPA)
- Green: UI components (Navbar, Hero, etc.)
- Orange: state management (Context, Redux store)
- Purple: data/static inputs (constants, markdown, resume)
- Gray: tooling/build (Vite/TypeScript/ESLint)

- Bootstrapping (`main.tsx`)
- Root composition (`App.tsx`)
- Major sections (each component file)
- Theme state (Context + Store/themeSlice)
- Hooks (`useInView`)
- Data (constants + assets)
- Styling (CSS)
- Composition (App → section components)
- Data reads (sections → constants/assets)
- State reads/writes (components ↔ theme)
- Hook usage (sections → useInView)
##### build pipeline on the side (separate lane)
- Source (`src/`) → Vite build → `dist/` (even if `dist/` not committed) → deployed to static host.

## Diagram (Mermaid)

```mermaid
flowchart TD
  %% =========================================================
  %% System Context (vertical)
  %% =========================================================
  subgraph "System Context"
    Visitor["Site Visitor"]:::actor
    Browser["User Browser"]:::runtime
    Host["Static Hosting/CDN (TBD)"]:::external
    Visitor -->|"uses"| Browser
    Browser -->|"GET /(index.html,JS,CSS,assets)"| Host
  end

  %% =========================================================
  %% Delivery Artifact
  %% =========================================================
  Host -->|"serves static files"| IndexHtml["SPA Entry HTML (index.html)"]:::artifact

  %% =========================================================
  %% React SPA Runtime (client-side)
  %% =========================================================
  subgraph "Client Runtime: React SPA (Vite build output)"
    direction TB

    subgraph "Bootstrap & Composition"
      direction TB
      Main["Bootstrap & Mount (main.tsx)"]:::core
      App["App Root Composition (App.tsx)"]:::core
      IndexHtml -->|"loads bundle"| Main
      Main -->|"mounts React tree"| App
    end

    subgraph "UI Feature Sections (src/components/)"
      direction TB
      Navbar["Navbar (Navbar.jsx)"]:::ui
      Hero["Hero (Hero.jsx)"]:::ui
      About["About (About.jsx)"]:::ui
      Skills["Skills (Skills.jsx)"]:::ui
      Experience["Experience (Experience.jsx)"]:::ui
      Projects["Projects (Projects.jsx)"]:::ui
      Contact["Contact (Contact.jsx)"]:::ui
      Footer["Footer (Footer.jsx)"]:::ui
    end

    subgraph "Cross-cutting State: Theme"
      direction TB
      ThemeContext["ThemeContext (React Context)"]:::state
      ReduxStore["Redux Store (store/index.js)"]:::state
      ThemeSlice["themeSlice (store/themeSlice.js)"]:::state
      ReduxStore -->|"registers reducer"| ThemeSlice
    end

    subgraph "Hooks & Utilities"
      direction TB
      UseInView["useInView Hook (useInView.js)"]:::util
    end

    subgraph "Local Static Data & Assets"
      direction TB
      Constants["Constants Data (constants/index.js)"]:::data
      Markdown["Markdown Content (MarkdownFile.md)"]:::data
      Resume["Resume Download (Subhankar_Pradhan_resume.docx)"]:::data
      AssetTypes["Asset Type Decls (assets.d.ts)"]:::data
    end

    subgraph "Styling"
      direction TB
      GlobalCSS["Global CSS (index.css)"]:::styling
      PortfolioCSS["Portfolio CSS (styles/Portfolio.css)"]:::styling
    end

    %% App composition to sections
    App -->|"composes"| Navbar
    App -->|"composes"| Hero
    App -->|"composes"| About
    App -->|"composes"| Skills
    App -->|"composes"| Experience
    App -->|"composes"| Projects
    App -->|"composes"| Contact
    App -->|"composes"| Footer

    %% Theme reads/writes
    Navbar -->|"toggleTheme()"| ThemeContext
    Navbar -->|"dispatch(toggleTheme)"| ReduxStore
    ThemeContext -->|"provides theme"| Navbar
    ReduxStore -->|"provides theme state"| Navbar

    %% Theme affects styling
    ThemeContext -->|"applies theme classes/tokens"| GlobalCSS
    ThemeContext -->|"applies theme classes/tokens"| PortfolioCSS
    ReduxStore -->|"applies theme classes/tokens"| GlobalCSS
    ReduxStore -->|"applies theme classes/tokens"| PortfolioCSS

    %% Hook usage for scroll/in-view behaviors (likely across sections)
    Hero -->|"uses hook"| UseInView
    About -->|"uses hook"| UseInView
    Skills -->|"uses hook"| UseInView
    Experience -->|"uses hook"| UseInView
    Projects -->|"uses hook"| UseInView
    Contact -->|"uses hook"| UseInView

    %% Static data consumption
    Projects -->|"reads projects[]"| Constants
    Skills -->|"reads skills[]"| Constants
    Experience -->|"reads experience[]"| Constants
    Navbar -->|"reads nav labels/links"| Constants

    %% Assets consumption
    About -->|"loads content"| Markdown
    Contact -->|"offers download link"| Resume
  end

  %% =========================================================
  %% Build / Tooling Pipeline (non-runtime)
  %% =========================================================
  subgraph "Build & Tooling (dev/build time)"
    direction TB
    Package["package.json (scripts/deps)"]:::tool
    Vite["Vite Config (vite.config.ts)"]:::tool
    ESLint["ESLint Config (eslint.config.js)"]:::tool
    TSJson["TypeScript Config (tsconfig.json)"]:::tool
    TSApp["TypeScript Config (tsconfig.app.json)"]:::tool
    TSNode["TypeScript Config (tsconfig.node.json)"]:::tool
    Source["Source Code (src/)"]:::tool
    Dist["Build Output (dist/)"]:::artifact

    Package -->|"runs dev/build"| Vite
    Vite -->|"bundles"| Source
    TSJson -->|"type-checks"| Source
    TSApp -->|"type-checks app"| Source
    TSNode -->|"type-checks node tools"| Source
    ESLint -->|"lints"| Source
    Source -->|"build emits"| Dist
    Dist -->|"deploy to"| Host
  end

  %% Source code ties (representative)
  Source -->|"contains"| Main
  Source -->|"contains"| App
  Source -->|"contains"| Navbar
  Source -->|"contains"| ThemeContext
  Source -->|"contains"| ReduxStore
  Source -->|"contains"| UseInView
  Source -->|"contains"| Constants
  Source -->|"contains"| GlobalCSS

  %% =========================================================
  %% Click events (from component mapping)
  %% =========================================================
  click IndexHtml "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/index.html"
  click Main "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/src/main.tsx"
  click App "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/src/App.tsx"

  click Navbar "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/src/components/Navbar.jsx"
  click Hero "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/src/components/Hero.jsx"
  click About "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/src/components/About.jsx"
  click Skills "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/src/components/Skills.jsx"
  click Experience "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/src/components/Experience.jsx"
  click Projects "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/src/components/Projects.jsx"
  click Contact "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/src/components/Contact.jsx"
  click Footer "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/src/components/Footer.jsx"
  click ThemeContext "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/src/context/ThemeContext.jsx"
  click ReduxStore "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/src/store/index.js"
  click ThemeSlice "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/src/store/themeSlice.js"
  click UseInView "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/src/hooks/useInView.js"
  click Constants "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/src/constants/index.js"
  click Markdown "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/src/assets/MarkdownFile.md"
  click Resume "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/src/assets/Subhankar_Pradhan_resume.docx"
  click GlobalCSS "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/src/index.css"
  click PortfolioCSS "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/src/styles/Portfolio.css"
  click Vite "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/vite.config.ts"
  click TSJson "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/tsconfig.json"
  click TSApp "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/tsconfig.app.json"
  click TSNode "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/tsconfig.node.json"
  click ESLint "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/eslint.config.js"
  click Package "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/package.json"
  click AssetTypes "https://github.com/subhankarpradhan18me06/subhankar-portfolio/blob/main/src/types/assets.d.ts"

  %% Also map directory-level components
  click Source "https://github.com/subhankarpradhan18me06/subhankar-portfolio/tree/main/src/"

  %% =========================================================
  %% Styles (color is critical)
  %% =========================================================
  classDef actor fill:#111827,stroke:#111827,color:#FFFFFF,stroke-width:1px
  classDef runtime fill:#1D4ED8,stroke:#0B2F6A,color:#FFFFFF,stroke-width:1px
  classDef external fill:#0EA5E9,stroke:#075985,color:#FFFFFF,stroke-width:1px
  classDef core fill:#2563EB,stroke:#1E3A8A,color:#FFFFFF,stroke-width:1px
  classDef ui fill:#16A34A,stroke:#14532D,color:#FFFFFF,stroke-width:1px
  classDef state fill:#F97316,stroke:#7C2D12,color:#FFFFFF,stroke-width:1px
  classDef util fill:#14B8A6,stroke:#134E4A,color:#FFFFFF,stroke-width:1px
  classDef data fill:#7C3AED,stroke:#3B0764,color:#FFFFFF,stroke-width:1px
  classDef styling fill:#64748B,stroke:#334155,color:#FFFFFF,stroke-width:1px
  classDef tool fill:#6B7280,stroke:#374151,color:#FFFFFF,stroke-width:1px
  classDef artifact fill:#A3A3A3,stroke:#525252,color:#111827,stroke-width:1px
```
