How sharathkumarnp/profile works
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.