# dineshv-career/dinesh-portfolio architecture

> Architecture diagram of the GitHub repository dineshv-career/dinesh-portfolio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dineshv-career/dinesh-portfolio
- Repository: https://github.com/dineshv-career/dinesh-portfolio

## Overview

#### 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: [`app/layout.js`](https://github.com/dineshv-career/dinesh-portfolio/blob/main/app/layout.js) (Root layout), [`app/page.js`](https://github.com/dineshv-career/dinesh-portfolio/blob/main/app/page.js) (Portfolio page /), [`components/ThemeToggle.jsx`](https://github.com/dineshv-career/dinesh-portfolio/blob/main/components/ThemeToggle.jsx) (Theme toggle), [`components/ScrollReveal.jsx`](https://github.com/dineshv-career/dinesh-portfolio/blob/main/components/ScrollReveal.jsx) (Scroll reveal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Next.js App Router"]
  node_root_layout["Root layout<br/>App Router layout<br/>[layout.js]"]
  node_home_page["Portfolio page /<br/>App Router page<br/>[page.js]"]
  node_global_css["Global styles<br/>CSS stylesheet<br/>[globals.css]"]
end

subgraph group_client["Client islands"]
  node_theme_toggle["Theme toggle<br/>Client component<br/>[ThemeToggle.jsx]"]
  node_scroll_reveal["Scroll reveal<br/>Client component<br/>[ScrollReveal.jsx]"]
  node_browser_storage[("Browser localStorage<br/>Browser storage")]
  node_browser_apis{{"Browser APIs<br/>Browser platform"}}
end

subgraph group_platform["Build &amp; deployment"]
  node_package["Package scripts<br/>Node.js package<br/>[package.json]"]
  node_next_config["Next configuration<br/>Next.js config<br/>[next.config.mjs]"]
  node_next_runtime{{"Next.js runtime<br/>App Router runtime"}}
  node_font_pipeline(("Google font pipeline<br/>next/font/google<br/>[layout.js]"))
  node_vercel{{"Vercel deployment<br/>Managed hosting"}}
end

node_package -->|"runs dev, build, start"| node_next_runtime
node_next_config -->|"configures"| node_next_runtime
node_next_runtime -->|"renders"| node_root_layout
node_root_layout -->|"wraps"| node_home_page
node_root_layout -->|"loads"| node_global_css
node_home_page -->|"styled by"| node_global_css
node_home_page -->|"includes"| node_theme_toggle
node_home_page -->|"uses for sections"| node_scroll_reveal
node_theme_toggle -->|"reads and writes preference"| node_browser_storage
node_root_layout -->|"reads before paint"| node_browser_storage
node_theme_toggle -->|"hydrates in"| node_browser_apis
node_scroll_reveal -->|"uses IntersectionObserver"| node_browser_apis
node_root_layout -->|"loads fonts through"| node_font_pipeline
node_next_runtime -.->|"deploys to"| node_vercel

click node_package "https://github.com/dineshv-career/dinesh-portfolio/blob/main/package.json"
click node_next_config "https://github.com/dineshv-career/dinesh-portfolio/blob/main/next.config.mjs"
click node_root_layout "https://github.com/dineshv-career/dinesh-portfolio/blob/main/app/layout.js"
click node_home_page "https://github.com/dineshv-career/dinesh-portfolio/blob/main/app/page.js"
click node_global_css "https://github.com/dineshv-career/dinesh-portfolio/blob/main/app/globals.css"
click node_theme_toggle "https://github.com/dineshv-career/dinesh-portfolio/blob/main/components/ThemeToggle.jsx"
click node_scroll_reveal "https://github.com/dineshv-career/dinesh-portfolio/blob/main/components/ScrollReveal.jsx"
click node_font_pipeline "https://github.com/dineshv-career/dinesh-portfolio/blob/main/app/layout.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_root_layout,node_home_page,node_global_css toneBlue
class node_theme_toggle,node_scroll_reveal,node_browser_storage,node_browser_apis toneAmber
class node_package,node_next_config,node_next_runtime,node_font_pipeline,node_vercel toneMint
```

## Components

### Next.js App Router

Portfolio route and document shell.

- [Root layout](https://github.com/dineshv-career/dinesh-portfolio/blob/main/app/layout.js): App Router layout · Defines document structure, metadata, fonts, and pre-paint theme setup. · `app/layout.js`
- [Portfolio page /](https://github.com/dineshv-career/dinesh-portfolio/blob/main/app/page.js): App Router page · Owns navigation and all portfolio sections and embedded contact links. · `app/page.js`
- [Global styles](https://github.com/dineshv-career/dinesh-portfolio/blob/main/app/globals.css): CSS stylesheet · Centralizes typography and portfolio presentation. · `app/globals.css`

### Client islands

Hydrated browser-only interactions.

- [Theme toggle](https://github.com/dineshv-career/dinesh-portfolio/blob/main/components/ThemeToggle.jsx): Client component · Selects light, system, or dark theme after hydration. · `components/ThemeToggle.jsx`
- [Scroll reveal](https://github.com/dineshv-career/dinesh-portfolio/blob/main/components/ScrollReveal.jsx): Client component · Reveals page content when it enters the viewport. · `components/ScrollReveal.jsx`
- **Browser localStorage**: Browser storage · Persists the selected theme preference.
- **Browser APIs**: Browser platform · Provides viewport observation and client hydration.

### Build & deployment

Next.js build and hosting boundary.

- [Package scripts](https://github.com/dineshv-career/dinesh-portfolio/blob/main/package.json): Node.js package · Defines development, build, and production start commands. · `package.json`
- [Next configuration](https://github.com/dineshv-career/dinesh-portfolio/blob/main/next.config.mjs): Next.js config · `next.config.mjs`
- **Next.js runtime**: App Router runtime · Builds and renders the application; Vercel can host it.
- [Google font pipeline](https://github.com/dineshv-career/dinesh-portfolio/blob/main/app/layout.js): next/font/google · Fetches fonts at build time for self-hosted use. · `app/layout.js`
- **Vercel deployment**: Managed hosting

## Connections

- 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
