# haider-523/portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/haider-523/portfolio
- Repository: https://github.com/haider-523/portfolio

## Overview

This is a recruiter-focused, multi-page developer portfolio. A visitor browses the home, about, projects, experience, and contact pages; project detail routes provide case-study depth, while the shared layout supplies navigation and site chrome. The optional assistant answers from curated portfolio knowledge and may use Gemini; the contact form submits to FormSubmit. The sampled sources establish the content and route wiring, but the assistant panel’s request to its API route was not shown, so that connection is marked unverified.

Main entry points: [`src/data/portfolio.ts`](https://github.com/haider-523/portfolio/blob/main/src/data/portfolio.ts) (Verified portfolio data), [`src/components/layout/site-header.tsx`](https://github.com/haider-523/portfolio/blob/main/src/components/layout/site-header.tsx) (Site navigation), [`src/app/page.tsx`](https://github.com/haider-523/portfolio/blob/main/src/app/page.tsx) (Home page), [`src/components/sections/projects.tsx`](https://github.com/haider-523/portfolio/blob/main/src/components/sections/projects.tsx) (Project previews)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pages["Portfolio pages"]
  node_home["Home page<br/>[page.tsx]"]
  node_aboutpage["About page<br/>[page.tsx]"]
  node_projectspage["Projects page<br/>[page.tsx]"]
  node_projectdetail["Project detail<br/>[page.tsx]"]
  node_experiencepage["Experience page<br/>[page.tsx]"]
  node_contactpage["Contact page<br/>[page.tsx]"]
end

subgraph group_presentation["Shared presentation"]
  node_layout["Shared site layout<br/>[layout.tsx]"]
  node_header["Site navigation<br/>[site-header.tsx]"]
  node_footer["Site footer<br/>[site-footer.tsx]"]
end

subgraph group_content["Portfolio content"]
  node_hero["Hero section<br/>[hero.tsx]"]
  node_projects["Project previews<br/>[projects.tsx]"]
  node_aboutsections["About, skills, education, awards"]
  node_experience["Roles and milestones<br/>[experience.tsx]"]
  node_contact["Contact details and form<br/>[contact.tsx]"]
  node_portfolio["Verified portfolio data<br/>[portfolio.ts]"]
end

subgraph group_assistant["AI assistant"]
  node_assistantlauncher["Assistant launcher"]
  node_assistantpanel["Assistant chat panel"]
  node_assistantapi["Assistant API route<br/>[route.ts]"]
  node_assistantlogic["Retrieval and response<br/>[assistant.ts]"]
  node_knowledge["Curated knowledge base"]
end

node_visitor(("Recruiter / visitor"))
node_gemini{{"Gemini API"}}
node_formsubmit{{"FormSubmit"}}

node_visitor -->|"opens"| node_home
node_visitor -->|"opens"| node_aboutpage
node_visitor -->|"opens"| node_projectspage
node_visitor -->|"opens"| node_projectdetail
node_visitor -->|"opens"| node_experiencepage
node_visitor -->|"opens"| node_contactpage
node_home -->|"renders"| node_hero
node_home -->|"renders"| node_projects
node_home -->|"reads profile"| node_portfolio
node_aboutpage -->|"renders"| node_aboutsections
node_projectspage -->|"renders"| node_projects
node_projectdetail -->|"looks up project"| node_portfolio
node_experiencepage -->|"renders"| node_experience
node_contactpage -->|"renders"| node_contact
node_layout -->|"renders"| node_header
node_layout -->|"renders"| node_footer
node_header -->|"reads links"| node_portfolio
node_header -->|"navigates"| node_aboutpage
node_header -->|"navigates"| node_projectspage
node_header -->|"navigates"| node_experiencepage
node_header -->|"navigates"| node_contactpage
node_hero -->|"reads profile"| node_portfolio
node_projects -->|"reads projects"| node_portfolio
node_projects -.->|"links to cases"| node_projectdetail
node_experience -->|"reads experience"| node_portfolio
node_contact -->|"reads contact details"| node_portfolio
node_contact -->|"submits message"| node_formsubmit
node_layout -->|"renders"| node_assistantlauncher
node_assistantlauncher -->|"opens lazily"| node_assistantpanel
node_assistantpanel -.->|"requests answer"| node_assistantapi
node_assistantapi -->|"calls"| node_assistantlogic
node_assistantlogic -->|"retrieves context"| node_knowledge
node_knowledge -->|"builds knowledge from"| node_portfolio
node_assistantlogic -.->|"optionally queries"| node_gemini

click node_home "https://github.com/haider-523/portfolio/blob/main/src/app/page.tsx"
click node_aboutpage "https://github.com/haider-523/portfolio/blob/main/src/app/about/page.tsx"
click node_projectspage "https://github.com/haider-523/portfolio/blob/main/src/app/projects/page.tsx"
click node_projectdetail "https://github.com/haider-523/portfolio/blob/main/src/app/projects/%5Bslug%5D/page.tsx"
click node_experiencepage "https://github.com/haider-523/portfolio/blob/main/src/app/experience/page.tsx"
click node_contactpage "https://github.com/haider-523/portfolio/blob/main/src/app/contact/page.tsx"
click node_layout "https://github.com/haider-523/portfolio/blob/main/src/app/layout.tsx"
click node_header "https://github.com/haider-523/portfolio/blob/main/src/components/layout/site-header.tsx"
click node_footer "https://github.com/haider-523/portfolio/blob/main/src/components/layout/site-footer.tsx"
click node_hero "https://github.com/haider-523/portfolio/blob/main/src/components/sections/hero.tsx"
click node_projects "https://github.com/haider-523/portfolio/blob/main/src/components/sections/projects.tsx"
click node_aboutsections "https://github.com/haider-523/portfolio/tree/main/src/components/sections"
click node_experience "https://github.com/haider-523/portfolio/blob/main/src/components/sections/experience.tsx"
click node_contact "https://github.com/haider-523/portfolio/blob/main/src/components/sections/contact.tsx"
click node_portfolio "https://github.com/haider-523/portfolio/blob/main/src/data/portfolio.ts"
click node_assistantlauncher "https://github.com/haider-523/portfolio/blob/main/src/components/assistant/assistant-launcher.tsx"
click node_assistantpanel "https://github.com/haider-523/portfolio/blob/main/src/components/assistant/assistant-panel.tsx"
click node_assistantapi "https://github.com/haider-523/portfolio/blob/main/src/app/api/assistant/route.ts"
click node_assistantlogic "https://github.com/haider-523/portfolio/blob/main/src/lib/assistant.ts"
click node_knowledge "https://github.com/haider-523/portfolio/blob/main/src/lib/assistant-knowledge.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_home,node_aboutpage,node_projectspage,node_projectdetail,node_experiencepage,node_contactpage toneBlue
class node_layout,node_header,node_footer toneAmber
class node_hero,node_projects,node_aboutsections,node_experience,node_contact,node_portfolio,node_gemini toneMint
class node_assistantlauncher,node_assistantpanel,node_assistantapi,node_assistantlogic,node_knowledge toneRose
class node_visitor,node_formsubmit toneIndigo
```

## Components

### Portfolio pages

- [Home page](https://github.com/haider-523/portfolio/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [About page](https://github.com/haider-523/portfolio/blob/main/src/app/about/page.tsx): `src/app/about/page.tsx`
- [Projects page](https://github.com/haider-523/portfolio/blob/main/src/app/projects/page.tsx): `src/app/projects/page.tsx`
- [Project detail](https://github.com/haider-523/portfolio/blob/main/src/app/projects/%5Bslug%5D/page.tsx): `src/app/projects/[slug]/page.tsx`
- [Experience page](https://github.com/haider-523/portfolio/blob/main/src/app/experience/page.tsx): `src/app/experience/page.tsx`
- [Contact page](https://github.com/haider-523/portfolio/blob/main/src/app/contact/page.tsx): `src/app/contact/page.tsx`

### Shared presentation

- [Shared site layout](https://github.com/haider-523/portfolio/blob/main/src/app/layout.tsx): `src/app/layout.tsx`
- [Site navigation](https://github.com/haider-523/portfolio/blob/main/src/components/layout/site-header.tsx): `src/components/layout/site-header.tsx`
- [Site footer](https://github.com/haider-523/portfolio/blob/main/src/components/layout/site-footer.tsx): `src/components/layout/site-footer.tsx`

### Portfolio content

- [Hero section](https://github.com/haider-523/portfolio/blob/main/src/components/sections/hero.tsx): `src/components/sections/hero.tsx`
- [Project previews](https://github.com/haider-523/portfolio/blob/main/src/components/sections/projects.tsx): `src/components/sections/projects.tsx`
- [About, skills, education, awards](https://github.com/haider-523/portfolio/tree/main/src/components/sections): `src/components/sections`
- [Roles and milestones](https://github.com/haider-523/portfolio/blob/main/src/components/sections/experience.tsx): `src/components/sections/experience.tsx`
- [Contact details and form](https://github.com/haider-523/portfolio/blob/main/src/components/sections/contact.tsx): `src/components/sections/contact.tsx`
- [Verified portfolio data](https://github.com/haider-523/portfolio/blob/main/src/data/portfolio.ts): `src/data/portfolio.ts`

### AI assistant

- [Assistant launcher](https://github.com/haider-523/portfolio/blob/main/src/components/assistant/assistant-launcher.tsx): `src/components/assistant/assistant-launcher.tsx`
- [Assistant chat panel](https://github.com/haider-523/portfolio/blob/main/src/components/assistant/assistant-panel.tsx): `src/components/assistant/assistant-panel.tsx`
- [Assistant API route](https://github.com/haider-523/portfolio/blob/main/src/app/api/assistant/route.ts): `src/app/api/assistant/route.ts`
- [Retrieval and response](https://github.com/haider-523/portfolio/blob/main/src/lib/assistant.ts): `src/lib/assistant.ts`
- [Curated knowledge base](https://github.com/haider-523/portfolio/blob/main/src/lib/assistant-knowledge.ts): `src/lib/assistant-knowledge.ts`

### Other components

- **Recruiter / visitor**
- **Gemini API**
- **FormSubmit**

## Connections

- Recruiter / visitor → Home page: opens (evidence: `README.md`)
- Recruiter / visitor → About page: opens (evidence: `README.md`)
- Recruiter / visitor → Projects page: opens (evidence: `README.md`)
- Recruiter / visitor → Project detail: opens (evidence: `README.md`)
- Recruiter / visitor → Experience page: opens (evidence: `README.md`)
- Recruiter / visitor → Contact page: opens (evidence: `README.md`)
- Home page → Hero section: renders (evidence: `src/app/page.tsx`)
- Home page → Project previews: renders (evidence: `src/app/page.tsx`)
- Home page → Verified portfolio data: reads profile (evidence: `src/app/page.tsx`)
- About page → About, skills, education, awards: renders (evidence: `src/app/about/page.tsx`)
- Projects page → Project previews: renders (evidence: `src/app/projects/page.tsx`)
- Project detail → Verified portfolio data: looks up project (evidence: `src/app/projects/[slug]/page.tsx`)
- Experience page → Roles and milestones: renders (evidence: `src/app/experience/page.tsx`)
- Contact page → Contact details and form: renders (evidence: `src/app/contact/page.tsx`)
- Shared site layout → Site navigation: renders (evidence: `src/app/layout.tsx`)
- Shared site layout → Site footer: renders (evidence: `src/app/layout.tsx`)
- Site navigation → Verified portfolio data: reads links (evidence: `src/components/layout/site-header.tsx`)
- Site navigation → About page: navigates (evidence: `README.md`)
- Site navigation → Projects page: navigates (evidence: `README.md`)
- Site navigation → Experience page: navigates (evidence: `README.md`)
- Site navigation → Contact page: navigates (evidence: `README.md`)
- Hero section → Verified portfolio data: reads profile (evidence: `src/components/sections/hero.tsx`)
- Project previews → Verified portfolio data: reads projects (evidence: `src/components/sections/projects.tsx`)
- Project previews → Project detail: links to cases
- Roles and milestones → Verified portfolio data: reads experience (evidence: `src/components/sections/experience.tsx`)
- Contact details and form → Verified portfolio data: reads contact details (evidence: `src/components/sections/contact.tsx`)
- Contact details and form → FormSubmit: submits message
- Shared site layout → Assistant launcher: renders (evidence: `src/app/layout.tsx`)
- Assistant launcher → Assistant chat panel: opens lazily (evidence: `src/components/assistant/assistant-launcher.tsx`)
- Assistant chat panel → Assistant API route: requests answer
- Assistant API route → Retrieval and response: calls (evidence: `src/app/api/assistant/route.ts`)
- Retrieval and response → Curated knowledge base: retrieves context (evidence: `src/lib/assistant.ts`)
- Curated knowledge base → Verified portfolio data: builds knowledge from (evidence: `src/lib/assistant-knowledge.ts`)
- Retrieval and response → Gemini API: optionally queries (evidence: `src/lib/assistant.ts`)
