# madrimovdev/portfolio-next architecture

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

- Interactive diagram: https://gitdiagram.com/madrimovdev/portfolio-next
- Repository: https://github.com/madrimovdev/portfolio-next

## Overview

This is a multilingual personal portfolio and publishing site. Visitors browse localized profile, work, skills, experience and project pages, then read Notion-backed articles and case studies; blog readers can view engagement metrics and comments. The site also exposes RSS feeds and post-interaction APIs. Edges below follow shown imports, calls or documented behavior; unsampled routes and components are represented at their exact paths, with no inferred internal calls beyond the available evidence.

Main entry points: [`src/app/[lang]/page.tsx`](https://github.com/madrimovdev/portfolio-next/blob/prod/src/app/%5Blang%5D/page.tsx) (Localized home), [`src/app/[lang]/blog/[slug]/page.tsx`](https://github.com/madrimovdev/portfolio-next/blob/prod/src/app/%5Blang%5D/blog/%5Bslug%5D/page.tsx) (Blog article), [`src/lib/supabase.ts`](https://github.com/madrimovdev/portfolio-next/blob/prod/src/lib/supabase.ts) (Supabase data access), [`src/lib/notion.ts`](https://github.com/madrimovdev/portfolio-next/blob/prod/src/lib/notion.ts) (Notion content client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Portfolio site"]
  node_home["Localized home<br/>[page.tsx]"]
  node_profile["Profile sections<br/>[header.tsx]"]
  node_work["Work and skills<br/>[my-work.tsx]"]
  node_experience["Experience<br/>[experience.tsx]"]
  node_portfolio["Project portfolio<br/>[portfolio.tsx]"]
  node_project_card["Project card<br/>[portfolio-card.tsx]"]
  node_case_studies["Case studies"]
end

subgraph group_publishing["Publishing"]
  node_blog_list["Blog listing<br/>[page.tsx]"]
  node_blog_post["Blog article<br/>[page.tsx]"]
  node_post_render["Notion rendering<br/>[notion-render.tsx]"]
  node_rss["Localized RSS<br/>[route.ts]"]
  node_rss_redirect["RSS redirect<br/>[route.ts]"]
  node_related_posts["Related posts<br/>[related-posts.tsx]"]
  node_latest_posts["Latest posts<br/>[latest-posts.tsx]"]
end

subgraph group_engagement["Reader engagement"]
  node_interactions["Interaction provider"]
  node_comments_ui["Comment thread UI<br/>[comments.tsx]"]
  node_comments_thread["Comment thread<br/>[comment-thread.tsx]"]
  node_api_comments["Comment endpoint<br/>[route.ts]"]
  node_api_alias["Alias endpoint<br/>[route.ts]"]
  node_api_stats["Stats endpoint<br/>[route.ts]"]
  node_api_views["View endpoint<br/>[route.ts]"]
  node_api_claps["Clap endpoint<br/>[route.ts]"]
  node_clap_button["Clap button<br/>[clap-button.tsx]"]
end

subgraph group_services["Content and services"]
  node_notion["Notion content client<br/>[notion.ts]"]
  node_supabase["Supabase data access<br/>[supabase.ts]"]
  node_database[("Supabase database")]
end

subgraph group_shared["Shared presentation"]
  node_dictionary["Locale dictionary<br/>[index.ts]"]
  node_seo["SEO utilities<br/>[seo.ts]"]
  node_jsonld["Structured data<br/>[json-ld.tsx]"]
  node_navbar["Navigation<br/>[navbar.tsx]"]
  node_menu_items["Menu definitions<br/>[menu-items.ts]"]
end

node_visitor(("Visitor"))
node_notion_api{{"Notion API"}}
node_telegram["Telegram notifier<br/>[telegram.ts]"]

node_visitor -->|"opens"| node_home
node_home -->|"renders"| node_profile
node_home -->|"renders"| node_work
node_home -->|"renders"| node_experience
node_home -->|"renders"| node_portfolio
node_portfolio -->|"renders"| node_project_card
node_home -->|"loads locale"| node_dictionary
node_home -->|"renders"| node_jsonld
node_home -->|"builds metadata"| node_seo
node_visitor -->|"opens"| node_blog_list
node_blog_list -->|"loads posts"| node_notion
node_visitor -->|"opens"| node_blog_post
node_blog_post -->|"loads article"| node_notion
node_blog_post -->|"renders blocks"| node_post_render
node_blog_post -->|"renders"| node_related_posts
node_home -->|"renders"| node_latest_posts
node_blog_list -->|"loads locale"| node_dictionary
node_blog_post -->|"loads locale"| node_dictionary
node_related_posts -->|"loads posts"| node_notion
node_latest_posts -->|"loads posts"| node_notion
node_notion -->|"queries content"| node_notion_api
node_visitor -->|"requests feed"| node_rss_redirect
node_rss_redirect -->|"redirects"| node_rss
node_rss -->|"loads published posts"| node_notion
node_blog_post -->|"renders"| node_interactions
node_blog_post -->|"renders"| node_comments_ui
node_comments_ui -->|"renders"| node_comments_thread
node_interactions -->|"requests views"| node_api_views
node_interactions -->|"requests stats"| node_api_stats
node_interactions -->|"sends claps"| node_api_claps
node_clap_button -->|"uses context"| node_interactions
node_comments_ui -->|"loads comments"| node_supabase
node_api_comments -->|"reads and writes"| node_supabase
node_api_comments -->|"notifies"| node_telegram
node_api_comments -->|"calls aliasFor"| node_api_alias
node_api_alias -->|"hashes client IP"| node_supabase
node_api_stats -->|"reads stats"| node_supabase
node_api_views -->|"increments views"| node_supabase
node_api_claps -->|"adds claps"| node_supabase
node_supabase -->|"calls RPC"| node_database
node_visitor -.->|"browses"| node_case_studies
node_profile -->|"loads locale"| node_dictionary
node_navbar -->|"uses definitions"| node_menu_items
node_dictionary -->|"types menu"| node_menu_items

click node_home "https://github.com/madrimovdev/portfolio-next/blob/prod/src/app/%5Blang%5D/page.tsx"
click node_profile "https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/header/header.tsx"
click node_work "https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/my-work/my-work.tsx"
click node_experience "https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/experience/experience.tsx"
click node_portfolio "https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/portfolio/portfolio.tsx"
click node_project_card "https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/portfolio/portfolio-card.tsx"
click node_case_studies "https://github.com/madrimovdev/portfolio-next/tree/prod/src/app/%5Blang%5D/case-studies"
click node_blog_list "https://github.com/madrimovdev/portfolio-next/blob/prod/src/app/%5Blang%5D/blog/page.tsx"
click node_blog_post "https://github.com/madrimovdev/portfolio-next/blob/prod/src/app/%5Blang%5D/blog/%5Bslug%5D/page.tsx"
click node_post_render "https://github.com/madrimovdev/portfolio-next/blob/prod/src/lib/notion-render.tsx"
click node_rss "https://github.com/madrimovdev/portfolio-next/blob/prod/src/app/%5Blang%5D/rss.xml/route.ts"
click node_rss_redirect "https://github.com/madrimovdev/portfolio-next/blob/prod/src/app/rss.xml/route.ts"
click node_interactions "https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/post-interactions/post-interactions-provider.tsx"
click node_comments_ui "https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/comments/comments.tsx"
click node_comments_thread "https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/comments/comment-thread.tsx"
click node_api_comments "https://github.com/madrimovdev/portfolio-next/blob/prod/src/app/api/posts/%5Bslug%5D/comments/route.ts"
click node_api_alias "https://github.com/madrimovdev/portfolio-next/blob/prod/src/app/api/posts/%5Bslug%5D/alias/route.ts"
click node_api_stats "https://github.com/madrimovdev/portfolio-next/blob/prod/src/app/api/posts/%5Bslug%5D/stats/route.ts"
click node_api_views "https://github.com/madrimovdev/portfolio-next/blob/prod/src/app/api/posts/%5Bslug%5D/view/route.ts"
click node_api_claps "https://github.com/madrimovdev/portfolio-next/blob/prod/src/app/api/posts/%5Bslug%5D/claps/route.ts"
click node_notion "https://github.com/madrimovdev/portfolio-next/blob/prod/src/lib/notion.ts"
click node_supabase "https://github.com/madrimovdev/portfolio-next/blob/prod/src/lib/supabase.ts"
click node_telegram "https://github.com/madrimovdev/portfolio-next/blob/prod/src/lib/telegram.ts"
click node_dictionary "https://github.com/madrimovdev/portfolio-next/blob/prod/src/dict/index.ts"
click node_seo "https://github.com/madrimovdev/portfolio-next/blob/prod/src/lib/seo.ts"
click node_jsonld "https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/json-ld/json-ld.tsx"
click node_navbar "https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/navbar/navbar.tsx"
click node_menu_items "https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/navbar/menu-items.ts"
click node_related_posts "https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/related-posts/related-posts.tsx"
click node_latest_posts "https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/latest-posts/latest-posts.tsx"
click node_clap_button "https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/post-interactions/clap-button.tsx"

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_profile,node_work,node_experience,node_portfolio,node_project_card,node_case_studies toneBlue
class node_blog_list,node_blog_post,node_post_render,node_rss,node_rss_redirect,node_related_posts,node_latest_posts toneAmber
class node_interactions,node_comments_ui,node_comments_thread,node_api_comments,node_api_alias,node_api_stats,node_api_views,node_api_claps,node_clap_button,node_notion_api toneMint
class node_notion,node_supabase,node_database toneRose
class node_dictionary,node_seo,node_jsonld,node_navbar,node_menu_items,node_visitor toneIndigo
class node_telegram toneTeal
```

## Components

### Portfolio site

- [Localized home](https://github.com/madrimovdev/portfolio-next/blob/prod/src/app/%5Blang%5D/page.tsx): `src/app/[lang]/page.tsx`
- [Profile sections](https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/header/header.tsx): `src/components/header/header.tsx`
- [Work and skills](https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/my-work/my-work.tsx): `src/components/my-work/my-work.tsx`
- [Experience](https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/experience/experience.tsx): `src/components/experience/experience.tsx`
- [Project portfolio](https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/portfolio/portfolio.tsx): `src/components/portfolio/portfolio.tsx`
- [Project card](https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/portfolio/portfolio-card.tsx): `src/components/portfolio/portfolio-card.tsx`
- [Case studies](https://github.com/madrimovdev/portfolio-next/tree/prod/src/app/%5Blang%5D/case-studies): `src/app/[lang]/case-studies`

### Publishing

- [Blog listing](https://github.com/madrimovdev/portfolio-next/blob/prod/src/app/%5Blang%5D/blog/page.tsx): `src/app/[lang]/blog/page.tsx`
- [Blog article](https://github.com/madrimovdev/portfolio-next/blob/prod/src/app/%5Blang%5D/blog/%5Bslug%5D/page.tsx): `src/app/[lang]/blog/[slug]/page.tsx`
- [Notion rendering](https://github.com/madrimovdev/portfolio-next/blob/prod/src/lib/notion-render.tsx): `src/lib/notion-render.tsx`
- [Localized RSS](https://github.com/madrimovdev/portfolio-next/blob/prod/src/app/%5Blang%5D/rss.xml/route.ts): `src/app/[lang]/rss.xml/route.ts`
- [RSS redirect](https://github.com/madrimovdev/portfolio-next/blob/prod/src/app/rss.xml/route.ts): `src/app/rss.xml/route.ts`
- [Related posts](https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/related-posts/related-posts.tsx): `src/components/related-posts/related-posts.tsx`
- [Latest posts](https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/latest-posts/latest-posts.tsx): `src/components/latest-posts/latest-posts.tsx`

### Reader engagement

- [Interaction provider](https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/post-interactions/post-interactions-provider.tsx): `src/components/post-interactions/post-interactions-provider.tsx`
- [Comment thread UI](https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/comments/comments.tsx): `src/components/comments/comments.tsx`
- [Comment thread](https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/comments/comment-thread.tsx): `src/components/comments/comment-thread.tsx`
- [Comment endpoint](https://github.com/madrimovdev/portfolio-next/blob/prod/src/app/api/posts/%5Bslug%5D/comments/route.ts): `src/app/api/posts/[slug]/comments/route.ts`
- [Alias endpoint](https://github.com/madrimovdev/portfolio-next/blob/prod/src/app/api/posts/%5Bslug%5D/alias/route.ts): `src/app/api/posts/[slug]/alias/route.ts`
- [Stats endpoint](https://github.com/madrimovdev/portfolio-next/blob/prod/src/app/api/posts/%5Bslug%5D/stats/route.ts): `src/app/api/posts/[slug]/stats/route.ts`
- [View endpoint](https://github.com/madrimovdev/portfolio-next/blob/prod/src/app/api/posts/%5Bslug%5D/view/route.ts): `src/app/api/posts/[slug]/view/route.ts`
- [Clap endpoint](https://github.com/madrimovdev/portfolio-next/blob/prod/src/app/api/posts/%5Bslug%5D/claps/route.ts): `src/app/api/posts/[slug]/claps/route.ts`
- [Clap button](https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/post-interactions/clap-button.tsx): `src/components/post-interactions/clap-button.tsx`

### Content and services

- [Notion content client](https://github.com/madrimovdev/portfolio-next/blob/prod/src/lib/notion.ts): `src/lib/notion.ts`
- [Supabase data access](https://github.com/madrimovdev/portfolio-next/blob/prod/src/lib/supabase.ts): `src/lib/supabase.ts`
- **Supabase database**

### Shared presentation

- [Locale dictionary](https://github.com/madrimovdev/portfolio-next/blob/prod/src/dict/index.ts): `src/dict/index.ts`
- [SEO utilities](https://github.com/madrimovdev/portfolio-next/blob/prod/src/lib/seo.ts): `src/lib/seo.ts`
- [Structured data](https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/json-ld/json-ld.tsx): `src/components/json-ld/json-ld.tsx`
- [Navigation](https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/navbar/navbar.tsx): `src/components/navbar/navbar.tsx`
- [Menu definitions](https://github.com/madrimovdev/portfolio-next/blob/prod/src/components/navbar/menu-items.ts): `src/components/navbar/menu-items.ts`

### Other components

- **Visitor**
- **Notion API**
- [Telegram notifier](https://github.com/madrimovdev/portfolio-next/blob/prod/src/lib/telegram.ts): `src/lib/telegram.ts`

## Connections

- Visitor → Localized home: opens (evidence: `src/app/[lang]/page.tsx`)
- Localized home → Profile sections: renders (evidence: `src/app/[lang]/page.tsx`)
- Localized home → Work and skills: renders (evidence: `src/app/[lang]/page.tsx`)
- Localized home → Experience: renders (evidence: `src/app/[lang]/page.tsx`)
- Localized home → Project portfolio: renders (evidence: `src/app/[lang]/page.tsx`)
- Project portfolio → Project card: renders (evidence: `src/components/portfolio/portfolio.tsx`)
- Localized home → Locale dictionary: loads locale (evidence: `src/app/[lang]/page.tsx`)
- Localized home → Structured data: renders (evidence: `src/app/[lang]/page.tsx`)
- Localized home → SEO utilities: builds metadata (evidence: `src/app/[lang]/page.tsx`)
- Visitor → Blog listing: opens (evidence: `src/app/[lang]/blog/page.tsx`)
- Blog listing → Notion content client: loads posts (evidence: `src/app/[lang]/blog/page.tsx`)
- Visitor → Blog article: opens (evidence: `src/app/[lang]/blog/[slug]/page.tsx`)
- Blog article → Notion content client: loads article (evidence: `src/app/[lang]/blog/[slug]/page.tsx`)
- Blog article → Notion rendering: renders blocks (evidence: `src/app/[lang]/blog/[slug]/page.tsx`)
- Blog article → Related posts: renders (evidence: `src/app/[lang]/blog/[slug]/page.tsx`)
- Localized home → Latest posts: renders (evidence: `src/app/[lang]/page.tsx`)
- Blog listing → Locale dictionary: loads locale (evidence: `src/app/[lang]/blog/page.tsx`)
- Blog article → Locale dictionary: loads locale (evidence: `src/app/[lang]/blog/[slug]/page.tsx`)
- Related posts → Notion content client: loads posts (evidence: `src/components/related-posts/related-posts.tsx`)
- Latest posts → Notion content client: loads posts (evidence: `src/components/latest-posts/latest-posts.tsx`)
- Notion content client → Notion API: queries content (evidence: `src/lib/notion.ts`)
- Visitor → RSS redirect: requests feed (evidence: `src/app/rss.xml/route.ts`)
- RSS redirect → Localized RSS: redirects (evidence: `src/app/rss.xml/route.ts`)
- Localized RSS → Notion content client: loads published posts (evidence: `src/app/[lang]/rss.xml/route.ts`)
- Blog article → Interaction provider: renders (evidence: `src/app/[lang]/blog/[slug]/page.tsx`)
- Blog article → Comment thread UI: renders (evidence: `src/app/[lang]/blog/[slug]/page.tsx`)
- Comment thread UI → Comment thread: renders (evidence: `src/components/comments/comments.tsx`)
- Interaction provider → View endpoint: requests views (evidence: `src/components/post-interactions/post-interactions-provider.tsx`)
- Interaction provider → Stats endpoint: requests stats (evidence: `src/components/post-interactions/post-interactions-provider.tsx`)
- Interaction provider → Clap endpoint: sends claps (evidence: `src/components/post-interactions/post-interactions-provider.tsx`)
- Clap button → Interaction provider: uses context (evidence: `src/components/post-interactions/clap-button.tsx`)
- Comment thread UI → Supabase data access: loads comments (evidence: `src/components/comments/comments.tsx`)
- Comment endpoint → Supabase data access: reads and writes (evidence: `src/app/api/posts/[slug]/comments/route.ts`)
- Comment endpoint → Telegram notifier: notifies (evidence: `src/app/api/posts/[slug]/comments/route.ts`)
- Comment endpoint → Alias endpoint: calls aliasFor (evidence: `src/app/api/posts/[slug]/comments/route.ts`)
- Alias endpoint → Supabase data access: hashes client IP (evidence: `src/app/api/posts/[slug]/alias/route.ts`)
- Stats endpoint → Supabase data access: reads stats (evidence: `src/app/api/posts/[slug]/stats/route.ts`)
- View endpoint → Supabase data access: increments views (evidence: `src/app/api/posts/[slug]/view/route.ts`)
- Clap endpoint → Supabase data access: adds claps (evidence: `src/app/api/posts/[slug]/claps/route.ts`)
- Supabase data access → Supabase database: calls RPC (evidence: `src/lib/supabase.ts`)
- Visitor → Case studies: browses
- Profile sections → Locale dictionary: loads locale (evidence: `src/components/header/header.tsx`)
- Navigation → Menu definitions: uses definitions (evidence: `src/components/navbar/navbar.tsx`)
- Locale dictionary → Menu definitions: types menu (evidence: `src/dict/index.ts`)
