How subhankarpradhan18me06/subhankar-portfolio works
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.