# md-tuhin-hasnat/portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/md-tuhin-hasnat/portfolio
- Repository: https://github.com/md-tuhin-hasnat/portfolio

## Overview

This is a personal portfolio site with profile, experience, education, project, and blog sections, plus an AI question-answering chat and a Sanity-backed content studio. The main visitor workflow is browsing portfolio or editorial pages; a separate chat workflow sends a question with context to an AI flow and displays its response. Edges rely on the provided excerpts and SOURCE INDEX; unsampled implementation details and integrations are left unconnected where their wiring is not shown.

Main entry points: [`sanity/client.js`](https://github.com/md-tuhin-hasnat/portfolio/blob/main/sanity/client.js) (Sanity client), [`components/custom/reusable/section-heading.jsx`](https://github.com/md-tuhin-hasnat/portfolio/blob/main/components/custom/reusable/section-heading.jsx) (Section heading), [`app/experience/page.jsx`](https://github.com/md-tuhin-hasnat/portfolio/blob/main/app/experience/page.jsx) (Experience page), [`app/projects/page.jsx`](https://github.com/md-tuhin-hasnat/portfolio/blob/main/app/projects/page.jsx) (Project archive)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portfolio["Portfolio pages"]
  node_home["Profile home<br/>[page.jsx]"]
  node_experience["Experience page<br/>[page.jsx]"]
  node_education["Education page<br/>[page.jsx]"]
  node_projects["Project archive<br/>[page.jsx]"]
  node_blog["Blog listing<br/>[page.jsx]"]
  node_article["Blog article<br/>[page.jsx]"]
  node_profile_sections["Profile sections"]
  node_experience_sections["Experience sections"]
  node_timeline["Experience timeline<br/>[timeline.jsx]"]
end

subgraph group_content["Content management"]
  node_sanity_client["Sanity client<br/>[client.js]"]
  node_sanity_schemas["Content schemas"]
  node_studio["Sanity studio<br/>[page.jsx]"]
end

subgraph group_assistant["AI assistant"]
  node_chat_route["Ask AI page<br/>[page.jsx]"]
  node_chat["Chat interface<br/>[chat.jsx]"]
  node_usage_limit["Usage limits<br/>[use-usage-limit.js]"]
  node_answer_flow["Context answer flow"]
  node_genkit["Genkit setup<br/>[genkit.js]"]
end

subgraph group_presentation["Shared presentation"]
  node_rich_text["Rich text renderer"]
  node_section_heading["Section heading"]
end

node_visitor(("Visitor"))
node_sanity_service[("Sanity CMS")]

node_home -->|"renders"| node_profile_sections
node_home -->|"renders"| node_section_heading
node_experience -->|"renders"| node_experience_sections
node_experience -->|"renders"| node_timeline
node_experience -->|"renders"| node_section_heading
node_education -->|"fetches from"| node_sanity_client
node_education -->|"renders"| node_section_heading
node_projects -->|"fetches from"| node_sanity_client
node_projects -->|"renders"| node_rich_text
node_projects -->|"renders"| node_section_heading
node_blog -->|"fetches from"| node_sanity_client
node_blog -->|"renders"| node_section_heading
node_article -->|"fetches from"| node_sanity_client
node_article -->|"renders"| node_rich_text
node_timeline -->|"fetches from"| node_sanity_client
node_studio -.->|"configures"| node_sanity_schemas
node_sanity_client -.->|"queries"| node_sanity_service
node_chat_route -->|"renders"| node_chat
node_chat -->|"submits question"| node_answer_flow
node_chat -->|"checks limits"| node_usage_limit
node_answer_flow -->|"defines flow with"| node_genkit
node_visitor -.->|"browses"| node_home
node_visitor -.->|"asks questions"| node_chat_route

click node_home "https://github.com/md-tuhin-hasnat/portfolio/blob/main/app/page.jsx"
click node_experience "https://github.com/md-tuhin-hasnat/portfolio/blob/main/app/experience/page.jsx"
click node_education "https://github.com/md-tuhin-hasnat/portfolio/blob/main/app/education/page.jsx"
click node_projects "https://github.com/md-tuhin-hasnat/portfolio/blob/main/app/projects/page.jsx"
click node_blog "https://github.com/md-tuhin-hasnat/portfolio/blob/main/app/blog/page.jsx"
click node_article "https://github.com/md-tuhin-hasnat/portfolio/blob/main/app/blog/%5Bslug%5D/page.jsx"
click node_profile_sections "https://github.com/md-tuhin-hasnat/portfolio/tree/main/components/custom/about-me"
click node_experience_sections "https://github.com/md-tuhin-hasnat/portfolio/tree/main/components/custom/experiences"
click node_timeline "https://github.com/md-tuhin-hasnat/portfolio/blob/main/components/custom/experiences/timeline.jsx"
click node_sanity_client "https://github.com/md-tuhin-hasnat/portfolio/blob/main/sanity/client.js"
click node_sanity_schemas "https://github.com/md-tuhin-hasnat/portfolio/tree/main/sanity/schemas"
click node_studio "https://github.com/md-tuhin-hasnat/portfolio/blob/main/app/studio/%5B%5B...index%5D%5D/page.jsx"
click node_rich_text "https://github.com/md-tuhin-hasnat/portfolio/blob/main/components/custom/reusable/rich-text-renderer.jsx"
click node_section_heading "https://github.com/md-tuhin-hasnat/portfolio/blob/main/components/custom/reusable/section-heading.jsx"
click node_chat_route "https://github.com/md-tuhin-hasnat/portfolio/blob/main/app/askai/page.jsx"
click node_chat "https://github.com/md-tuhin-hasnat/portfolio/blob/main/components/chat.jsx"
click node_usage_limit "https://github.com/md-tuhin-hasnat/portfolio/blob/main/hooks/use-usage-limit.js"
click node_answer_flow "https://github.com/md-tuhin-hasnat/portfolio/blob/main/ai/flows/answer-question-with-context.js"
click node_genkit "https://github.com/md-tuhin-hasnat/portfolio/blob/main/ai/genkit.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_home,node_experience,node_education,node_projects,node_blog,node_article,node_profile_sections,node_experience_sections,node_timeline toneBlue
class node_sanity_client,node_sanity_schemas,node_studio,node_sanity_service toneAmber
class node_chat_route,node_chat,node_usage_limit,node_answer_flow,node_genkit toneMint
class node_rich_text,node_section_heading toneRose
class node_visitor toneIndigo
```

## Components

### Portfolio pages

- [Profile home](https://github.com/md-tuhin-hasnat/portfolio/blob/main/app/page.jsx): `app/page.jsx`
- [Experience page](https://github.com/md-tuhin-hasnat/portfolio/blob/main/app/experience/page.jsx): `app/experience/page.jsx`
- [Education page](https://github.com/md-tuhin-hasnat/portfolio/blob/main/app/education/page.jsx): `app/education/page.jsx`
- [Project archive](https://github.com/md-tuhin-hasnat/portfolio/blob/main/app/projects/page.jsx): `app/projects/page.jsx`
- [Blog listing](https://github.com/md-tuhin-hasnat/portfolio/blob/main/app/blog/page.jsx): `app/blog/page.jsx`
- [Blog article](https://github.com/md-tuhin-hasnat/portfolio/blob/main/app/blog/%5Bslug%5D/page.jsx): `app/blog/[slug]/page.jsx`
- [Profile sections](https://github.com/md-tuhin-hasnat/portfolio/tree/main/components/custom/about-me): `components/custom/about-me`
- [Experience sections](https://github.com/md-tuhin-hasnat/portfolio/tree/main/components/custom/experiences): `components/custom/experiences`
- [Experience timeline](https://github.com/md-tuhin-hasnat/portfolio/blob/main/components/custom/experiences/timeline.jsx): `components/custom/experiences/timeline.jsx`

### Content management

- [Sanity client](https://github.com/md-tuhin-hasnat/portfolio/blob/main/sanity/client.js): `sanity/client.js`
- [Content schemas](https://github.com/md-tuhin-hasnat/portfolio/tree/main/sanity/schemas): `sanity/schemas`
- [Sanity studio](https://github.com/md-tuhin-hasnat/portfolio/blob/main/app/studio/%5B%5B...index%5D%5D/page.jsx): `app/studio/[[...index]]/page.jsx`

### AI assistant

- [Ask AI page](https://github.com/md-tuhin-hasnat/portfolio/blob/main/app/askai/page.jsx): `app/askai/page.jsx`
- [Chat interface](https://github.com/md-tuhin-hasnat/portfolio/blob/main/components/chat.jsx): `components/chat.jsx`
- [Usage limits](https://github.com/md-tuhin-hasnat/portfolio/blob/main/hooks/use-usage-limit.js): `hooks/use-usage-limit.js`
- [Context answer flow](https://github.com/md-tuhin-hasnat/portfolio/blob/main/ai/flows/answer-question-with-context.js): `ai/flows/answer-question-with-context.js`
- [Genkit setup](https://github.com/md-tuhin-hasnat/portfolio/blob/main/ai/genkit.js): `ai/genkit.js`

### Shared presentation

- [Rich text renderer](https://github.com/md-tuhin-hasnat/portfolio/blob/main/components/custom/reusable/rich-text-renderer.jsx): `components/custom/reusable/rich-text-renderer.jsx`
- [Section heading](https://github.com/md-tuhin-hasnat/portfolio/blob/main/components/custom/reusable/section-heading.jsx): `components/custom/reusable/section-heading.jsx`

### Other components

- **Visitor**
- **Sanity CMS**

## Connections

- Profile home → Profile sections: renders (evidence: `app/page.jsx`)
- Profile home → Section heading: renders (evidence: `app/page.jsx`)
- Experience page → Experience sections: renders (evidence: `app/experience/page.jsx`)
- Experience page → Experience timeline: renders (evidence: `app/experience/page.jsx`)
- Experience page → Section heading: renders (evidence: `app/experience/page.jsx`)
- Education page → Sanity client: fetches from (evidence: `app/education/page.jsx`)
- Education page → Section heading: renders (evidence: `app/education/page.jsx`)
- Project archive → Sanity client: fetches from (evidence: `app/projects/page.jsx`)
- Project archive → Rich text renderer: renders (evidence: `app/projects/page.jsx`)
- Project archive → Section heading: renders (evidence: `app/projects/page.jsx`)
- Blog listing → Sanity client: fetches from (evidence: `app/blog/page.jsx`)
- Blog listing → Section heading: renders (evidence: `app/blog/page.jsx`)
- Blog article → Sanity client: fetches from (evidence: `app/blog/[slug]/page.jsx`)
- Blog article → Rich text renderer: renders (evidence: `app/blog/[slug]/page.jsx`)
- Experience timeline → Sanity client: fetches from (evidence: `components/custom/experiences/timeline.jsx`)
- Sanity studio → Content schemas: configures
- Sanity client → Sanity CMS: queries
- Ask AI page → Chat interface: renders (evidence: `app/askai/page.jsx`)
- Chat interface → Context answer flow: submits question (evidence: `components/chat.jsx`)
- Chat interface → Usage limits: checks limits (evidence: `components/chat.jsx`)
- Context answer flow → Genkit setup: defines flow with (evidence: `ai/flows/answer-question-with-context.js`)
- Visitor → Profile home: browses
- Visitor → Ask AI page: asks questions
