# vishwanatha01/vishwanath-portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/vishwanatha01/vishwanath-portfolio
- Repository: https://github.com/vishwanatha01/vishwanath-portfolio

## Overview

This is a Next.js personal portfolio and lightweight CMS. The main visitor flow is browsing project case studies, articles, résumé and editable profile pages; the same content is managed through a private admin panel. Contact submissions enter an inbox, while the assistant grounds Gemini answers in portfolio content and the home page can show live GitHub statistics. Storage abstracts files, Vercel Blob and MongoDB. Several page and admin implementations were not sampled, so those documented capabilities are represented at subsystem level; their edges cite the README where needed.

Main entry points: [`lib/store.ts`](https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/lib/store.ts) (Content store), [`app/api/admin`](https://github.com/vishwanatha01/vishwanath-portfolio/tree/main/app/api/admin) (Admin APIs), [`app/(site)/page.tsx`](https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/app/(site)/page.tsx) (Home experience), [`app/(site)/about/page.tsx`](https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/app/(site)/about/page.tsx) (Profile pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public portfolio"]
  node_public_pages["Portfolio pages"]
  node_home["Home experience<br/>[page.tsx]"]
  node_projects["Project case studies"]
  node_blog["Blog articles"]
  node_resume["Résumé<br/>[page.tsx]"]
  node_profile_pages["Profile pages<br/>[page.tsx]"]
  node_rss["RSS feed<br/>[route.ts]"]
end

subgraph group_content["Content and rendering"]
  node_markdown["Markdown renderer<br/>[markdown.tsx]"]
  node_flow_diagrams["Flow diagrams<br/>[FlowDiagram.tsx]"]
  node_content_data["Starter content<br/>[data.ts]"]
  node_media["Media helpers<br/>[media.ts]"]
  node_project_cover["Project artwork<br/>[Cover.tsx]"]
  node_post_list["Post lists<br/>[PostList.tsx]"]
end

subgraph group_admin["Admin and APIs"]
  node_admin_ui["Admin dashboard<br/>[AdminDashboard.tsx]"]
  node_admin_panels["Content panels"]
  node_admin_routes["Admin APIs"]
  node_contact_route["Contact endpoint<br/>[route.ts]"]
  node_assistant_route["Assistant endpoint<br/>[route.ts]"]
  node_validation["Input validation<br/>[validation.ts]"]
  node_api_security["API guards<br/>[api.ts]"]
end

subgraph group_services["Storage and integrations"]
  node_auth["Admin sessions<br/>[auth.ts]"]
  node_store["Content store<br/>[store.ts]"]
  node_database[("MongoDB connector<br/>[db.ts]")]
  node_github["GitHub data<br/>[github.ts]"]
end

node_visitor(("Visitor"))
node_administrator(("Administrator"))
node_gemini["Google Gemini"]

node_visitor -->|"browses"| node_public_pages
node_public_pages -.->|"loads content"| node_store
node_home -->|"loads stats"| node_github
node_home -->|"loads portfolio"| node_store
node_projects -.->|"loads projects"| node_store
node_blog -.->|"loads posts"| node_store
node_resume -->|"loads content"| node_store
node_profile_pages -->|"loads pages"| node_store
node_profile_pages -->|"renders content"| node_markdown
node_post_list -->|"renders covers"| node_project_cover
node_markdown -->|"renders diagrams"| node_flow_diagrams
node_rss -->|"loads posts"| node_store
node_rss -->|"resolves covers"| node_media
node_administrator -->|"edits content"| node_admin_ui
node_admin_ui -.->|"uses panels"| node_admin_panels
node_admin_panels -.->|"saves changes"| node_admin_routes
node_admin_routes -->|"checks access"| node_api_security
node_api_security -->|"checks session"| node_auth
node_admin_routes -->|"validates input"| node_validation
node_admin_routes -->|"reads and writes"| node_store
node_contact_route -->|"validates message"| node_validation
node_contact_route -->|"stores message"| node_store
node_store -->|"connects"| node_database
node_assistant_route -->|"loads context"| node_store
node_assistant_route -->|"requests answer"| node_gemini

click node_public_pages "https://github.com/vishwanatha01/vishwanath-portfolio/tree/main/app/(site)"
click node_home "https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/app/(site)/page.tsx"
click node_projects "https://github.com/vishwanatha01/vishwanath-portfolio/tree/main/app/(site)/projects"
click node_blog "https://github.com/vishwanatha01/vishwanath-portfolio/tree/main/app/(site)/blog"
click node_resume "https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/app/(site)/resume/page.tsx"
click node_profile_pages "https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/app/(site)/about/page.tsx"
click node_markdown "https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/lib/markdown.tsx"
click node_flow_diagrams "https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/components/FlowDiagram.tsx"
click node_content_data "https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/lib/data.ts"
click node_media "https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/lib/media.ts"
click node_project_cover "https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/components/Cover.tsx"
click node_post_list "https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/components/site/PostList.tsx"
click node_admin_ui "https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/components/admin/AdminDashboard.tsx"
click node_admin_panels "https://github.com/vishwanatha01/vishwanath-portfolio/tree/main/components/admin"
click node_admin_routes "https://github.com/vishwanatha01/vishwanath-portfolio/tree/main/app/api/admin"
click node_contact_route "https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/app/api/contact/route.ts"
click node_assistant_route "https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/app/api/assistant/route.ts"
click node_validation "https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/lib/validation.ts"
click node_api_security "https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/lib/api.ts"
click node_auth "https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/lib/auth.ts"
click node_store "https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/lib/store.ts"
click node_database "https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/lib/db.ts"
click node_github "https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/lib/github.ts"
click node_rss "https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/app/feed.xml/route.ts"

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_public_pages,node_home,node_projects,node_blog,node_resume,node_profile_pages,node_rss toneBlue
class node_markdown,node_flow_diagrams,node_content_data,node_media,node_project_cover,node_post_list toneAmber
class node_admin_ui,node_admin_panels,node_admin_routes,node_contact_route,node_assistant_route,node_validation,node_api_security toneMint
class node_auth,node_store,node_database,node_github toneRose
class node_visitor,node_administrator,node_gemini toneIndigo
```

## Components

### Public portfolio

- [Portfolio pages](https://github.com/vishwanatha01/vishwanath-portfolio/tree/main/app/(site)): `app/(site)`
- [Home experience](https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/app/(site)/page.tsx): `app/(site)/page.tsx`
- [Project case studies](https://github.com/vishwanatha01/vishwanath-portfolio/tree/main/app/(site)/projects): `app/(site)/projects`
- [Blog articles](https://github.com/vishwanatha01/vishwanath-portfolio/tree/main/app/(site)/blog): `app/(site)/blog`
- [Résumé](https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/app/(site)/resume/page.tsx): `app/(site)/resume/page.tsx`
- [Profile pages](https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/app/(site)/about/page.tsx): `app/(site)/about/page.tsx`
- [RSS feed](https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/app/feed.xml/route.ts): `app/feed.xml/route.ts`

### Content and rendering

- [Markdown renderer](https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/lib/markdown.tsx): `lib/markdown.tsx`
- [Flow diagrams](https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/components/FlowDiagram.tsx): `components/FlowDiagram.tsx`
- [Starter content](https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/lib/data.ts): `lib/data.ts`
- [Media helpers](https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/lib/media.ts): `lib/media.ts`
- [Project artwork](https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/components/Cover.tsx): `components/Cover.tsx`
- [Post lists](https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/components/site/PostList.tsx): `components/site/PostList.tsx`

### Admin and APIs

- [Admin dashboard](https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/components/admin/AdminDashboard.tsx): `components/admin/AdminDashboard.tsx`
- [Content panels](https://github.com/vishwanatha01/vishwanath-portfolio/tree/main/components/admin): `components/admin`
- [Admin APIs](https://github.com/vishwanatha01/vishwanath-portfolio/tree/main/app/api/admin): `app/api/admin`
- [Contact endpoint](https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/app/api/contact/route.ts): `app/api/contact/route.ts`
- [Assistant endpoint](https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/app/api/assistant/route.ts): `app/api/assistant/route.ts`
- [Input validation](https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/lib/validation.ts): `lib/validation.ts`
- [API guards](https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/lib/api.ts): `lib/api.ts`

### Storage and integrations

- [Admin sessions](https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/lib/auth.ts): `lib/auth.ts`
- [Content store](https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/lib/store.ts): `lib/store.ts`
- [MongoDB connector](https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/lib/db.ts): `lib/db.ts`
- [GitHub data](https://github.com/vishwanatha01/vishwanath-portfolio/blob/main/lib/github.ts): `lib/github.ts`

### Other components

- **Visitor**
- **Administrator**
- **Google Gemini**

## Connections

- Visitor → Portfolio pages: browses
- Portfolio pages → Content store: loads content (evidence: `app/(site)/page.tsx`)
- Home experience → GitHub data: loads stats (evidence: `app/(site)/page.tsx`)
- Home experience → Content store: loads portfolio (evidence: `app/(site)/page.tsx`)
- Project case studies → Content store: loads projects
- Blog articles → Content store: loads posts
- Résumé → Content store: loads content (evidence: `app/(site)/resume/page.tsx`)
- Profile pages → Content store: loads pages (evidence: `app/(site)/about/page.tsx`)
- Profile pages → Markdown renderer: renders content (evidence: `app/(site)/about/page.tsx`)
- Post lists → Project artwork: renders covers (evidence: `components/site/PostList.tsx`)
- Markdown renderer → Flow diagrams: renders diagrams (evidence: `lib/markdown.tsx`)
- RSS feed → Content store: loads posts (evidence: `app/feed.xml/route.ts`)
- RSS feed → Media helpers: resolves covers (evidence: `app/feed.xml/route.ts`)
- Administrator → Admin dashboard: edits content
- Admin dashboard → Content panels: uses panels
- Content panels → Admin APIs: saves changes
- Admin APIs → API guards: checks access (evidence: `app/api/admin/projects/route.ts`)
- API guards → Admin sessions: checks session (evidence: `lib/api.ts`)
- Admin APIs → Input validation: validates input (evidence: `app/api/admin/projects/route.ts`)
- Admin APIs → Content store: reads and writes (evidence: `app/api/admin/projects/route.ts`)
- Contact endpoint → Input validation: validates message (evidence: `app/api/contact/route.ts`)
- Contact endpoint → Content store: stores message (evidence: `app/api/contact/route.ts`)
- Content store → MongoDB connector: connects (evidence: `lib/store.ts`)
- Assistant endpoint → Content store: loads context (evidence: `app/api/assistant/route.ts`)
- Assistant endpoint → Google Gemini: requests answer (evidence: `app/api/assistant/route.ts`)
