How dineshv-career/dinesh-portfolio works
Purpose and Runtime
This is a single-page personal portfolio migrated from static HTML to Next.js 14 App Router. It runs as a Node.js/Next.js application, serving a mostly static portfolio page with small client-side interaction features. It is deployable on Vercel without application-specific backend infrastructure.
Application Entry and Root Shell
app/layout.js is the App Router root layout: it defines document-level structure, metadata, and font loading through next/font/google. It also injects the pre-paint theme initialization script to prevent an incorrect initial color theme.
Key paths:
• app/layout.js
• app/globals.css
Portfolio Page Composition
app/page.js is the primary route entry for / and owns all portfolio content and section ordering: navigation, hero, about, skills, work, experience, education, and contact/footer. There is no content API, database, or routing hierarchy represented in the repository; page copy and external contact links are embedded in this route component.
Key path:
• app/page.js
Styling and Design Boundary
Global presentation is centralized in app/globals.css, ported from the original static page. The root layout provides font CSS variables, while global CSS consumes them for typography and page styling. This keeps visual design independent of the content structure in app/page.js.
Key paths:
• app/globals.css
• app/layout.js
• app/page.js
Theme Control Client Island
components/ThemeToggle.jsx is a client component responsible for selecting light, system, or dark mode. Theme preference persists in browser localStorage; the root-layout initialization script reads the stored preference before paint, while this component provides the interactive control after hydration. This is the main browser-storage boundary.
Key paths:
• components/ThemeToggle.jsx
• app/layout.js
Scroll Animation Client Island
components/ScrollReveal.jsx is a client component that uses the browser IntersectionObserver API to reveal content as it enters the viewport. Page sections or elements in app/page.js are expected to use this component, separating browser-only observer logic from server-rendered portfolio markup.
Key paths:
• components/ScrollReveal.jsx
• app/page.js
Render and Deployment Flow
Next.js renders the root layout and / page, with client components hydrated only where theme interaction and viewport observation are needed. At build time, Next.js bundles the App Router application and self-hosts Google fonts fetched through next/font/google. Development uses the Next dev server; production uses next build followed by next start, or Vercel’s managed Next.js deployment pipeline.
Key paths:
• package.json
• next.config.mjs
• app/layout.js
Main entry points: layout.js Root layout · page.js Portfolio page / · ThemeToggle.jsx Theme toggle · ScrollReveal.jsx Scroll reveal
Components 12
Next.js App Router
Portfolio route and document shell.
- Root layout · Defines document structure, metadata, fonts, and pre-paint theme setup.
app/layout.js - Portfolio page / · Owns navigation and all portfolio sections and embedded contact links.
app/page.js - Global styles · Centralizes typography and portfolio presentation.
app/globals.css
Client islands
Hydrated browser-only interactions.
- Theme toggle · Selects light, system, or dark theme after hydration.
components/ThemeToggle.jsx - Scroll reveal · Reveals page content when it enters the viewport.
components/ScrollReveal.jsx - Browser localStorage · Persists the selected theme preference.
- Browser APIs · Provides viewport observation and client hydration.
Build & deployment
Next.js build and hosting boundary.
- Package scripts · Defines development, build, and production start commands.
package.json - Next configuration
next.config.mjs - Next.js runtime · Builds and renders the application; Vercel can host it.
- Google font pipeline · Fetches fonts at build time for self-hosted use.
app/layout.js - Vercel deployment
Connections 14
- Package scripts → Next.js runtime: runs dev, build, start
- Next configuration → Next.js runtime: configures
- Next.js runtime → Root layout: renders
- Root layout → Portfolio page /: wraps
- Root layout → Global styles: loads
- Portfolio page / → Global styles: styled by
- Portfolio page / → Theme toggle: includes
- Portfolio page / → Scroll reveal: uses for sections
- Theme toggle → Browser localStorage: reads and writes preference
- Root layout → Browser localStorage: reads before paint
- Theme toggle → Browser APIs: hydrates in
- Scroll reveal → Browser APIs: uses IntersectionObserver
- Root layout → Google font pipeline: loads fonts through
- Next.js runtime → Vercel deployment: deploys to