How kalluru498/website_portfolio works
Project type and purpose
• This is a Next.js-based portfolio website (front-end only) built with React, TypeScript, Tailwind CSS, and Contentlayer.
• Its primary function is to serve static and server-rendered pages (home, about, blog, projects, contact, resume) along with a chatbot component that calls out to an external API.
File structure
• Top level:
• app/ – Next.js App Router directory containing page.tsx files for each route, plus global CSS, layout and metadata.
• components/ – React components organized by feature (about, blog, contact, home, projects, resume), plus a generic ui/ subfolder for reusable UI building blocks.
• hooks/, lib/, types/ – custom hooks, utility functions, and type definitions.
• contentlayer.config.ts – config for sourcing markdown or MDX blog content at build time.
• public/ – static assets (images).
• Config files for ESLint, Tailwind, PostCSS, Next.js, TypeScript, etc.
README
• Minimal description; confirms this is a “portfolio” site.
a. Main components
• Client (Browser)
• CDN / Edge Cache (e.g., Vercel)
• Next.js Serverless Rendering / Static Generation Engine
• Content Data (Markdown/MDX via Contentlayer)
• UI Component Library (in-repo components/ui)
• Build & Deployment Pipeline (Git → CI/CD → Vercel)
• External Chatbot API (e.g., OpenAI)
b. Relationships and data flows
1. Browser → CDN: request for /, /blog, /projects, etc.
2. CDN → Next.js:
• For static pages: serve from cache.
• For SSG paths (blog posts): if not cached, Next.js static-generates at build or on-demand using Contentlayer data, then caches.
• For SSR/ISR (if used): executes a serverless function, fetches data, renders React output, then returns HTML + hydration JS.
3. React Components → UI Library & Hooks: client loads JS bundle containing the component hierarchy and util functions.
4. Chat interaction: Browser → ChatbotProvider component → external API → back to ChatbotProvider → UI update.
5. Build pipeline: Git push → CI/CD → runs next build (Contentlayer processes content) → deploy to Vercel → populates CDN.
c. Architectural patterns & design principles
• File-based routing with Next.js App Router
• Static Site Generation (SSG) for performance, with some Server-Side Rendering (SSR)/Incremental Static Regeneration (ISR) capabilities.
• Component-driven design: atomic/reusable UI primitives in components/ui and feature-specific components.
• Separation of concerns: routing (app/) vs. UI composition (components/) vs. utilities (lib/, hooks/).
• CDN edge caching and serverless functions for scalable delivery.
d. Key technologies & frameworks
• Next.js 13+ (App Router)
• React + TypeScript
• Tailwind CSS + PostCSS
• Contentlayer for Markdown/MDX → data layer
• Vercel (or similar) for hosting and edge functions
• (Optional) OpenAI or other API for chatbot integration
Detail is key
• Data flows (HTML, JSON, JS bundles, markdown → HTML).
• Don’t hesitate to decompose the UI layer further (e.g., highlight the components/ui library vs. page-specific components).