How chauhan-yuvraj/portfolio works
Purpose and Entry Points
This is a Next.js 14 App Router frontend for a personal portfolio with an embedded AI assistant (“UV”). The root application shell is app/layout.tsx; the primary portfolio route is app/(app)/page.tsx. Route groups separate main portfolio presentation, chat UI, and sidebar composition without necessarily creating URL segments.
Portfolio Composition
The portfolio is assembled from feature-oriented visual sections: header/introduction, bio, overview/contact, experience history, and projects. The main content building blocks reside in app/(main)/components/CenterContent.tsx, app/(main)/components/bio/index.tsx, and app/(main)/components/projects/index.tsx. These components render a profile-specific, largely data-driven portfolio rather than querying a portfolio CMS.
Profile Data Boundary
Static portfolio domain data is centralized under features/profile/data, with matching TypeScript contracts under features/profile/types. Core sources include features/profile/data/user.ts, features/profile/data/experiences.ts, and features/profile/data/projects.ts. This creates a boundary between reusable presentation components and the owner-specific content, including blogs, social links, technology stack, and GitHub contribution data.
Chat Client and Conversation Flow
The chat experience is decomposed into display, input, and framing components: app/(chat)/ChatSection.tsx, app/(chat)/ChatBody.tsx, and app/(chat)/ChatFooter.tsx. User input, conversation history, and a persisted user name are packaged client-side; responses are rendered into the chat body, including any returned identity updates. The README identifies LocalStorage as the persistence mechanism and a typing/animated response presentation.
Backend and AI Integration Boundary
services/chatService.ts is the frontend’s REST boundary to an external Python/FastAPI MCP backend. The backend—not this repository—uses Google Gemini and MCP tools to answer portfolio questions, inspect resume/static context, and retrieve live GitHub information such as stars, streaks, and repositories. Production is described as a Render-hosted endpoint; frontend failure/loading behavior should remain isolated at this service boundary.
Layout, Navigation, and Responsive Behavior
A desktop sidebar and responsive chat/portfolio layout are represented by app/(sidebar)/SideBar.tsx, app/(sidebar)/components/SideBarBodySection.tsx, and components/SideBar.tsx. Scroll-related cross-component state is exposed through app/contexts/ScrollContext.tsx, likely coordinating navigation with portfolio sections. The architecture supports persistent desktop navigation and a mobile chat drawer.
Shared UI and Runtime
The runtime is TypeScript/React on Next.js, styled through global CSS and Tailwind-oriented UI primitives. Shared visual infrastructure includes components/provider.tsx, components/ui/button.tsx, and components/ui/contribution-graph.tsx; animation behavior uses Framer Motion per the README. Supporting integrations include DiceBear for name-derived pixel avatars, Lucide icons, GitHub-derived contribution display, and phone-number metadata/utilities in assets/libphonenumber.metadata.json and lib/libphonenumber.ts.
Main entry points: CenterContent.tsx Portfolio Content · layout.tsx Application Shell · data Profile Data · ChatSection.tsx Chat Frame
Components 20
Next.js Runtime
- Application Shell
app/layout.tsx - Portfolio Route
app/(app)/page.tsx
Portfolio
- Portfolio Content · Composes header, introduction, overview, contact, and experience sections.
app/(main)/components/CenterContent.tsx - Bio Section
app/(main)/components/bio/index.tsx - Projects Section
app/(main)/components/projects/index.tsx - Profile Contracts · Contracts for reusable profile presentation and content.
features/profile/types - Profile Data · Owner-specific content including profile, experience, projects, links, and GitHub data.
features/profile/data
Chat Assistant
- Chat Frame · Hosts the assistant conversation interface.
app/(chat)/ChatSection.tsx - Conversation Display · Renders history, typing presentation, and identity updates.
app/(chat)/ChatBody.tsx - Chat Input · Packages user input and persisted user name.
app/(chat)/ChatFooter.tsx - LocalStorage · Persists chat-side user state.
- Chat Service · Isolates loading and failure behavior for backend requests.
services/chatService.ts - External MCP Backend · Uses Gemini and MCP tools for portfolio and live GitHub answers.
Shared UI & State
- Desktop Sidebar
app/(sidebar)/SideBar.tsx - Sidebar Body
app/(sidebar)/components/SideBarBodySection.tsx - Responsive Sidebar · Supports the mobile chat drawer layout.
components/SideBar.tsx - Scroll Context · Coordinates scrolling and section navigation.
app/contexts/ScrollContext.tsx - UI Provider
components/provider.tsx - UI Primitives · Includes buttons and GitHub contribution graph rendering.
components/ui/button.tsx - Phone Utilities
lib/libphonenumber.ts
Connections 23
- Application Shell → Portfolio Route: renders
- Application Shell → UI Provider: wraps
- Portfolio Route → Portfolio Content: composes
- Portfolio Content → Bio Section: renders
- Portfolio Content → Projects Section: renders
- Portfolio Content → Profile Data: reads
- Bio Section → Profile Data: reads
- Projects Section → Profile Data: reads
- Profile Data → Profile Contracts: conforms to
- Application Shell → Chat Frame: hosts
- Chat Frame → Conversation Display: renders
- Chat Frame → Chat Input: renders
- Chat Input → LocalStorage: persists user state
- Chat Input → Chat Service: sends messages
- Chat Service → External MCP Backend: REST requests
- External MCP Backend → Conversation Display: assistant responses
- Application Shell → Desktop Sidebar: hosts
- Desktop Sidebar → Sidebar Body: composes
- Application Shell → Responsive Sidebar: adapts for mobile
- Desktop Sidebar → Scroll Context: navigates through
- Scroll Context → Portfolio Content: coordinates sections
- Portfolio Content → UI Primitives: uses
- Portfolio Content → Phone Utilities: formats contact data