# dhruv-mavani/my-portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/dhruv-mavani/my-portfolio
- Repository: https://github.com/dhruv-mavani/my-portfolio

## Overview

1. This repository is a small Next.js application built with the App Router. The core runtime boundary is the Next.js server/client split: page and layout files under `app/` define the UI shell, while `app/api/chat/route.ts` defines a server-side HTTP endpoint.

2. The main user-facing surface is the root page at `app/page.tsx`, wrapped by `app/layout.tsx`. `app/globals.css` provides the global styling layer, so the visual architecture is centered on a single app shell rather than multiple feature pages.

3. The UI component structure is minimal and shared. `src/components/Navbar.tsx` is the only named reusable component in the tree, suggesting a lightweight top-level navigation/header that is imported into the page or layout rather than a large component ecosystem.

4. There is one explicit backend/API subsystem: `app/api/chat/route.ts`. In Next.js App Router terms, this is a request handler exposed as an HTTP route, likely used by the frontend to send chat messages and receive responses. That makes the app a combined frontend + serverless API project, not just a static site.

5. Static assets live in `public/`, which is a distinct delivery boundary from the app code. Two notable assets are `public/resume.pdf` and `public/notion-pow.html`, indicating the site serves downloadable or directly accessible documents alongside the main app UI.

6. The project has no separate database, queue, auth, or background worker directories in the tree. Architecturally, that suggests a thin application layer with state and processing either handled in-browser or inside the chat route handler rather than through external infrastructure managed in-repo.

7. The technology stack is standard Next.js + TypeScript. Supporting config files (`next.config.ts`, `tsconfig.json`, `eslint.config.mjs`, `postcss.config.mjs`) indicate conventional build, type-checking, linting, and CSS processing, but no unusual framework extensions are present.

8. The deployment model is the default Next.js one, likely suitable for Vercel or any Node-capable host. The chat API route would be deployed alongside the frontend as the same application, so there is a single deployable unit with mixed server and client responsibilities.

9. Data flow is probably straightforward: browser request loads the page, the page renders shared navigation and content, and any interactive chat behavior calls the `/api/chat` endpoint over HTTP. Static documents in `public/` bypass application logic and are served directly.

10. From an architecture-diagram perspective, the main boxes are:
- Browser/UI client
- Next.js app shell (`app/layout.tsx`, `app/page.tsx`, `src/components/Navbar.tsx`)
- Serverless/API layer (`app/api/chat/route.ts`)
- Static asset bucket (`public/`)

11. The repository is small enough that the most important boundary is not between many internal modules, but between presentation, API handling, and static content delivery. That is the key separation to preserve in any diagram.

12. In short: this is a single Next.js app with one reusable UI component, one API endpoint for chat, and a couple of static documents exposed from `public/`. The architecture is intentionally simple and monolithic, with Next.js handling both frontend rendering and backend request handling in one codebase.

Main entry points: [`app/page.tsx`](https://github.com/dhruv-mavani/my-portfolio/blob/main/app/page.tsx) (Home page), [`app/layout.tsx`](https://github.com/dhruv-mavani/my-portfolio/blob/main/app/layout.tsx) (Root layout), [`app/api/chat/route.ts`](https://github.com/dhruv-mavani/my-portfolio/blob/main/app/api/chat/route.ts) (Chat route), [`tsconfig.json`](https://github.com/dhruv-mavani/my-portfolio/blob/main/tsconfig.json) (TypeScript config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client/UI"]
  node_browser(("Browser<br/>client actor"))
  node_layout["Root layout<br/>app shell<br/>[layout.tsx]"]
  node_page["Home page<br/>ui page<br/>[page.tsx]"]
  node_navbar["Navbar<br/>shared component<br/>[Navbar.tsx]"]
  node_styles["Global CSS<br/>style layer<br/>[globals.css]"]
end

subgraph group_server["Server/API"]
  node_chatroute["Chat route<br/>http handler<br/>[route.ts]"]
end

subgraph group_assets["Static Assets"]
  node_resume["Resume PDF<br/>static document<br/>[resume.pdf]"]
  node_notion["Notion page<br/>static html<br/>[notion-pow.html]"]
end

subgraph group_tooling["Tooling"]
  node_nextconfig["Next config<br/>framework config<br/>[next.config.ts]"]
  node_tsconfig["TypeScript config<br/>compiler config<br/>[tsconfig.json]"]
  node_eslint["ESLint config<br/>[eslint.config.mjs]"]
  node_postcss["PostCSS config<br/>css build config<br/>[postcss.config.mjs]"]
end

node_browser -->|"loads"| node_layout
node_layout -->|"wraps"| node_page
node_page -->|"uses"| node_navbar
node_layout -->|"imports"| node_styles
node_page -->|"calls"| node_chatroute
node_browser -->|"opens"| node_resume
node_browser -->|"opens"| node_notion
node_layout -.->|"shaped by"| node_nextconfig
node_page -.->|"typed by"| node_tsconfig
node_navbar -.->|"typed by"| node_tsconfig
node_chatroute -.->|"typed by"| node_tsconfig
node_page -.->|"linted by"| node_eslint
node_chatroute -.->|"linted by"| node_eslint
node_styles -.->|"processed by"| node_postcss

click node_layout "https://github.com/dhruv-mavani/my-portfolio/blob/main/app/layout.tsx"
click node_page "https://github.com/dhruv-mavani/my-portfolio/blob/main/app/page.tsx"
click node_navbar "https://github.com/dhruv-mavani/my-portfolio/blob/main/src/components/Navbar.tsx"
click node_styles "https://github.com/dhruv-mavani/my-portfolio/blob/main/app/globals.css"
click node_chatroute "https://github.com/dhruv-mavani/my-portfolio/blob/main/app/api/chat/route.ts"
click node_resume "https://github.com/dhruv-mavani/my-portfolio/blob/main/public/resume.pdf"
click node_notion "https://github.com/dhruv-mavani/my-portfolio/blob/main/public/notion-pow.html"
click node_nextconfig "https://github.com/dhruv-mavani/my-portfolio/blob/main/next.config.ts"
click node_tsconfig "https://github.com/dhruv-mavani/my-portfolio/blob/main/tsconfig.json"
click node_eslint "https://github.com/dhruv-mavani/my-portfolio/blob/main/eslint.config.mjs"
click node_postcss "https://github.com/dhruv-mavani/my-portfolio/blob/main/postcss.config.mjs"

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_browser,node_layout,node_page,node_navbar,node_styles toneBlue
class node_chatroute toneAmber
class node_resume,node_notion toneMint
class node_nextconfig,node_tsconfig,node_eslint,node_postcss toneRose
```

## Components

### Client/UI

Browser-facing rendering and interaction

- **Browser**: client actor · Loads the app and calls the chat endpoint
- [Root layout](https://github.com/dhruv-mavani/my-portfolio/blob/main/app/layout.tsx): app shell · Top-level document shell for the App Router · `app/layout.tsx`
- [Home page](https://github.com/dhruv-mavani/my-portfolio/blob/main/app/page.tsx): ui page · Main user-facing landing view · `app/page.tsx`
- [Navbar](https://github.com/dhruv-mavani/my-portfolio/blob/main/src/components/Navbar.tsx): shared component · Reusable top-level navigation/header · `src/components/Navbar.tsx`
- [Global CSS](https://github.com/dhruv-mavani/my-portfolio/blob/main/app/globals.css): style layer · Shared global styling for the app · `app/globals.css`

### Server/API

App Router request handling

- [Chat route](https://github.com/dhruv-mavani/my-portfolio/blob/main/app/api/chat/route.ts): http handler · Server-side API endpoint for chat requests · `app/api/chat/route.ts`

### Static Assets

Files served directly from public/

- [Resume PDF](https://github.com/dhruv-mavani/my-portfolio/blob/main/public/resume.pdf): static document · Downloadable public PDF asset · `public/resume.pdf`
- [Notion page](https://github.com/dhruv-mavani/my-portfolio/blob/main/public/notion-pow.html): static html · Directly served public HTML document · `public/notion-pow.html`

### Tooling

Build, type, lint, and style configuration

- [Next config](https://github.com/dhruv-mavani/my-portfolio/blob/main/next.config.ts): framework config · Next.js runtime/build configuration · `next.config.ts`
- [TypeScript config](https://github.com/dhruv-mavani/my-portfolio/blob/main/tsconfig.json): compiler config · TypeScript project and path settings · `tsconfig.json`
- [ESLint config](https://github.com/dhruv-mavani/my-portfolio/blob/main/eslint.config.mjs): lint config · Code quality rules and checks · `eslint.config.mjs`
- [PostCSS config](https://github.com/dhruv-mavani/my-portfolio/blob/main/postcss.config.mjs): css build config · CSS processing pipeline configuration · `postcss.config.mjs`

## Connections

- Browser → Root layout: loads · Initial app shell render
- Root layout → Home page: wraps · Root document shell wraps the home page
- Home page → Navbar: uses · Page composes the shared navigation component
- Root layout → Global CSS: imports · Global styles are applied at the app shell level
- Home page → Chat route: calls · Interactive chat flow sends requests to the API route
- Browser → Resume PDF: opens · Public asset can be downloaded directly
- Browser → Notion page: opens · Public HTML can be accessed directly
- Root layout → Next config: shaped by · Framework behavior is controlled by Next.js config
- Home page → TypeScript config: typed by · App code is compiled under the TypeScript setup
- Navbar → TypeScript config: typed by · Shared component participates in the same TS project
- Chat route → TypeScript config: typed by · Route handler is compiled with the same TypeScript settings
- Home page → ESLint config: linted by · UI code follows the repository lint rules
- Chat route → ESLint config: linted by · Server code follows the repository lint rules
- Global CSS → PostCSS config: processed by · CSS is processed through PostCSS
