# 008993368-yaz/genai-portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/008993368-yaz/genai-portfolio
- Repository: https://github.com/008993368-yaz/genai-portfolio

## Overview

GenAI Portfolio combines a content-rich React portfolio with a FastAPI assistant. Visitors browse profile, skills, experience, projects and education, or ask the chat console a question; the frontend streams a reply and refreshes suggested questions. The backend applies topic guardrails, uses session memory, retrieves resume context and generates answers; separate endpoints expose search, suggestions and metrics. The README documents resume ingestion into Pinecone. Source excerpts establish the main chat and retrieval relationships; unsampled endpoint details are represented conservatively.

Main entry points: [`frontend-v2/src/App.tsx`](https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/App.tsx) (Portfolio app), [`frontend-v2/src/data/profile.ts`](https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/data/profile.ts) (Profile content), [`frontend-v2/src/components/Console.tsx`](https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/components/Console.tsx) (Chat console), [`rag-backend/app/services/chat_orchestrator.py`](https://github.com/008993368-yaz/genai-portfolio/blob/main/rag-backend/app/services/chat_orchestrator.py) (Chat orchestrator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portfolio["Portfolio experience"]
  node_app["Portfolio app<br/>[App.tsx]"]
  node_profile["Profile content<br/>[profile.ts]"]
  node_context["About context<br/>[Context.tsx]"]
  node_skills["Skill explorer<br/>[EmbeddingSpace.tsx]"]
  node_experience["Experience<br/>[Experience.tsx]"]
  node_results["Projects<br/>[Results.tsx]"]
  node_education["Education<br/>[Education.tsx]"]
  node_contact["Contact<br/>[Contact.tsx]"]
  node_status["Status bar<br/>[StatusBar.tsx]"]
  node_scroll_reveal["Scroll reveals<br/>[useScrollReveal.ts]"]
end

subgraph group_chat_ui["Chat interface"]
  node_console["Chat console<br/>[Console.tsx]"]
  node_chat_hook["Chat state<br/>[useChat.ts]"]
  node_chat_api["Chat API client<br/>[chatApi.ts]"]
  node_sse_parser["SSE parser<br/>[sseParser.ts]"]
  node_typewriter["Typing cycle"]
end

subgraph group_api["Backend API"]
  node_backend["FastAPI endpoints<br/>[main.py]"]
  node_orchestrator["Chat orchestrator"]
end

subgraph group_rag["RAG services"]
  node_guardrails["Topic guardrails<br/>[guardrails.py]"]
  node_memory["Session memory<br/>[memory.py]"]
  node_rag_service["RAG generation<br/>[rag.py]"]
  node_retriever["Resume retrieval<br/>[retriever.py]"]
end

subgraph group_knowledge["Resume knowledge"]
  node_ingestion["Resume ingestion<br/>[ingest_resume.py]"]
  node_pinecone[("Pinecone")]
end

node_visitor(("Visitor"))
node_openai{{"OpenAI"}}

node_visitor -->|"browses"| node_app
node_app -->|"renders"| node_console
node_app -->|"renders"| node_context
node_app -->|"renders"| node_skills
node_app -->|"renders"| node_experience
node_app -->|"renders"| node_results
node_app -->|"renders"| node_education
node_app -->|"renders"| node_contact
node_app -->|"renders"| node_status
node_context -->|"reads content"| node_profile
node_skills -->|"reads content"| node_profile
node_experience -->|"reads content"| node_profile
node_results -->|"reads content"| node_profile
node_education -->|"reads content"| node_profile
node_contact -->|"reads content"| node_profile
node_console -->|"reads content"| node_profile
node_console -->|"uses chat"| node_chat_hook
node_console -->|"uses typing"| node_typewriter
node_context -->|"uses reveal"| node_scroll_reveal
node_chat_hook -->|"sends requests"| node_chat_api
node_chat_api -->|"parses events"| node_sse_parser
node_chat_api -->|"calls chat and suggestions"| node_backend
node_backend -->|"dispatches chat"| node_orchestrator
node_orchestrator -->|"checks topic"| node_guardrails
node_orchestrator -->|"reads and stores"| node_memory
node_orchestrator -->|"generates reply"| node_rag_service
node_rag_service -->|"retrieves context"| node_retriever
node_retriever -->|"queries vectors"| node_pinecone
node_rag_service -->|"generates text"| node_openai
node_ingestion -->|"ingests vectors"| node_pinecone

click node_app "https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/App.tsx"
click node_profile "https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/data/profile.ts"
click node_context "https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/components/Context.tsx"
click node_skills "https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/components/EmbeddingSpace.tsx"
click node_experience "https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/components/Experience.tsx"
click node_results "https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/components/Results.tsx"
click node_education "https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/components/Education.tsx"
click node_contact "https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/components/Contact.tsx"
click node_status "https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/components/StatusBar.tsx"
click node_console "https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/components/Console.tsx"
click node_chat_hook "https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/hooks/useChat.ts"
click node_chat_api "https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/services/chatApi.ts"
click node_sse_parser "https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/services/sseParser.ts"
click node_typewriter "https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/hooks/useTypewriterCycle.ts"
click node_scroll_reveal "https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/hooks/useScrollReveal.ts"
click node_backend "https://github.com/008993368-yaz/genai-portfolio/blob/main/rag-backend/app/main.py"
click node_orchestrator "https://github.com/008993368-yaz/genai-portfolio/blob/main/rag-backend/app/services/chat_orchestrator.py"
click node_guardrails "https://github.com/008993368-yaz/genai-portfolio/blob/main/rag-backend/app/services/guardrails.py"
click node_memory "https://github.com/008993368-yaz/genai-portfolio/blob/main/rag-backend/app/services/memory.py"
click node_rag_service "https://github.com/008993368-yaz/genai-portfolio/blob/main/rag-backend/app/services/rag.py"
click node_retriever "https://github.com/008993368-yaz/genai-portfolio/blob/main/rag-backend/app/services/retriever.py"
click node_ingestion "https://github.com/008993368-yaz/genai-portfolio/blob/main/rag-backend/scripts/ingest_resume.py"

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_app,node_profile,node_context,node_skills,node_experience,node_results,node_education,node_contact,node_status,node_scroll_reveal toneBlue
class node_console,node_chat_hook,node_chat_api,node_sse_parser,node_typewriter toneAmber
class node_backend,node_orchestrator toneMint
class node_guardrails,node_memory,node_rag_service,node_retriever toneRose
class node_ingestion,node_pinecone,node_visitor,node_openai toneIndigo
```

## Components

### Portfolio experience

- [Portfolio app](https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/App.tsx): `frontend-v2/src/App.tsx`
- [Profile content](https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/data/profile.ts): `frontend-v2/src/data/profile.ts`
- [About context](https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/components/Context.tsx): `frontend-v2/src/components/Context.tsx`
- [Skill explorer](https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/components/EmbeddingSpace.tsx): `frontend-v2/src/components/EmbeddingSpace.tsx`
- [Experience](https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/components/Experience.tsx): `frontend-v2/src/components/Experience.tsx`
- [Projects](https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/components/Results.tsx): `frontend-v2/src/components/Results.tsx`
- [Education](https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/components/Education.tsx): `frontend-v2/src/components/Education.tsx`
- [Contact](https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/components/Contact.tsx): `frontend-v2/src/components/Contact.tsx`
- [Status bar](https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/components/StatusBar.tsx): `frontend-v2/src/components/StatusBar.tsx`
- [Scroll reveals](https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/hooks/useScrollReveal.ts): `frontend-v2/src/hooks/useScrollReveal.ts`

### Chat interface

- [Chat console](https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/components/Console.tsx): `frontend-v2/src/components/Console.tsx`
- [Chat state](https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/hooks/useChat.ts): `frontend-v2/src/hooks/useChat.ts`
- [Chat API client](https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/services/chatApi.ts): `frontend-v2/src/services/chatApi.ts`
- [SSE parser](https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/services/sseParser.ts): `frontend-v2/src/services/sseParser.ts`
- [Typing cycle](https://github.com/008993368-yaz/genai-portfolio/blob/main/frontend-v2/src/hooks/useTypewriterCycle.ts): `frontend-v2/src/hooks/useTypewriterCycle.ts`

### Backend API

- [FastAPI endpoints](https://github.com/008993368-yaz/genai-portfolio/blob/main/rag-backend/app/main.py): `rag-backend/app/main.py`
- [Chat orchestrator](https://github.com/008993368-yaz/genai-portfolio/blob/main/rag-backend/app/services/chat_orchestrator.py): `rag-backend/app/services/chat_orchestrator.py`

### RAG services

- [Topic guardrails](https://github.com/008993368-yaz/genai-portfolio/blob/main/rag-backend/app/services/guardrails.py): `rag-backend/app/services/guardrails.py`
- [Session memory](https://github.com/008993368-yaz/genai-portfolio/blob/main/rag-backend/app/services/memory.py): `rag-backend/app/services/memory.py`
- [RAG generation](https://github.com/008993368-yaz/genai-portfolio/blob/main/rag-backend/app/services/rag.py): `rag-backend/app/services/rag.py`
- [Resume retrieval](https://github.com/008993368-yaz/genai-portfolio/blob/main/rag-backend/app/services/retriever.py): `rag-backend/app/services/retriever.py`

### Resume knowledge

- [Resume ingestion](https://github.com/008993368-yaz/genai-portfolio/blob/main/rag-backend/scripts/ingest_resume.py): `rag-backend/scripts/ingest_resume.py`
- **Pinecone**

### Other components

- **Visitor**
- **OpenAI**

## Connections

- Visitor → Portfolio app: browses (evidence: `README.md`)
- Portfolio app → Chat console: renders (evidence: `frontend-v2/src/App.tsx`)
- Portfolio app → About context: renders (evidence: `frontend-v2/src/App.tsx`)
- Portfolio app → Skill explorer: renders (evidence: `frontend-v2/src/App.tsx`)
- Portfolio app → Experience: renders (evidence: `frontend-v2/src/App.tsx`)
- Portfolio app → Projects: renders (evidence: `frontend-v2/src/App.tsx`)
- Portfolio app → Education: renders (evidence: `frontend-v2/src/App.tsx`)
- Portfolio app → Contact: renders (evidence: `frontend-v2/src/App.tsx`)
- Portfolio app → Status bar: renders (evidence: `frontend-v2/src/App.tsx`)
- About context → Profile content: reads content (evidence: `frontend-v2/src/components/Context.tsx`)
- Skill explorer → Profile content: reads content (evidence: `frontend-v2/src/components/EmbeddingSpace.tsx`)
- Experience → Profile content: reads content (evidence: `frontend-v2/src/components/Experience.tsx`)
- Projects → Profile content: reads content (evidence: `frontend-v2/src/components/Results.tsx`)
- Education → Profile content: reads content (evidence: `frontend-v2/src/components/Education.tsx`)
- Contact → Profile content: reads content (evidence: `frontend-v2/src/components/Contact.tsx`)
- Chat console → Profile content: reads content (evidence: `frontend-v2/src/components/Console.tsx`)
- Chat console → Chat state: uses chat (evidence: `frontend-v2/src/components/Console.tsx`)
- Chat console → Typing cycle: uses typing (evidence: `frontend-v2/src/components/Console.tsx`)
- About context → Scroll reveals: uses reveal (evidence: `frontend-v2/src/components/Context.tsx`)
- Chat state → Chat API client: sends requests (evidence: `frontend-v2/src/hooks/useChat.ts`)
- Chat API client → SSE parser: parses events (evidence: `frontend-v2/src/services/chatApi.ts`)
- Chat API client → FastAPI endpoints: calls chat and suggestions (evidence: `README.md`)
- FastAPI endpoints → Chat orchestrator: dispatches chat (evidence: `rag-backend/app/main.py`)
- Chat orchestrator → Topic guardrails: checks topic (evidence: `rag-backend/app/services/chat_orchestrator.py`)
- Chat orchestrator → Session memory: reads and stores (evidence: `rag-backend/app/services/chat_orchestrator.py`)
- Chat orchestrator → RAG generation: generates reply (evidence: `rag-backend/app/services/chat_orchestrator.py`)
- RAG generation → Resume retrieval: retrieves context (evidence: `rag-backend/app/services/rag.py`)
- Resume retrieval → Pinecone: queries vectors (evidence: `rag-backend/app/services/retriever.py`)
- RAG generation → OpenAI: generates text (evidence: `README.md`)
- Resume ingestion → Pinecone: ingests vectors (evidence: `README.md`)
