# soyeb-jim285/portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/soyeb-jim285/portfolio
- Repository: https://github.com/soyeb-jim285/portfolio

## Overview

This is a portfolio site with a separate API for its visitor-facing assistant. The main journey is a visitor asking a question in the assistant panel, receiving a streamed answer with tool activity and citations, and optionally navigating the portfolio, drafting contact, downloading an artifact, or arranging a calendar slot. The API also supports a repository-code index and optional generative UI. The README documents several capabilities whose implementation was not sampled; those links are shown only where documentation supports them.

Main entry points: [`server/src/app.ts`](https://github.com/soyeb-jim285/portfolio/blob/main/server/src/app.ts) (Hono API routes), [`server/src/app/chat-turn.ts`](https://github.com/soyeb-jim285/portfolio/blob/main/server/src/app/chat-turn.ts) (Chat turn orchestration), [`src/lib/chat-stream.ts`](https://github.com/soyeb-jim285/portfolio/blob/main/src/lib/chat-stream.ts) (Chat stream client), [`src/components/chat/ChatPanel.tsx`](https://github.com/soyeb-jim285/portfolio/blob/main/src/components/chat/ChatPanel.tsx) (Assistant panel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Portfolio site"]
  node_portfolio_data["Portfolio content<br/>[content.ts]"]
  node_projects["Projects and research<br/>[projects.ts]"]
  node_site_targets["Navigation targets<br/>[site-map.ts]"]
end

subgraph group_client["Assistant interface"]
  node_assistant_panel["Assistant panel<br/>[ChatPanel.tsx]"]
  node_panel_hooks["Panel session state<br/>[panel-hooks.ts]"]
  node_panel_ask["Ask and actions<br/>[panel-ask.ts]"]
  node_chat_stream["Chat stream client<br/>[chat-stream.ts]"]
  node_site_actions["Site navigation actions<br/>[site-actions.ts]"]
  node_message_render["Answer rendering<br/>[message.tsx]"]
end

subgraph group_api["Assistant API"]
  node_api["Hono API routes<br/>[app.ts]"]
  node_deps["Shared API dependencies<br/>[deps.ts]"]
  node_chat_turn["Chat turn orchestration<br/>[chat-turn.ts]"]
  node_chat_step["Tool-step execution<br/>[chat-step.ts]"]
  node_tools["Assistant tools<br/>[tools.ts]"]
  node_gen_ui["Generative UI<br/>[gen-ui.ts]"]
  node_transcription["Voice transcription<br/>[transcribe.ts]"]
end

subgraph group_knowledge["Code knowledge"]
  node_repo_index["Repository indexing<br/>[index-run.ts]"]
  node_retrieval["Code retrieval<br/>[retrieval.ts]"]
  node_embeddings["Embedding provider<br/>[embeddings.ts]"]
end

subgraph group_services["State and integrations"]
  node_database[("PostgreSQL<br/>[db.ts]")]
  node_scheduler["Calendar scheduler<br/>[scheduler.ts]"]
  node_mailer["Contact mailer<br/>[mailer.ts]"]
  node_artifact_storage["Artifact storage<br/>[storage.ts]"]
end

node_visitor(("Visitor"))
node_openrouter{{"OpenRouter"}}
node_calcom{{"Cal.com"}}
node_r2[("S3-compatible R2")]

node_visitor -->|"asks"| node_assistant_panel
node_assistant_panel -->|"uses state"| node_panel_hooks
node_panel_hooks -->|"starts session"| node_chat_stream
node_assistant_panel -->|"submits question"| node_panel_ask
node_panel_ask -->|"streams answer"| node_chat_stream
node_chat_stream -->|"sends requests"| node_api
node_api -->|"routes chat"| node_chat_turn
node_api -->|"builds dependencies"| node_deps
node_chat_turn -->|"runs tool steps"| node_chat_step
node_chat_step -->|"searches code"| node_retrieval
node_chat_step -->|"dispatches tools"| node_tools
node_chat_turn -.->|"composes UI"| node_gen_ui
node_chat_turn -.->|"streams model answer"| node_openrouter
node_chat_stream -.->|"renders response"| node_message_render
node_panel_ask -->|"runs navigation"| node_site_actions
node_site_actions -->|"looks up target"| node_site_targets
node_visitor -->|"views portfolio"| node_portfolio_data
node_portfolio_data -->|"exports projects"| node_projects
node_api -->|"routes transcription"| node_transcription
node_repo_index -->|"embeds windows"| node_embeddings
node_retrieval -->|"embeds queries"| node_embeddings
node_retrieval -.->|"queries index"| node_database
node_repo_index -->|"promotes index"| node_database
node_api -.->|"stores sessions and answers"| node_database
node_scheduler -.->|"reads availability"| node_calcom
node_api -->|"handles bookings"| node_scheduler
node_api -->|"handles contact"| node_mailer
node_api -->|"issues signed links"| node_artifact_storage
node_artifact_storage -->|"stores objects"| node_r2

click node_portfolio_data "https://github.com/soyeb-jim285/portfolio/blob/main/src/data/content.ts"
click node_projects "https://github.com/soyeb-jim285/portfolio/blob/main/src/data/projects.ts"
click node_site_targets "https://github.com/soyeb-jim285/portfolio/blob/main/src/data/site-map.ts"
click node_assistant_panel "https://github.com/soyeb-jim285/portfolio/blob/main/src/components/chat/ChatPanel.tsx"
click node_panel_hooks "https://github.com/soyeb-jim285/portfolio/blob/main/src/components/chat/panel-hooks.ts"
click node_panel_ask "https://github.com/soyeb-jim285/portfolio/blob/main/src/components/chat/panel-ask.ts"
click node_chat_stream "https://github.com/soyeb-jim285/portfolio/blob/main/src/lib/chat-stream.ts"
click node_site_actions "https://github.com/soyeb-jim285/portfolio/blob/main/src/lib/site-actions.ts"
click node_message_render "https://github.com/soyeb-jim285/portfolio/blob/main/src/components/ai-elements/message.tsx"
click node_api "https://github.com/soyeb-jim285/portfolio/blob/main/server/src/app.ts"
click node_deps "https://github.com/soyeb-jim285/portfolio/blob/main/server/src/app/deps.ts"
click node_chat_turn "https://github.com/soyeb-jim285/portfolio/blob/main/server/src/app/chat-turn.ts"
click node_chat_step "https://github.com/soyeb-jim285/portfolio/blob/main/server/src/app/chat-step.ts"
click node_tools "https://github.com/soyeb-jim285/portfolio/blob/main/server/src/tools.ts"
click node_gen_ui "https://github.com/soyeb-jim285/portfolio/blob/main/server/src/gen-ui.ts"
click node_transcription "https://github.com/soyeb-jim285/portfolio/blob/main/server/src/app/transcribe.ts"
click node_repo_index "https://github.com/soyeb-jim285/portfolio/blob/main/server/src/index-run.ts"
click node_retrieval "https://github.com/soyeb-jim285/portfolio/blob/main/server/src/retrieval.ts"
click node_embeddings "https://github.com/soyeb-jim285/portfolio/blob/main/server/src/embeddings.ts"
click node_database "https://github.com/soyeb-jim285/portfolio/blob/main/server/src/db.ts"
click node_scheduler "https://github.com/soyeb-jim285/portfolio/blob/main/server/src/scheduler.ts"
click node_mailer "https://github.com/soyeb-jim285/portfolio/blob/main/server/src/mailer.ts"
click node_artifact_storage "https://github.com/soyeb-jim285/portfolio/blob/main/server/src/storage.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_portfolio_data,node_projects,node_site_targets toneBlue
class node_assistant_panel,node_panel_hooks,node_panel_ask,node_chat_stream,node_site_actions,node_message_render,node_r2 toneAmber
class node_api,node_deps,node_chat_turn,node_chat_step,node_tools,node_gen_ui,node_transcription,node_openrouter toneMint
class node_repo_index,node_retrieval,node_embeddings toneRose
class node_database,node_scheduler,node_mailer,node_artifact_storage,node_visitor,node_calcom toneIndigo
```

## Components

### Portfolio site

- [Portfolio content](https://github.com/soyeb-jim285/portfolio/blob/main/src/data/content.ts): `src/data/content.ts`
- [Projects and research](https://github.com/soyeb-jim285/portfolio/blob/main/src/data/projects.ts): `src/data/projects.ts`
- [Navigation targets](https://github.com/soyeb-jim285/portfolio/blob/main/src/data/site-map.ts): `src/data/site-map.ts`

### Assistant interface

- [Assistant panel](https://github.com/soyeb-jim285/portfolio/blob/main/src/components/chat/ChatPanel.tsx): `src/components/chat/ChatPanel.tsx`
- [Panel session state](https://github.com/soyeb-jim285/portfolio/blob/main/src/components/chat/panel-hooks.ts): `src/components/chat/panel-hooks.ts`
- [Ask and actions](https://github.com/soyeb-jim285/portfolio/blob/main/src/components/chat/panel-ask.ts): `src/components/chat/panel-ask.ts`
- [Chat stream client](https://github.com/soyeb-jim285/portfolio/blob/main/src/lib/chat-stream.ts): `src/lib/chat-stream.ts`
- [Site navigation actions](https://github.com/soyeb-jim285/portfolio/blob/main/src/lib/site-actions.ts): `src/lib/site-actions.ts`
- [Answer rendering](https://github.com/soyeb-jim285/portfolio/blob/main/src/components/ai-elements/message.tsx): `src/components/ai-elements/message.tsx`

### Assistant API

- [Hono API routes](https://github.com/soyeb-jim285/portfolio/blob/main/server/src/app.ts): `server/src/app.ts`
- [Shared API dependencies](https://github.com/soyeb-jim285/portfolio/blob/main/server/src/app/deps.ts): `server/src/app/deps.ts`
- [Chat turn orchestration](https://github.com/soyeb-jim285/portfolio/blob/main/server/src/app/chat-turn.ts): `server/src/app/chat-turn.ts`
- [Tool-step execution](https://github.com/soyeb-jim285/portfolio/blob/main/server/src/app/chat-step.ts): `server/src/app/chat-step.ts`
- [Assistant tools](https://github.com/soyeb-jim285/portfolio/blob/main/server/src/tools.ts): `server/src/tools.ts`
- [Generative UI](https://github.com/soyeb-jim285/portfolio/blob/main/server/src/gen-ui.ts): `server/src/gen-ui.ts`
- [Voice transcription](https://github.com/soyeb-jim285/portfolio/blob/main/server/src/app/transcribe.ts): `server/src/app/transcribe.ts`

### Code knowledge

- [Repository indexing](https://github.com/soyeb-jim285/portfolio/blob/main/server/src/index-run.ts): `server/src/index-run.ts`
- [Code retrieval](https://github.com/soyeb-jim285/portfolio/blob/main/server/src/retrieval.ts): `server/src/retrieval.ts`
- [Embedding provider](https://github.com/soyeb-jim285/portfolio/blob/main/server/src/embeddings.ts): `server/src/embeddings.ts`

### State and integrations

- [PostgreSQL](https://github.com/soyeb-jim285/portfolio/blob/main/server/src/db.ts): `server/src/db.ts`
- [Calendar scheduler](https://github.com/soyeb-jim285/portfolio/blob/main/server/src/scheduler.ts): `server/src/scheduler.ts`
- [Contact mailer](https://github.com/soyeb-jim285/portfolio/blob/main/server/src/mailer.ts): `server/src/mailer.ts`
- [Artifact storage](https://github.com/soyeb-jim285/portfolio/blob/main/server/src/storage.ts): `server/src/storage.ts`

### Other components

- **Visitor**
- **OpenRouter**
- **Cal.com**
- **S3-compatible R2**

## Connections

- Visitor → Assistant panel: asks
- Assistant panel → Panel session state: uses state (evidence: `src/components/chat/panel-hooks.ts`)
- Panel session state → Chat stream client: starts session (evidence: `src/components/chat/panel-hooks.ts`)
- Assistant panel → Ask and actions: submits question
- Ask and actions → Chat stream client: streams answer (evidence: `src/components/chat/panel-ask.ts`)
- Chat stream client → Hono API routes: sends requests
- Hono API routes → Chat turn orchestration: routes chat (evidence: `server/src/app.ts`)
- Hono API routes → Shared API dependencies: builds dependencies (evidence: `server/src/app/deps.ts`)
- Chat turn orchestration → Tool-step execution: runs tool steps (evidence: `server/src/app/chat-turn.ts`)
- Tool-step execution → Code retrieval: searches code (evidence: `server/src/app/chat-step.ts`)
- Tool-step execution → Assistant tools: dispatches tools (evidence: `server/src/app/chat-step.ts`)
- Chat turn orchestration → Generative UI: composes UI
- Chat turn orchestration → OpenRouter: streams model answer
- Chat stream client → Answer rendering: renders response
- Ask and actions → Site navigation actions: runs navigation (evidence: `src/components/chat/panel-ask.ts`)
- Site navigation actions → Navigation targets: looks up target (evidence: `src/lib/site-actions.ts`)
- Visitor → Portfolio content: views portfolio
- Portfolio content → Projects and research: exports projects (evidence: `src/data/content.ts`)
- Hono API routes → Voice transcription: routes transcription (evidence: `server/src/app.ts`)
- Repository indexing → Embedding provider: embeds windows
- Code retrieval → Embedding provider: embeds queries (evidence: `server/src/retrieval.ts`)
- Code retrieval → PostgreSQL: queries index
- Repository indexing → PostgreSQL: promotes index
- Hono API routes → PostgreSQL: stores sessions and answers (evidence: `server/src/app.ts`)
- Calendar scheduler → Cal.com: reads availability
- Hono API routes → Calendar scheduler: handles bookings (evidence: `server/src/app.ts`)
- Hono API routes → Contact mailer: handles contact (evidence: `server/src/app.ts`)
- Hono API routes → Artifact storage: issues signed links (evidence: `server/src/app.ts`)
- Artifact storage → S3-compatible R2: stores objects (evidence: `server/src/storage.ts`)
