How tomervivek/portfolio works
Project type and purpose
• This is a Next.js–based React application that serves as a personal portfolio site.
• It uses file-based routing for pages under pages/, React components under components/, Tailwind CSS for styling, and includes a simple serverless API endpoint (pages/api/hello.js).
• It can be deployed as a static site with SSR/SSG support or on a serverless platform such as Vercel.
File structure
Top-level directories and files:
• pages/ – Next.js page files and API routes
• components/ – reusable React UI components (Header, Footer, Banner, etc.)
• public/ – static assets (PDF, images)
• styles/ – global CSS and CSS modules (Tailwind and custom animations)
• next.config.js, tailwind.config.js, postcss.config.js – build and styling configuration
• package.json/package-lock.json – dependencies and scripts
Architectural patterns revealed:
• File-based routing (pages map 1:1 to URLs)
• Component-based UI structure
• API routes living alongside pages for serverless functions
• Static asset hosting via public/
• Tailwind + CSS modules for styling
README for additional insights
• Confirms use of Create-Next-App bootstrap.
• Highlights development workflow (npm run dev) and automatic hot reload.
• Mentions API routes and next/font optimization for Google Fonts.
• Suggests deployment on Vercel (serverless hosting, CDN).
Main components and their relationships
a. Client (Browser) – initiates HTTP requests for pages, API calls, and static assets
b. Next.js Server or Serverless Platform
– SSR/SSG engine that:
· Renders React pages on the server (if configured)
· Serves pre-built static pages
· Runs API endpoint code (pages/api/*.js)
c. React Component Tree
– pages/index.js composes UI by importing components/*
d. Styling Engine
– Tailwind CSS + CSS modules applied at build time
e. Static Asset Store (public/)
– PDF, images, fonts served directly via CDN or static server
f. External Services
– Google Fonts (via next/font)
– Vercel CDN for global distribution (optional)
Architectural patterns and design principles
• Componentization: break UI into reusable components (Banner, Skills, Projects).
• File-based routing: conventions over configuration for frontend and backend routes.
• Serverless functions: API routes abstracted as serverless endpoints.
• Static + dynamic hybrid: leverage SSG for speed and SSR for dynamic data (if needed).
• Utility-first CSS: Tailwind for rapid styling and minimal CSS bundle size.
• Container boundaries illustrating runtime environments (Client vs. Server/Serverless).
• Callouts for configuration files that influence the build/deploy process.