How anhad928/anhadpreet-portfolio works
Project Type and Purpose
• Full‑stack web application built with Next.js.
• Purpose: A personal/portfolio website with pages (Home, About, Projects, Resume, Contact, Settings, GitHub) and a small backend that serves JSON data and handles contact form submissions.
Main Components
a. Client (Browser)
b. Next.js Server (Node.js runtime / Vercel serverless)
c. Frontend pages & React components
d. API routes (serverless functions)
e. Data sources:
– projects.json (bundled file)
– Potential external email service (if contact.js integrates one)
f. Static assets (PDF resumes, images)
Relationships & Data Flows
• HTTP(s) GET → Browser requests a page route (e.g. GET /projects)
→ Next.js renderer chooses between SSG or SSR → React components assemble HTML/CSS/JS → Response to Browser.
• API Calls from client (contact form, project listings)
→ HTTP POST/GET to /api/contact.js or /api/projects.js
→ Serverless function executes:
– /api/projects.js reads pages/api/projects.json → returns JSON array
– /api/contact.js may forward email to an external SMTP or API
→ JSON response to Browser.
• Static file requests
→ Browser requests files under /public (e.g. Resume.pdf) → served directly by host.
Architectural Patterns & Design Principles
• Folder‑based routing (pages/ directory drives both UI and API).
• Hybrid rendering: Static Generation (SSG) for static pages, Server‑Side Rendering (SSR) or API endpoints for dynamic data.
• Component‑based UI (components/ folder) with shared layout (Layout.jsx, Sidebar, Titlebar, Tabsbar).
• Separation of concerns: styles in CSS Modules per component, global themes in styles/themes.css.
Technologies & Frameworks to Annotate
• Next.js (framework)
• React (UI library)
• Node.js (runtime for serverless API)
• CSS Modules (styles/*.module.css)
• jsconfig.json (path aliases)
• next.config.js (Next.js configuration)