# jay2323-tech/portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/jay2323-tech/portfolio
- Repository: https://github.com/jay2323-tech/portfolio

## Overview

This is a Next.js personal portfolio: visitors browse project narratives and build notes, explore an interactive architecture diagram, ask a corpus-backed assistant, and submit a contact form. The main page assembles the portfolio sections; case-study routes load and render individual studies. The assistant streams retrieved sources and generated answer tokens through an API endpoint. Edges are limited to README statements and source-index references or excerpts; unsampled UI wiring is omitted or marked unverified.

Main entry points: [`app/page.tsx`](https://github.com/jay2323-tech/portfolio/blob/First-Build/app/page.tsx) (Home assembly), [`app/api/ask/route.ts`](https://github.com/jay2323-tech/portfolio/blob/First-Build/app/api/ask/route.ts) (Ask endpoint), [`app/work/[slug]/page.tsx`](https://github.com/jay2323-tech/portfolio/blob/First-Build/app/work/%5Bslug%5D/page.tsx) (Study route), [`components/articles/ArticlesSection.tsx`](https://github.com/jay2323-tech/portfolio/blob/First-Build/components/articles/ArticlesSection.tsx) (Build notes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portfolio["Portfolio content"]
  node_home["Home assembly<br/>[page.tsx]"]
  node_hero["Hero<br/>[Hero.tsx]"]
  node_case_list["Case studies"]
  node_case_data["Study loader<br/>[index.ts]"]
  node_case_detail["Study detail"]
  node_study_route["Study route<br/>[page.tsx]"]
  node_articles["Build notes"]
  node_build_list["Build-log list<br/>[BuildLogList.tsx]"]
  node_lab["Experiment lab<br/>[LabSection.tsx]"]
  node_diagram["Architecture diagram"]
  node_about["About section<br/>[AboutSection.tsx]"]
  node_footer["Footer<br/>[Footer.tsx]"]
end

subgraph group_assistant["Ask assistant"]
  node_ask_ui["Ask interface<br/>[AskContext.tsx]"]
  node_ask_client["Streaming client<br/>[client.ts]"]
  node_ask_api["Ask endpoint<br/>[route.ts]"]
  node_rate_limit["Rate limiter<br/>[rate-limit.ts]"]
  node_retrieval["Corpus retrieval<br/>[retrieve.ts]"]
  node_embedding["Query embedding<br/>[embed.ts]"]
  node_generation["Answer generation<br/>[generate.ts]"]
  node_prompt["Prompt assembly<br/>[prompt.ts]"]
  node_source_chips["Source references<br/>[SourceChips.tsx]"]
end

subgraph group_contact["Contact"]
  node_contact_ui["Contact form<br/>[ContactForm.tsx]"]
  node_contact_api["Contact endpoint<br/>[route.ts]"]
  node_email["Email delivery<br/>[email.ts]"]
end

subgraph group_interface["Shared interface"]
  node_section_header["Section header<br/>[SectionHeader.tsx]"]
end

subgraph group_runtime["Runtime services"]
  node_gsap["Scroll animation<br/>[setup.ts]"]
end

node_visitor(("Visitor"))
node_email_service(("Email provider"))
node_model_service(("Model provider"))

node_visitor -->|"visits"| node_home
node_home -->|"renders"| node_hero
node_home -->|"renders"| node_case_list
node_home -->|"renders"| node_articles
node_home -->|"renders"| node_lab
node_home -->|"renders"| node_about
node_home -->|"renders"| node_footer
node_home -->|"loads studies"| node_case_data
node_case_list -->|"renders cards"| node_case_detail
node_visitor -->|"opens study"| node_study_route
node_study_route -->|"loads study"| node_case_data
node_study_route -->|"renders detail"| node_case_detail
node_articles -.->|"shows build log"| node_build_list
node_articles -->|"renders"| node_section_header
node_lab -->|"renders"| node_diagram
node_lab -->|"renders"| node_section_header
node_visitor -->|"asks question"| node_ask_ui
node_ask_client -->|"posts query"| node_ask_api
node_ask_api -->|"checks quota"| node_rate_limit
node_ask_api -->|"retrieves chunks"| node_retrieval
node_retrieval -->|"embeds query"| node_embedding
node_ask_api -->|"streams answer"| node_generation
node_generation -->|"builds prompt"| node_prompt
node_generation -.->|"requests completion"| node_model_service
node_ask_ui -.->|"uses client"| node_ask_client
node_visitor -->|"submits message"| node_contact_ui
node_contact_ui -.->|"sends form"| node_contact_api
node_contact_api -->|"sends message"| node_email
node_email -.->|"delivers email"| node_email_service

click node_home "https://github.com/jay2323-tech/portfolio/blob/First-Build/app/page.tsx"
click node_hero "https://github.com/jay2323-tech/portfolio/blob/First-Build/components/hero/Hero.tsx"
click node_case_list "https://github.com/jay2323-tech/portfolio/blob/First-Build/components/case-studies/CaseStudiesSection.tsx"
click node_case_data "https://github.com/jay2323-tech/portfolio/blob/First-Build/lib/case-studies/index.ts"
click node_case_detail "https://github.com/jay2323-tech/portfolio/blob/First-Build/components/case-studies/CaseStudyDetail.tsx"
click node_study_route "https://github.com/jay2323-tech/portfolio/blob/First-Build/app/work/%5Bslug%5D/page.tsx"
click node_articles "https://github.com/jay2323-tech/portfolio/blob/First-Build/components/articles/ArticlesSection.tsx"
click node_build_list "https://github.com/jay2323-tech/portfolio/blob/First-Build/components/build-log/BuildLogList.tsx"
click node_lab "https://github.com/jay2323-tech/portfolio/blob/First-Build/components/lab/LabSection.tsx"
click node_diagram "https://github.com/jay2323-tech/portfolio/blob/First-Build/components/architecture-diagram/ArchitectureDiagram.tsx"
click node_about "https://github.com/jay2323-tech/portfolio/blob/First-Build/components/about/AboutSection.tsx"
click node_footer "https://github.com/jay2323-tech/portfolio/blob/First-Build/components/Footer.tsx"
click node_ask_ui "https://github.com/jay2323-tech/portfolio/blob/First-Build/components/ask-my-work/AskContext.tsx"
click node_ask_client "https://github.com/jay2323-tech/portfolio/blob/First-Build/lib/rag/client.ts"
click node_ask_api "https://github.com/jay2323-tech/portfolio/blob/First-Build/app/api/ask/route.ts"
click node_rate_limit "https://github.com/jay2323-tech/portfolio/blob/First-Build/lib/rag/rate-limit.ts"
click node_retrieval "https://github.com/jay2323-tech/portfolio/blob/First-Build/lib/rag/retrieve.ts"
click node_embedding "https://github.com/jay2323-tech/portfolio/blob/First-Build/lib/rag/embed.ts"
click node_generation "https://github.com/jay2323-tech/portfolio/blob/First-Build/lib/rag/generate.ts"
click node_prompt "https://github.com/jay2323-tech/portfolio/blob/First-Build/lib/rag/prompt.ts"
click node_source_chips "https://github.com/jay2323-tech/portfolio/blob/First-Build/components/ask-my-work/SourceChips.tsx"
click node_contact_ui "https://github.com/jay2323-tech/portfolio/blob/First-Build/components/contact/ContactForm.tsx"
click node_contact_api "https://github.com/jay2323-tech/portfolio/blob/First-Build/app/api/contact/route.ts"
click node_email "https://github.com/jay2323-tech/portfolio/blob/First-Build/lib/email.ts"
click node_section_header "https://github.com/jay2323-tech/portfolio/blob/First-Build/components/chrome/SectionHeader.tsx"
click node_gsap "https://github.com/jay2323-tech/portfolio/blob/First-Build/lib/gsap/setup.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_hero,node_case_list,node_case_data,node_case_detail,node_study_route,node_articles,node_build_list,node_lab,node_diagram,node_about,node_footer toneBlue
class node_ask_ui,node_ask_client,node_ask_api,node_rate_limit,node_retrieval,node_embedding,node_generation,node_prompt,node_source_chips toneAmber
class node_contact_ui,node_contact_api,node_email toneMint
class node_section_header toneRose
class node_gsap,node_visitor,node_email_service,node_model_service toneIndigo
```

## Components

### Portfolio content

- [Home assembly](https://github.com/jay2323-tech/portfolio/blob/First-Build/app/page.tsx): `app/page.tsx`
- [Hero](https://github.com/jay2323-tech/portfolio/blob/First-Build/components/hero/Hero.tsx): `components/hero/Hero.tsx`
- [Case studies](https://github.com/jay2323-tech/portfolio/blob/First-Build/components/case-studies/CaseStudiesSection.tsx): `components/case-studies/CaseStudiesSection.tsx`
- [Study loader](https://github.com/jay2323-tech/portfolio/blob/First-Build/lib/case-studies/index.ts): `lib/case-studies/index.ts`
- [Study detail](https://github.com/jay2323-tech/portfolio/blob/First-Build/components/case-studies/CaseStudyDetail.tsx): `components/case-studies/CaseStudyDetail.tsx`
- [Study route](https://github.com/jay2323-tech/portfolio/blob/First-Build/app/work/%5Bslug%5D/page.tsx): `app/work/[slug]/page.tsx`
- [Build notes](https://github.com/jay2323-tech/portfolio/blob/First-Build/components/articles/ArticlesSection.tsx): `components/articles/ArticlesSection.tsx`
- [Build-log list](https://github.com/jay2323-tech/portfolio/blob/First-Build/components/build-log/BuildLogList.tsx): `components/build-log/BuildLogList.tsx`
- [Experiment lab](https://github.com/jay2323-tech/portfolio/blob/First-Build/components/lab/LabSection.tsx): `components/lab/LabSection.tsx`
- [Architecture diagram](https://github.com/jay2323-tech/portfolio/blob/First-Build/components/architecture-diagram/ArchitectureDiagram.tsx): `components/architecture-diagram/ArchitectureDiagram.tsx`
- [About section](https://github.com/jay2323-tech/portfolio/blob/First-Build/components/about/AboutSection.tsx): `components/about/AboutSection.tsx`
- [Footer](https://github.com/jay2323-tech/portfolio/blob/First-Build/components/Footer.tsx): `components/Footer.tsx`

### Ask assistant

- [Ask interface](https://github.com/jay2323-tech/portfolio/blob/First-Build/components/ask-my-work/AskContext.tsx): `components/ask-my-work/AskContext.tsx`
- [Streaming client](https://github.com/jay2323-tech/portfolio/blob/First-Build/lib/rag/client.ts): `lib/rag/client.ts`
- [Ask endpoint](https://github.com/jay2323-tech/portfolio/blob/First-Build/app/api/ask/route.ts): `app/api/ask/route.ts`
- [Rate limiter](https://github.com/jay2323-tech/portfolio/blob/First-Build/lib/rag/rate-limit.ts): `lib/rag/rate-limit.ts`
- [Corpus retrieval](https://github.com/jay2323-tech/portfolio/blob/First-Build/lib/rag/retrieve.ts): `lib/rag/retrieve.ts`
- [Query embedding](https://github.com/jay2323-tech/portfolio/blob/First-Build/lib/rag/embed.ts): `lib/rag/embed.ts`
- [Answer generation](https://github.com/jay2323-tech/portfolio/blob/First-Build/lib/rag/generate.ts): `lib/rag/generate.ts`
- [Prompt assembly](https://github.com/jay2323-tech/portfolio/blob/First-Build/lib/rag/prompt.ts): `lib/rag/prompt.ts`
- [Source references](https://github.com/jay2323-tech/portfolio/blob/First-Build/components/ask-my-work/SourceChips.tsx): `components/ask-my-work/SourceChips.tsx`

### Contact

- [Contact form](https://github.com/jay2323-tech/portfolio/blob/First-Build/components/contact/ContactForm.tsx): `components/contact/ContactForm.tsx`
- [Contact endpoint](https://github.com/jay2323-tech/portfolio/blob/First-Build/app/api/contact/route.ts): `app/api/contact/route.ts`
- [Email delivery](https://github.com/jay2323-tech/portfolio/blob/First-Build/lib/email.ts): `lib/email.ts`

### Shared interface

- [Section header](https://github.com/jay2323-tech/portfolio/blob/First-Build/components/chrome/SectionHeader.tsx): `components/chrome/SectionHeader.tsx`

### Runtime services

- [Scroll animation](https://github.com/jay2323-tech/portfolio/blob/First-Build/lib/gsap/setup.ts): `lib/gsap/setup.ts`

### Other components

- **Visitor**
- **Email provider**
- **Model provider**

## Connections

- Visitor → Home assembly: visits (evidence: `README.md`)
- Home assembly → Hero: renders (evidence: `app/page.tsx`)
- Home assembly → Case studies: renders (evidence: `app/page.tsx`)
- Home assembly → Build notes: renders (evidence: `app/page.tsx`)
- Home assembly → Experiment lab: renders (evidence: `app/page.tsx`)
- Home assembly → About section: renders (evidence: `app/page.tsx`)
- Home assembly → Footer: renders (evidence: `app/page.tsx`)
- Home assembly → Study loader: loads studies (evidence: `app/page.tsx`)
- Case studies → Study detail: renders cards (evidence: `components/case-studies/CaseStudiesSection.tsx`)
- Visitor → Study route: opens study (evidence: `README.md`)
- Study route → Study loader: loads study (evidence: `app/work/[slug]/page.tsx`)
- Study route → Study detail: renders detail (evidence: `app/work/[slug]/page.tsx`)
- Build notes → Build-log list: shows build log
- Build notes → Section header: renders (evidence: `components/articles/ArticlesSection.tsx`)
- Experiment lab → Architecture diagram: renders (evidence: `components/lab/LabSection.tsx`)
- Experiment lab → Section header: renders (evidence: `components/lab/LabSection.tsx`)
- Visitor → Ask interface: asks question (evidence: `README.md`)
- Streaming client → Ask endpoint: posts query (evidence: `lib/rag/client.ts`)
- Ask endpoint → Rate limiter: checks quota (evidence: `app/api/ask/route.ts`)
- Ask endpoint → Corpus retrieval: retrieves chunks (evidence: `app/api/ask/route.ts`)
- Corpus retrieval → Query embedding: embeds query (evidence: `lib/rag/retrieve.ts`)
- Ask endpoint → Answer generation: streams answer (evidence: `app/api/ask/route.ts`)
- Answer generation → Prompt assembly: builds prompt (evidence: `lib/rag/generate.ts`)
- Answer generation → Model provider: requests completion
- Ask interface → Streaming client: uses client
- Visitor → Contact form: submits message (evidence: `README.md`)
- Contact form → Contact endpoint: sends form
- Contact endpoint → Email delivery: sends message (evidence: `app/api/contact/route.ts`)
- Email delivery → Email provider: delivers email
