# f-wafa/portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/f-wafa/portfolio
- Repository: https://github.com/f-wafa/portfolio

## Overview

This is a personal portfolio and publishing site: visitors move from the home page’s profile and work sections to project case studies, a dated Notes log, the CV, and contact links. GitHub-backed repository, activity, language, and contribution data enriches the Work and GitHub displays and powers embeddable SVG cards; hourly caching and fallback snapshots keep those views resilient. The README documents these capabilities, while sampled source confirms the home-page composition, RSS generation, SVG rendering dependencies, and snippet demo behavior. Several route and presentation details are documented but their source was not sampled.

Main entry points: [`src/app/(site)/page.tsx`](https://github.com/f-wafa/portfolio/blob/main/src/app/(site)/page.tsx) (Home Page), [`src/lib/github.ts`](https://github.com/f-wafa/portfolio/blob/main/src/lib/github.ts) (GitHub Data Service), [`src/components/projects/project-row.tsx`](https://github.com/f-wafa/portfolio/blob/main/src/components/projects/project-row.tsx) (Project Rows), [`src/lib/readme-svg.ts`](https://github.com/f-wafa/portfolio/blob/main/src/lib/readme-svg.ts) (SVG Renderer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Portfolio Site"]
  node_home["Home Page<br/>[page.tsx]"]
  node_hero["Hero Scene<br/>[hero-scene.tsx]"]
  node_about["About Section<br/>[about-section.tsx]"]
  node_now["Now Strip<br/>[now-strip.tsx]"]
  node_contact["Contact Section"]
  node_contactform["Contact Form<br/>[contact-form.tsx]"]
  node_cv["Printable CV<br/>[page.tsx]"]
  node_links["Links Page<br/>[page.tsx]"]
end

subgraph group_publishing["Work and Notes"]
  node_work["Work Section"]
  node_projects["Project Rows<br/>[project-row.tsx]"]
  node_casepages["Case Studies<br/>[page.tsx]"]
  node_casecontent["Case Study Content<br/>[case-studies.ts]"]
  node_snippet["Snippet Demo<br/>[snippet-demo.tsx]"]
  node_snippetlogic["Snippet Builder<br/>[snippet.ts]"]
  node_notesindex["Notes Index<br/>[page.tsx]"]
  node_notepage["Note Pages<br/>[page.tsx]"]
  node_notesdata["Notes Content<br/>[notes.ts]"]
  node_rss["RSS Feed<br/>[route.ts]"]
end

subgraph group_github["GitHub Insights"]
  node_githubsection["GitHub Section<br/>[github-section.tsx]"]
  node_githubdata["GitHub Data Service<br/>[github.ts]"]
  node_githubapi(("GitHub Services"))
  node_statscards["README SVG Routes<br/>[route.ts]"]
  node_languagecard["Language Card Route<br/>[route.ts]"]
  node_streakcard["Streak Card Route<br/>[route.ts]"]
  node_svgrender["SVG Renderer<br/>[readme-svg.ts]"]
end

subgraph group_shared["Shared Content and UI"]
  node_profile["Profile Content<br/>[profile.ts]"]
  node_projectcontent["Project Metadata<br/>[projects.ts]"]
  node_blocks["Shared Content Blocks<br/>[blocks.ts]"]
  node_prose["Prose Renderer<br/>[prose-blocks.tsx]"]
  node_toolcontent["Tool Index<br/>[tool-index.ts]"]
  node_languagecalc["Language Slices<br/>[language-slices.ts]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_home
node_visitor -->|"opens"| node_cv
node_visitor -->|"opens"| node_links
node_home -->|"renders"| node_hero
node_home -->|"renders"| node_about
node_home -->|"renders"| node_now
node_home -->|"renders"| node_work
node_home -->|"renders"| node_githubsection
node_home -->|"renders"| node_contact
node_about -->|"reads"| node_profile
node_contact -->|"renders"| node_contactform
node_contact -->|"reads"| node_profile
node_links -->|"reads"| node_profile
node_home -->|"links to"| node_cv
node_work -->|"renders"| node_projects
node_projects -->|"reads"| node_projectcontent
node_projects -->|"loads repository data"| node_githubdata
node_projects -->|"matches studies"| node_casecontent
node_visitor -->|"opens"| node_casepages
node_casepages -->|"reads"| node_casecontent
node_casepages -->|"renders"| node_prose
node_prose -->|"renders blocks"| node_blocks
node_snippet -->|"builds snippet"| node_snippetlogic
node_visitor -->|"opens"| node_notesindex
node_notesindex -->|"reads"| node_notesdata
node_notesindex -->|"links to"| node_notepage
node_notepage -->|"reads"| node_notesdata
node_notepage -->|"renders"| node_prose
node_rss -->|"reads"| node_notesdata
node_githubsection -->|"loads cached data"| node_githubdata
node_githubdata -->|"requests"| node_githubapi
node_statscards -->|"loads cached data"| node_githubdata
node_languagecard -->|"loads cached data"| node_githubdata
node_streakcard -->|"loads cached data"| node_githubdata
node_statscards -->|"renders card"| node_svgrender
node_languagecard -->|"renders card"| node_svgrender
node_streakcard -->|"renders card"| node_svgrender
node_svgrender -->|"groups languages"| node_languagecalc
node_githubsection -.->|"shows tools"| node_toolcontent

click node_home "https://github.com/f-wafa/portfolio/blob/main/src/app/(site)/page.tsx"
click node_hero "https://github.com/f-wafa/portfolio/blob/main/src/components/hero/hero-scene.tsx"
click node_about "https://github.com/f-wafa/portfolio/blob/main/src/components/about-section.tsx"
click node_now "https://github.com/f-wafa/portfolio/blob/main/src/components/now-strip.tsx"
click node_contact "https://github.com/f-wafa/portfolio/blob/main/src/components/contact-section.tsx"
click node_contactform "https://github.com/f-wafa/portfolio/blob/main/src/components/contact-form.tsx"
click node_cv "https://github.com/f-wafa/portfolio/blob/main/src/app/cv/page.tsx"
click node_links "https://github.com/f-wafa/portfolio/blob/main/src/app/links/page.tsx"
click node_work "https://github.com/f-wafa/portfolio/blob/main/src/components/projects/projects-section.tsx"
click node_projects "https://github.com/f-wafa/portfolio/blob/main/src/components/projects/project-row.tsx"
click node_casepages "https://github.com/f-wafa/portfolio/blob/main/src/app/(site)/work/%5Bslug%5D/page.tsx"
click node_casecontent "https://github.com/f-wafa/portfolio/blob/main/src/content/case-studies.ts"
click node_snippet "https://github.com/f-wafa/portfolio/blob/main/src/components/projects/snippet-demo.tsx"
click node_snippetlogic "https://github.com/f-wafa/portfolio/blob/main/src/lib/snippet.ts"
click node_notesindex "https://github.com/f-wafa/portfolio/blob/main/src/app/(site)/notes/page.tsx"
click node_notepage "https://github.com/f-wafa/portfolio/blob/main/src/app/(site)/notes/%5Bslug%5D/page.tsx"
click node_notesdata "https://github.com/f-wafa/portfolio/blob/main/src/content/notes.ts"
click node_rss "https://github.com/f-wafa/portfolio/blob/main/src/app/notes/rss.xml/route.ts"
click node_githubsection "https://github.com/f-wafa/portfolio/blob/main/src/components/github-section.tsx"
click node_githubdata "https://github.com/f-wafa/portfolio/blob/main/src/lib/github.ts"
click node_statscards "https://github.com/f-wafa/portfolio/blob/main/src/app/readme/stats.svg/route.ts"
click node_languagecard "https://github.com/f-wafa/portfolio/blob/main/src/app/readme/languages.svg/route.ts"
click node_streakcard "https://github.com/f-wafa/portfolio/blob/main/src/app/readme/streak.svg/route.ts"
click node_svgrender "https://github.com/f-wafa/portfolio/blob/main/src/lib/readme-svg.ts"
click node_profile "https://github.com/f-wafa/portfolio/blob/main/src/content/profile.ts"
click node_projectcontent "https://github.com/f-wafa/portfolio/blob/main/src/content/projects.ts"
click node_blocks "https://github.com/f-wafa/portfolio/blob/main/src/content/blocks.ts"
click node_prose "https://github.com/f-wafa/portfolio/blob/main/src/components/prose-blocks.tsx"
click node_toolcontent "https://github.com/f-wafa/portfolio/blob/main/src/content/tool-index.ts"
click node_languagecalc "https://github.com/f-wafa/portfolio/blob/main/src/lib/language-slices.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_about,node_now,node_contact,node_contactform,node_cv,node_links toneBlue
class node_work,node_projects,node_casepages,node_casecontent,node_snippet,node_snippetlogic,node_notesindex,node_notepage,node_notesdata,node_rss toneAmber
class node_githubsection,node_githubdata,node_githubapi,node_statscards,node_languagecard,node_streakcard,node_svgrender toneMint
class node_profile,node_projectcontent,node_blocks,node_prose,node_toolcontent,node_languagecalc toneRose
class node_visitor toneIndigo
```

## Components

### Portfolio Site

- [Home Page](https://github.com/f-wafa/portfolio/blob/main/src/app/(site)/page.tsx): `src/app/(site)/page.tsx`
- [Hero Scene](https://github.com/f-wafa/portfolio/blob/main/src/components/hero/hero-scene.tsx): `src/components/hero/hero-scene.tsx`
- [About Section](https://github.com/f-wafa/portfolio/blob/main/src/components/about-section.tsx): `src/components/about-section.tsx`
- [Now Strip](https://github.com/f-wafa/portfolio/blob/main/src/components/now-strip.tsx): `src/components/now-strip.tsx`
- [Contact Section](https://github.com/f-wafa/portfolio/blob/main/src/components/contact-section.tsx): `src/components/contact-section.tsx`
- [Contact Form](https://github.com/f-wafa/portfolio/blob/main/src/components/contact-form.tsx): `src/components/contact-form.tsx`
- [Printable CV](https://github.com/f-wafa/portfolio/blob/main/src/app/cv/page.tsx): `src/app/cv/page.tsx`
- [Links Page](https://github.com/f-wafa/portfolio/blob/main/src/app/links/page.tsx): `src/app/links/page.tsx`

### Work and Notes

- [Work Section](https://github.com/f-wafa/portfolio/blob/main/src/components/projects/projects-section.tsx): `src/components/projects/projects-section.tsx`
- [Project Rows](https://github.com/f-wafa/portfolio/blob/main/src/components/projects/project-row.tsx): `src/components/projects/project-row.tsx`
- [Case Studies](https://github.com/f-wafa/portfolio/blob/main/src/app/(site)/work/%5Bslug%5D/page.tsx): `src/app/(site)/work/[slug]/page.tsx`
- [Case Study Content](https://github.com/f-wafa/portfolio/blob/main/src/content/case-studies.ts): `src/content/case-studies.ts`
- [Snippet Demo](https://github.com/f-wafa/portfolio/blob/main/src/components/projects/snippet-demo.tsx): `src/components/projects/snippet-demo.tsx`
- [Snippet Builder](https://github.com/f-wafa/portfolio/blob/main/src/lib/snippet.ts): `src/lib/snippet.ts`
- [Notes Index](https://github.com/f-wafa/portfolio/blob/main/src/app/(site)/notes/page.tsx): `src/app/(site)/notes/page.tsx`
- [Note Pages](https://github.com/f-wafa/portfolio/blob/main/src/app/(site)/notes/%5Bslug%5D/page.tsx): `src/app/(site)/notes/[slug]/page.tsx`
- [Notes Content](https://github.com/f-wafa/portfolio/blob/main/src/content/notes.ts): `src/content/notes.ts`
- [RSS Feed](https://github.com/f-wafa/portfolio/blob/main/src/app/notes/rss.xml/route.ts): `src/app/notes/rss.xml/route.ts`

### GitHub Insights

- [GitHub Section](https://github.com/f-wafa/portfolio/blob/main/src/components/github-section.tsx): `src/components/github-section.tsx`
- [GitHub Data Service](https://github.com/f-wafa/portfolio/blob/main/src/lib/github.ts): `src/lib/github.ts`
- **GitHub Services**
- [README SVG Routes](https://github.com/f-wafa/portfolio/blob/main/src/app/readme/stats.svg/route.ts): `src/app/readme/stats.svg/route.ts`
- [Language Card Route](https://github.com/f-wafa/portfolio/blob/main/src/app/readme/languages.svg/route.ts): `src/app/readme/languages.svg/route.ts`
- [Streak Card Route](https://github.com/f-wafa/portfolio/blob/main/src/app/readme/streak.svg/route.ts): `src/app/readme/streak.svg/route.ts`
- [SVG Renderer](https://github.com/f-wafa/portfolio/blob/main/src/lib/readme-svg.ts): `src/lib/readme-svg.ts`

### Shared Content and UI

- [Profile Content](https://github.com/f-wafa/portfolio/blob/main/src/content/profile.ts): `src/content/profile.ts`
- [Project Metadata](https://github.com/f-wafa/portfolio/blob/main/src/content/projects.ts): `src/content/projects.ts`
- [Shared Content Blocks](https://github.com/f-wafa/portfolio/blob/main/src/content/blocks.ts): `src/content/blocks.ts`
- [Prose Renderer](https://github.com/f-wafa/portfolio/blob/main/src/components/prose-blocks.tsx): `src/components/prose-blocks.tsx`
- [Tool Index](https://github.com/f-wafa/portfolio/blob/main/src/content/tool-index.ts): `src/content/tool-index.ts`
- [Language Slices](https://github.com/f-wafa/portfolio/blob/main/src/lib/language-slices.ts): `src/lib/language-slices.ts`

### Other components

- **Visitor**

## Connections

- Visitor → Home Page: opens (evidence: `README.md`)
- Visitor → Printable CV: opens (evidence: `README.md`)
- Visitor → Links Page: opens (evidence: `README.md`)
- Home Page → Hero Scene: renders (evidence: `src/app/(site)/page.tsx`)
- Home Page → About Section: renders (evidence: `src/app/(site)/page.tsx`)
- Home Page → Now Strip: renders (evidence: `src/app/(site)/page.tsx`)
- Home Page → Work Section: renders (evidence: `src/app/(site)/page.tsx`)
- Home Page → GitHub Section: renders (evidence: `src/app/(site)/page.tsx`)
- Home Page → Contact Section: renders (evidence: `src/app/(site)/page.tsx`)
- About Section → Profile Content: reads (evidence: `src/components/about-section.tsx`)
- Contact Section → Contact Form: renders (evidence: `src/components/contact-section.tsx`)
- Contact Section → Profile Content: reads (evidence: `src/components/contact-section.tsx`)
- Links Page → Profile Content: reads (evidence: `src/app/links/page.tsx`)
- Home Page → Printable CV: links to (evidence: `README.md`)
- Work Section → Project Rows: renders (evidence: `README.md`)
- Project Rows → Project Metadata: reads (evidence: `src/components/projects/project-row.tsx`)
- Project Rows → GitHub Data Service: loads repository data (evidence: `README.md`)
- Project Rows → Case Study Content: matches studies (evidence: `src/components/projects/project-row.tsx`)
- Visitor → Case Studies: opens (evidence: `README.md`)
- Case Studies → Case Study Content: reads (evidence: `src/app/(site)/work/[slug]/page.tsx`)
- Case Studies → Prose Renderer: renders (evidence: `src/app/(site)/work/[slug]/page.tsx`)
- Prose Renderer → Shared Content Blocks: renders blocks (evidence: `src/components/prose-blocks.tsx`)
- Snippet Demo → Snippet Builder: builds snippet (evidence: `src/components/projects/snippet-demo.tsx`)
- Visitor → Notes Index: opens (evidence: `README.md`)
- Notes Index → Notes Content: reads (evidence: `src/app/(site)/notes/page.tsx`)
- Notes Index → Note Pages: links to (evidence: `README.md`)
- Note Pages → Notes Content: reads (evidence: `src/app/(site)/notes/[slug]/page.tsx`)
- Note Pages → Prose Renderer: renders (evidence: `src/app/(site)/notes/[slug]/page.tsx`)
- RSS Feed → Notes Content: reads (evidence: `src/app/notes/rss.xml/route.ts`)
- GitHub Section → GitHub Data Service: loads cached data (evidence: `README.md`)
- GitHub Data Service → GitHub Services: requests (evidence: `src/lib/github.ts`)
- README SVG Routes → GitHub Data Service: loads cached data (evidence: `src/app/readme/stats.svg/route.ts`)
- Language Card Route → GitHub Data Service: loads cached data (evidence: `src/app/readme/languages.svg/route.ts`)
- Streak Card Route → GitHub Data Service: loads cached data (evidence: `src/app/readme/streak.svg/route.ts`)
- README SVG Routes → SVG Renderer: renders card (evidence: `src/app/readme/stats.svg/route.ts`)
- Language Card Route → SVG Renderer: renders card (evidence: `src/app/readme/languages.svg/route.ts`)
- Streak Card Route → SVG Renderer: renders card (evidence: `src/app/readme/streak.svg/route.ts`)
- SVG Renderer → Language Slices: groups languages (evidence: `src/lib/readme-svg.ts`)
- GitHub Section → Tool Index: shows tools
