# belema7/my-portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/belema7/my-portfolio
- Repository: https://github.com/belema7/my-portfolio

## Overview

1. **High-level shape**
   - This is a **Next.js App Router** personal portfolio with mostly **static, content-driven pages**.
   - The architecture is split into three main layers: **route/page composition** in `app/`, **reusable presentation components** in `components/` and `sections/`, and **content/data utilities** in `content/`, `data/`, and `lib/`.

2. **Routing and page boundaries**
   - The `app/` directory defines the public site routes: home, about, projects, blog, library, contact, plus a custom not-found page.
   - Dynamic routes exist for **blog posts** (`app/blog/[slug]`) and **project detail pages** (`app/projects/[slug]`), indicating the site renders individual content items from a slug-based content source.

3. **Layout and global shell**
   - `app/layout.tsx` is the root composition layer, likely wiring in global styles, theme provider, metadata, and the site shell.
   - `components/layout/` contains the persistent frame of the site: **Navbar**, **Footer**, and **SiteShell**, which are shared across routes.
   - This boundary separates **persistent chrome** from route-specific content.

4. **Section-based page composition**
   - The main pages are assembled from `sections/` rather than being written as large page files.
   - Each section folder maps to a domain area: `home`, `about`, `contact`, and `library`.
   - This makes the pages **composition-first**: route files stay thin, while `sections/*` define the actual page experiences.

5. **Content domains**
   - The site has four major content domains:
     - **Home**: hero, selected projects, latest writing, skills, personal snapshot.
     - **About**: story, timeline, skills, current goals.
     - **Projects**: project grid and individual project pages.
     - **Writing/Library**: blog posts, books, movies, quotes.
   - These domains are reflected both in route structure and in the content organization under `content/`.

6. **MDX-driven publishing layer**
   - Blog and library content are stored as **MDX files** under `content/blog/...` and `content/library/...`.
   - `lib/blog/*` provides the content-loading pipeline for posts: fetching all posts, fetching by slug, related/adjacent posts, and category filtering.
   - `lib/library/get-library-content.ts` plays the same role for library items.
   - `components/mdx/MDXComponents.tsx` defines the render mapping for MDX content, acting as the presentation boundary between authored content and the UI system.

7. **Data model for profile content**
   - Static profile information is kept in `data/`: personal details, projects, skills, timeline, and helper utilities.
   - This layer supports the about page, home sections, and project listings without requiring a backend.
   - `types/content.ts` and `lib/blog/types.ts`, `lib/library/types.ts` define the content contracts that tie the MDX/data layer to the UI.

8. **Project and writing presentation**
   - `components/cards/` contains reusable card views for blog posts, books, movies, projects, and timeline entries.
   - `app/projects/ProjectsGrid.tsx` and the blog/library views in `sections/library/` use these cards to render collection pages.
   - This keeps list rendering consistent across content types while allowing each domain to remain separate.

9. **Contact flow**
   - The contact page is driven by `sections/contact/ContactForm.tsx` and `ContactInfo.tsx`.
   - `lib/email-service.ts` indicates the form submits through **EmailJS**, meaning the site can send messages without a custom backend API.
   - This is the main external interaction path on the site; everything else is mostly static rendering.

10. **UI and theming**
   - `components/ui/` contains the design-system primitives, including button, input, textarea, badge, dropdown menu, and layout helpers.
   - `components/theme-provider.tsx` and `components/layout/ThemeToggle.tsx` support light/dark mode via `next-themes`.
   - `app/globals.css` provides the global styling foundation, including the custom color palette mentioned in the README.

11. **Reusable cross-cutting building blocks**
   - `components/SkillTag.tsx`, `SocialLink.tsx`, `AppButton.tsx`, `Container.tsx`, and `SectionHeader.tsx` are shared primitives used across many sections.
   - These components act as the **design vocabulary** of the site and reduce duplication across route-specific sections.

12. **Static assets and public files**
   - `public/resume.pdf` and `public/projects/` are static assets exposed directly by the app.
   - This suggests the portfolio uses a mix of **code-rendered content** and **asset-based content delivery** for downloads and imagery.

13. **Architectural takeaway**
   - The repository is best understood as a **content-managed portfolio front end**: Next.js routes compose domain sections, sections read from static data and MDX content, and shared UI components keep presentation consistent.
   - The only notable dynamic integration is the **EmailJS contact flow**; otherwise the app is largely static, SEO-friendly, and file-system driven.

Main entry points: [`components/layout/SiteShell.tsx`](https://github.com/belema7/my-portfolio/blob/main/components/layout/SiteShell.tsx) (Site shell), [`components/ui/AppButton.tsx`](https://github.com/belema7/my-portfolio/blob/main/components/ui/AppButton.tsx) (UI kit), [`components/cards/ProjectCard.tsx`](https://github.com/belema7/my-portfolio/blob/main/components/cards/ProjectCard.tsx) (Cards), [`lib/blog/get-all-posts.ts`](https://github.com/belema7/my-portfolio/blob/main/lib/blog/get-all-posts.ts) (Blog loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_app["App Router"]
  node_app_layout["Root layout<br/>next layout<br/>[layout.tsx]"]
  node_app_home["Home<br/>route page<br/>[page.tsx]"]
  node_app_about["About<br/>route page<br/>[page.tsx]"]
  node_app_projects["Projects<br/>route page<br/>[page.tsx]"]
  node_app_project_slug["Project detail<br/>dynamic route<br/>[page.tsx]"]
  node_app_blog_slug["Blog post<br/>dynamic route<br/>[page.tsx]"]
  node_app_library["Library<br/>route page<br/>[page.tsx]"]
  node_app_contact["Contact<br/>route page<br/>[page.tsx]"]
  node_app_not_found["Not found<br/>fallback page<br/>[not-found.tsx]"]
end

subgraph group_group_sections["Sections"]
  node_home_sections["Home sections<br/>page sections"]
  node_about_sections["About sections<br/>page sections"]
  node_library_views["Library views<br/>collection views<br/>[BlogView.tsx]"]
  node_contact_flow["Contact flow<br/>form flow<br/>[ContactForm.tsx]"]
end

subgraph group_group_components["Components"]
  node_layout_shell["Site shell<br/>site frame<br/>[SiteShell.tsx]"]
  node_layout_nav["Navbar<br/>navigation<br/>[Navbar.tsx]"]
  node_layout_footer["Footer<br/>[Footer.tsx]"]
  node_mdx_ui["MDX renderer<br/>render mapping<br/>[MDXComponents.tsx]"]
  node_ui_kit["UI kit<br/>design system<br/>[AppButton.tsx]"]
  node_cards["Cards<br/>[ProjectCard.tsx]"]
end

subgraph group_group_content["Content"]
  node_content_mdx["MDX content<br/>authored content"]
end

subgraph group_group_data_lib["Data & Lib"]
  node_data_models[("Profile data<br/>static data<br/>[personal.ts]")]
  node_blog_loader["Blog loader<br/>content pipeline<br/>[get-all-posts.ts]"]
  node_library_loader["Library loader<br/>content pipeline"]
  node_email_service["Email service<br/>external integration<br/>[email-service.ts]"]
end

subgraph group_group_assets["Assets"]
  node_public_assets["Public assets<br/>static assets<br/>[resume.pdf]"]
end

node_app_layout -->|"wraps"| node_layout_shell
node_layout_shell -->|"includes"| node_layout_nav
node_layout_shell -->|"includes"| node_layout_footer
node_app_home -->|"assembles"| node_home_sections
node_app_about -->|"assembles"| node_about_sections
node_app_projects -->|"lists"| node_cards
node_app_project_slug -->|"reads"| node_data_models
node_app_blog_slug -->|"loads"| node_blog_loader
node_app_blog_slug -->|"renders"| node_mdx_ui
node_app_library -->|"assembles"| node_library_views
node_app_contact -->|"assembles"| node_contact_flow
node_content_mdx -->|"feeds"| node_blog_loader
node_content_mdx -->|"feeds"| node_library_loader
node_blog_loader -->|"hydrates"| node_mdx_ui
node_library_loader -->|"hydrates"| node_mdx_ui
node_home_sections -->|"consumes"| node_data_models
node_about_sections -->|"consumes"| node_data_models
node_library_views -->|"uses"| node_cards
node_contact_flow -->|"submits"| node_email_service
node_ui_kit -.->|"supports"| node_layout_shell
node_ui_kit -.->|"supports"| node_home_sections
node_cards -->|"built on"| node_ui_kit
node_public_assets -.->|"serves"| node_app_projects

click node_app_layout "https://github.com/belema7/my-portfolio/blob/main/app/layout.tsx"
click node_app_home "https://github.com/belema7/my-portfolio/blob/main/app/page.tsx"
click node_app_about "https://github.com/belema7/my-portfolio/blob/main/app/about/page.tsx"
click node_app_projects "https://github.com/belema7/my-portfolio/blob/main/app/projects/page.tsx"
click node_app_project_slug "https://github.com/belema7/my-portfolio/blob/main/app/projects/[slug]/page.tsx"
click node_app_blog_slug "https://github.com/belema7/my-portfolio/blob/main/app/blog/[slug]/page.tsx"
click node_app_library "https://github.com/belema7/my-portfolio/blob/main/app/library/page.tsx"
click node_app_contact "https://github.com/belema7/my-portfolio/blob/main/app/contact/page.tsx"
click node_app_not_found "https://github.com/belema7/my-portfolio/blob/main/app/not-found.tsx"
click node_layout_shell "https://github.com/belema7/my-portfolio/blob/main/components/layout/SiteShell.tsx"
click node_layout_nav "https://github.com/belema7/my-portfolio/blob/main/components/layout/Navbar.tsx"
click node_layout_footer "https://github.com/belema7/my-portfolio/blob/main/components/layout/Footer.tsx"
click node_library_views "https://github.com/belema7/my-portfolio/blob/main/sections/library/BlogView.tsx"
click node_contact_flow "https://github.com/belema7/my-portfolio/blob/main/sections/contact/ContactForm.tsx"
click node_data_models "https://github.com/belema7/my-portfolio/blob/main/data/personal.ts"
click node_blog_loader "https://github.com/belema7/my-portfolio/blob/main/lib/blog/get-all-posts.ts"
click node_library_loader "https://github.com/belema7/my-portfolio/blob/main/lib/library/get-library-content.ts"
click node_email_service "https://github.com/belema7/my-portfolio/blob/main/lib/email-service.ts"
click node_mdx_ui "https://github.com/belema7/my-portfolio/blob/main/components/mdx/MDXComponents.tsx"
click node_ui_kit "https://github.com/belema7/my-portfolio/blob/main/components/ui/AppButton.tsx"
click node_cards "https://github.com/belema7/my-portfolio/blob/main/components/cards/ProjectCard.tsx"
click node_public_assets "https://github.com/belema7/my-portfolio/blob/main/public/resume.pdf"

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_layout,node_app_home,node_app_about,node_app_projects,node_app_project_slug,node_app_blog_slug,node_app_library,node_app_contact,node_app_not_found toneBlue
class node_home_sections,node_about_sections,node_library_views,node_contact_flow toneAmber
class node_layout_shell,node_layout_nav,node_layout_footer,node_mdx_ui,node_ui_kit,node_cards toneMint
class node_content_mdx toneRose
class node_data_models,node_blog_loader,node_library_loader,node_email_service toneIndigo
class node_public_assets toneTeal
```

## Components

### App Router

Routes, layout, and page composition

- [Root layout](https://github.com/belema7/my-portfolio/blob/main/app/layout.tsx): next layout · Global shell and providers · `app/layout.tsx`
- [Home](https://github.com/belema7/my-portfolio/blob/main/app/page.tsx): route page · Landing page composition · `app/page.tsx`
- [About](https://github.com/belema7/my-portfolio/blob/main/app/about/page.tsx): route page · About route · `app/about/page.tsx`
- [Projects](https://github.com/belema7/my-portfolio/blob/main/app/projects/page.tsx): route page · Projects listing route · `app/projects/page.tsx`
- [Project detail](https://github.com/belema7/my-portfolio/blob/main/app/projects/[slug]/page.tsx): dynamic route · Slug-based project page · `app/projects/[slug]/page.tsx`
- [Blog post](https://github.com/belema7/my-portfolio/blob/main/app/blog/[slug]/page.tsx): dynamic route · Slug-based post page · `app/blog/[slug]/page.tsx`
- [Library](https://github.com/belema7/my-portfolio/blob/main/app/library/page.tsx): route page · Library collection route · `app/library/page.tsx`
- [Contact](https://github.com/belema7/my-portfolio/blob/main/app/contact/page.tsx): route page · Contact route · `app/contact/page.tsx`
- [Not found](https://github.com/belema7/my-portfolio/blob/main/app/not-found.tsx): fallback page · Custom 404 page · `app/not-found.tsx`

### Sections

Page-building sections for domain experiences

- **Home sections**: page sections · Hero, projects, writing, and profile blocks
- **About sections**: page sections · Story, skills, timeline, and goals
- [Library views](https://github.com/belema7/my-portfolio/blob/main/sections/library/BlogView.tsx): collection views · Blog and library listing views · `sections/library/BlogView.tsx`
- [Contact flow](https://github.com/belema7/my-portfolio/blob/main/sections/contact/ContactForm.tsx): form flow · Contact form and info blocks · `sections/contact/ContactForm.tsx`

### Components

Reusable UI, layout, cards, and MDX rendering

- [Site shell](https://github.com/belema7/my-portfolio/blob/main/components/layout/SiteShell.tsx): site frame · Persistent navigation and footer · `components/layout/SiteShell.tsx`
- [Navbar](https://github.com/belema7/my-portfolio/blob/main/components/layout/Navbar.tsx): navigation · Top-level site navigation · `components/layout/Navbar.tsx`
- [Footer](https://github.com/belema7/my-portfolio/blob/main/components/layout/Footer.tsx): site footer · Bottom site chrome · `components/layout/Footer.tsx`
- [MDX renderer](https://github.com/belema7/my-portfolio/blob/main/components/mdx/MDXComponents.tsx): render mapping · Component mapping for authored content · `components/mdx/MDXComponents.tsx`
- [UI kit](https://github.com/belema7/my-portfolio/blob/main/components/ui/AppButton.tsx): design system · Buttons, inputs, badges, containers, and headers · `components/ui/AppButton.tsx`
- [Cards](https://github.com/belema7/my-portfolio/blob/main/components/cards/ProjectCard.tsx): content cards · Reusable card views for content lists · `components/cards/ProjectCard.tsx`

### Content

MDX-authored blog and library content

- **MDX content**: authored content · Blog and library source files

### Data & Lib

Static data, content loaders, and services

- [Profile data](https://github.com/belema7/my-portfolio/blob/main/data/personal.ts): static data · Personal, project, skill, and timeline datasets · `data/personal.ts`
- [Blog loader](https://github.com/belema7/my-portfolio/blob/main/lib/blog/get-all-posts.ts): content pipeline · Fetch, filter, and relate posts · `lib/blog/get-all-posts.ts`
- [Library loader](https://github.com/belema7/my-portfolio/blob/main/lib/library/get-library-content.ts): content pipeline · Load library entries from MDX · `lib/library/get-library-content.ts`
- [Email service](https://github.com/belema7/my-portfolio/blob/main/lib/email-service.ts): external integration · EmailJS-backed submission path · `lib/email-service.ts`

### Assets

Static public files

- [Public assets](https://github.com/belema7/my-portfolio/blob/main/public/resume.pdf): static assets · Resume and project files · `public/resume.pdf`

## Connections

- Root layout → Site shell: wraps · Root layout composes the persistent frame
- Site shell → Navbar: includes · Shell renders primary navigation
- Site shell → Footer: includes · Shell renders footer chrome
- Home → Home sections: assembles · Home route is built from sections
- About → About sections: assembles · About route is built from sections
- Projects → Cards: lists · Projects index uses project cards
- Project detail → Profile data: reads · Project detail pages use static project data
- Blog post → Blog loader: loads · Blog detail pages resolve posts by slug
- Blog post → MDX renderer: renders · Blog posts are rendered through MDX components
- Library → Library views: assembles · Library route uses collection views
- Contact → Contact flow: assembles · Contact route uses form and info sections
- MDX content → Blog loader: feeds · Blog MDX is indexed and queried through loaders
- MDX content → Library loader: feeds · Library MDX is loaded through content helpers
- Blog loader → MDX renderer: hydrates · Post content is prepared for rendering
- Library loader → MDX renderer: hydrates · Library entries are prepared for rendering
- Home sections → Profile data: consumes · Home sections read profile and project data
- About sections → Profile data: consumes · About sections read skills and timeline data
- Library views → Cards: uses · Listing views rely on reusable cards
- Contact flow → Email service: submits · Form submission is handled by EmailJS service
- UI kit → Site shell: supports · Core primitives underpin layout and sections
- UI kit → Home sections: supports · Shared primitives are used across page sections
- Cards → UI kit: built on · Cards compose the shared UI primitives
- Public assets → Projects: serves · Static project assets back portfolio pages
