# mohamedelbachir/my-portofolio architecture

> Architecture diagram of the GitHub repository mohamedelbachir/my-portofolio, 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/mohamedelbachir/my-portofolio
- Repository: https://github.com/mohamedelbachir/my-portofolio

## Overview

This is a multilingual personal portfolio and publishing website. Visitors browse the home page, profile, projects, technical stack, work history and contact page; readers can explore blog posts, tables of contents and post reactions. The site also exposes content metadata and social-engagement APIs and generates Open Graph images. The graph includes the documented page areas and central runtime modules; some page and API implementations were not sampled, so their connections are limited to relationships visible in the source index.

Main entry points: [`app/[locale]/blog/page.tsx`](https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/blog/page.tsx) (Blog archive), [`lib/meta.ts`](https://github.com/mohamedelbachir/my-portofolio/blob/v2/lib/meta.ts) (Content metadata), [`helpers/server.ts`](https://github.com/mohamedelbachir/my-portofolio/blob/v2/helpers/server.ts) (Session hashing), [`app/[locale]/projects/components/apps.tsx`](https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/projects/components/apps.tsx) (Project listings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pages["Portfolio pages"]
  node_home["Home page<br/>[page.tsx]"]
  node_about["About page<br/>[page.tsx]"]
  node_projects["Projects page<br/>[page.tsx]"]
  node_project_list["Project listings<br/>[apps.tsx]"]
  node_stack["Stack page<br/>[page.tsx]"]
  node_stack_list["Stack listings<br/>[apps.tsx]"]
  node_work["Work page<br/>[page.tsx]"]
  node_contact["Contact page<br/>[page.tsx]"]
  node_contact_action["Contact submission<br/>[contact.ts]"]
end

subgraph group_publishing["Blog and content"]
  node_blog_list["Blog archive<br/>[page.tsx]"]
  node_post_page["Blog post<br/>[page.tsx]"]
  node_toc["Table of contents"]
  node_post_data["Blog data<br/>[blog.ts]"]
  node_post_helpers["Post helpers<br/>[post.ts]"]
end

subgraph group_engagement["Reader engagement"]
  node_reactions_ui["Reaction controls<br/>[Reactions.tsx]"]
  node_insight_hook["Insight tracking<br/>[useInsight.ts]"]
  node_reaction_layout["Reaction layout<br/>[WithReactions.tsx]"]
  node_reaction_api["Reaction API<br/>[route.ts]"]
  node_share_api["Share API<br/>[route.ts]"]
  node_view_api["View API<br/>[route.ts]"]
end

subgraph group_shared["Shared presentation"]
  node_header["Site navigation<br/>[index.tsx]"]
  node_section["Section layout<br/>[section.tsx]"]
  node_prose["Prose rendering<br/>[prose.tsx]"]
  node_view_animation["View animation<br/>[view-animation.tsx]"]
  node_routing["Locale routing<br/>[routing.ts]"]
end

subgraph group_services["Data and integrations"]
  node_meta_service["Content metadata<br/>[meta.ts]"]
  node_firebase["Firebase<br/>[firebase.ts]"]
  node_session["Session hashing<br/>[server.ts]"]
  node_content_api["Content endpoint<br/>[route.ts]"]
  node_data["Portfolio data<br/>[data.ts]"]
  node_og_post["Post image endpoint<br/>[route.tsx]"]
  node_og_images["Image templates<br/>[OgImages.tsx]"]
end

node_visitor(("Visitor"))

node_visitor -->|"browses"| node_home
node_visitor -->|"browses"| node_blog_list
node_visitor -->|"contacts"| node_contact
node_contact -.->|"submits to"| node_contact_action
node_blog_list -->|"loads posts"| node_post_data
node_post_page -->|"loads post"| node_post_data
node_post_page -->|"renders"| node_toc
node_post_page -->|"wraps content"| node_reaction_layout
node_reaction_layout -->|"renders"| node_reactions_ui
node_insight_hook -.->|"requests"| node_reaction_api
node_insight_hook -.->|"requests"| node_share_api
node_insight_hook -.->|"requests"| node_view_api
node_reaction_api -->|"identifies session"| node_session
node_share_api -->|"identifies session"| node_session
node_view_api -->|"identifies session"| node_session
node_reaction_api -->|"reads and updates"| node_meta_service
node_share_api -->|"reads and updates"| node_meta_service
node_view_api -->|"reads and updates"| node_meta_service
node_content_api -->|"uses"| node_session
node_content_api -->|"reads metadata"| node_meta_service
node_meta_service -->|"reads and writes"| node_firebase
node_og_post -->|"renders image"| node_og_images
node_og_post -->|"formats date"| node_post_helpers
node_project_list -->|"reads projects"| node_data
node_stack_list -->|"reads stack"| node_data
node_header -->|"uses links"| node_routing
node_blog_list -->|"uses links"| node_routing
node_project_list -->|"renders"| node_section
node_project_list -->|"renders"| node_prose
node_blog_list -->|"renders"| node_prose
node_blog_list -->|"animates content"| node_view_animation

click node_home "https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/(home)/page.tsx"
click node_about "https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/about/page.tsx"
click node_projects "https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/projects/page.tsx"
click node_project_list "https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/projects/components/apps.tsx"
click node_stack "https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/stack/page.tsx"
click node_stack_list "https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/stack/components/apps.tsx"
click node_work "https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/work/page.tsx"
click node_contact "https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/contact/page.tsx"
click node_contact_action "https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/actions/contact.ts"
click node_blog_list "https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/blog/page.tsx"
click node_post_page "https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/blog/%5Bslug%5D/page.tsx"
click node_toc "https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/blog/components/table-of-contents.tsx"
click node_post_data "https://github.com/mohamedelbachir/my-portofolio/blob/v2/lib/blog.ts"
click node_post_helpers "https://github.com/mohamedelbachir/my-portofolio/blob/v2/helpers/post.ts"
click node_reactions_ui "https://github.com/mohamedelbachir/my-portofolio/blob/v2/components/Reactions.tsx"
click node_insight_hook "https://github.com/mohamedelbachir/my-portofolio/blob/v2/hooks/useInsight.ts"
click node_reaction_layout "https://github.com/mohamedelbachir/my-portofolio/blob/v2/components/layouts/WithReactions.tsx"
click node_reaction_api "https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/api/reactions/%5Bslug%5D/route.ts"
click node_share_api "https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/api/shares/%5Bslug%5D/route.ts"
click node_view_api "https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/api/views/%5Bslug%5D/route.ts"
click node_meta_service "https://github.com/mohamedelbachir/my-portofolio/blob/v2/lib/meta.ts"
click node_firebase "https://github.com/mohamedelbachir/my-portofolio/blob/v2/lib/firebase.ts"
click node_session "https://github.com/mohamedelbachir/my-portofolio/blob/v2/helpers/server.ts"
click node_content_api "https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/api/content/%5Bslug%5D/route.ts"
click node_data "https://github.com/mohamedelbachir/my-portofolio/blob/v2/lib/data.ts"
click node_og_post "https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/api/og-post/route.tsx"
click node_og_images "https://github.com/mohamedelbachir/my-portofolio/blob/v2/components/OgImages.tsx"
click node_header "https://github.com/mohamedelbachir/my-portofolio/blob/v2/components/header/index.tsx"
click node_section "https://github.com/mohamedelbachir/my-portofolio/blob/v2/components/section.tsx"
click node_prose "https://github.com/mohamedelbachir/my-portofolio/blob/v2/components/prose.tsx"
click node_view_animation "https://github.com/mohamedelbachir/my-portofolio/blob/v2/providers/view-animation.tsx"
click node_routing "https://github.com/mohamedelbachir/my-portofolio/blob/v2/i18n/routing.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_about,node_projects,node_project_list,node_stack,node_stack_list,node_work,node_contact,node_contact_action toneBlue
class node_blog_list,node_post_page,node_toc,node_post_data,node_post_helpers toneAmber
class node_reactions_ui,node_insight_hook,node_reaction_layout,node_reaction_api,node_share_api,node_view_api toneMint
class node_header,node_section,node_prose,node_view_animation,node_routing toneRose
class node_meta_service,node_firebase,node_session,node_content_api,node_data,node_og_post,node_og_images,node_visitor toneIndigo
```

## Components

### Portfolio pages

- [Home page](https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/(home)/page.tsx): `app/[locale]/(home)/page.tsx`
- [About page](https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/about/page.tsx): `app/[locale]/about/page.tsx`
- [Projects page](https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/projects/page.tsx): `app/[locale]/projects/page.tsx`
- [Project listings](https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/projects/components/apps.tsx): `app/[locale]/projects/components/apps.tsx`
- [Stack page](https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/stack/page.tsx): `app/[locale]/stack/page.tsx`
- [Stack listings](https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/stack/components/apps.tsx): `app/[locale]/stack/components/apps.tsx`
- [Work page](https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/work/page.tsx): `app/[locale]/work/page.tsx`
- [Contact page](https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/contact/page.tsx): `app/[locale]/contact/page.tsx`
- [Contact submission](https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/actions/contact.ts): `app/actions/contact.ts`

### Blog and content

- [Blog archive](https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/blog/page.tsx): `app/[locale]/blog/page.tsx`
- [Blog post](https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/blog/%5Bslug%5D/page.tsx): `app/[locale]/blog/[slug]/page.tsx`
- [Table of contents](https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/%5Blocale%5D/blog/components/table-of-contents.tsx): `app/[locale]/blog/components/table-of-contents.tsx`
- [Blog data](https://github.com/mohamedelbachir/my-portofolio/blob/v2/lib/blog.ts): `lib/blog.ts`
- [Post helpers](https://github.com/mohamedelbachir/my-portofolio/blob/v2/helpers/post.ts): `helpers/post.ts`

### Reader engagement

- [Reaction controls](https://github.com/mohamedelbachir/my-portofolio/blob/v2/components/Reactions.tsx): `components/Reactions.tsx`
- [Insight tracking](https://github.com/mohamedelbachir/my-portofolio/blob/v2/hooks/useInsight.ts): `hooks/useInsight.ts`
- [Reaction layout](https://github.com/mohamedelbachir/my-portofolio/blob/v2/components/layouts/WithReactions.tsx): `components/layouts/WithReactions.tsx`
- [Reaction API](https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/api/reactions/%5Bslug%5D/route.ts): `app/api/reactions/[slug]/route.ts`
- [Share API](https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/api/shares/%5Bslug%5D/route.ts): `app/api/shares/[slug]/route.ts`
- [View API](https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/api/views/%5Bslug%5D/route.ts): `app/api/views/[slug]/route.ts`

### Shared presentation

- [Site navigation](https://github.com/mohamedelbachir/my-portofolio/blob/v2/components/header/index.tsx): `components/header/index.tsx`
- [Section layout](https://github.com/mohamedelbachir/my-portofolio/blob/v2/components/section.tsx): `components/section.tsx`
- [Prose rendering](https://github.com/mohamedelbachir/my-portofolio/blob/v2/components/prose.tsx): `components/prose.tsx`
- [View animation](https://github.com/mohamedelbachir/my-portofolio/blob/v2/providers/view-animation.tsx): `providers/view-animation.tsx`
- [Locale routing](https://github.com/mohamedelbachir/my-portofolio/blob/v2/i18n/routing.ts): `i18n/routing.ts`

### Data and integrations

- [Content metadata](https://github.com/mohamedelbachir/my-portofolio/blob/v2/lib/meta.ts): `lib/meta.ts`
- [Firebase](https://github.com/mohamedelbachir/my-portofolio/blob/v2/lib/firebase.ts): `lib/firebase.ts`
- [Session hashing](https://github.com/mohamedelbachir/my-portofolio/blob/v2/helpers/server.ts): `helpers/server.ts`
- [Content endpoint](https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/api/content/%5Bslug%5D/route.ts): `app/api/content/[slug]/route.ts`
- [Portfolio data](https://github.com/mohamedelbachir/my-portofolio/blob/v2/lib/data.ts): `lib/data.ts`
- [Post image endpoint](https://github.com/mohamedelbachir/my-portofolio/blob/v2/app/api/og-post/route.tsx): `app/api/og-post/route.tsx`
- [Image templates](https://github.com/mohamedelbachir/my-portofolio/blob/v2/components/OgImages.tsx): `components/OgImages.tsx`

### Other components

- **Visitor**

## Connections

- Visitor → Home page: browses
- Visitor → Blog archive: browses
- Visitor → Contact page: contacts
- Contact page → Contact submission: submits to
- Blog archive → Blog data: loads posts (evidence: `app/[locale]/blog/page.tsx`)
- Blog post → Blog data: loads post (evidence: `app/[locale]/blog/[slug]/page.tsx`)
- Blog post → Table of contents: renders (evidence: `app/[locale]/blog/[slug]/page.tsx`)
- Blog post → Reaction layout: wraps content (evidence: `app/[locale]/blog/[slug]/page.tsx`)
- Reaction layout → Reaction controls: renders (evidence: `components/layouts/WithReactions.tsx`)
- Insight tracking → Reaction API: requests
- Insight tracking → Share API: requests
- Insight tracking → View API: requests
- Reaction API → Session hashing: identifies session (evidence: `app/api/reactions/[slug]/route.ts`)
- Share API → Session hashing: identifies session (evidence: `app/api/shares/[slug]/route.ts`)
- View API → Session hashing: identifies session (evidence: `app/api/views/[slug]/route.ts`)
- Reaction API → Content metadata: reads and updates (evidence: `app/api/reactions/[slug]/route.ts`)
- Share API → Content metadata: reads and updates (evidence: `app/api/shares/[slug]/route.ts`)
- View API → Content metadata: reads and updates (evidence: `app/api/views/[slug]/route.ts`)
- Content endpoint → Session hashing: uses (evidence: `app/api/content/[slug]/route.ts`)
- Content endpoint → Content metadata: reads metadata (evidence: `app/api/content/[slug]/route.ts`)
- Content metadata → Firebase: reads and writes (evidence: `lib/meta.ts`)
- Post image endpoint → Image templates: renders image (evidence: `app/api/og-post/route.tsx`)
- Post image endpoint → Post helpers: formats date (evidence: `app/api/og-post/route.tsx`)
- Project listings → Portfolio data: reads projects (evidence: `app/[locale]/projects/components/apps.tsx`)
- Stack listings → Portfolio data: reads stack (evidence: `app/[locale]/stack/components/apps.tsx`)
- Site navigation → Locale routing: uses links (evidence: `components/header/index.tsx`)
- Blog archive → Locale routing: uses links (evidence: `app/[locale]/blog/page.tsx`)
- Project listings → Section layout: renders (evidence: `app/[locale]/projects/components/apps.tsx`)
- Project listings → Prose rendering: renders (evidence: `app/[locale]/projects/components/apps.tsx`)
- Blog archive → Prose rendering: renders (evidence: `app/[locale]/blog/page.tsx`)
- Blog archive → View animation: animates content (evidence: `app/[locale]/blog/page.tsx`)
