Ahmed Abdelaziz
Back to projects
Portfolio screenshot

Portfolio

The site you're reading — a static-first Next.js 16 portfolio where projects and design docs are files in the repository, rendered at build time through one shared MDX pipeline, with a single guarded Node route for co-located assets.

next.jsreacttypescripttailwindcssshadcn-uimdxnext-themesyamlmermaidnodejs

Aug 2026

The site you're reading. Content is the repository: projects are Markdown/MDX folders, design docs are validated YAML + MDX, and almost every page is prerendered to HTML at build time. No database, no CMS, no admin panel.

What makes it interesting isn't the stack list — it's the boundary between what is static and what must run at request time, and the pipeline that keeps both honest.


Overview

The portfolio is built around one rule: adding content should never mean touching code. Drop a folder into projects/, optionally attach content/design-docs/<slug>/meta.yaml, push — the next build discovers, validates, and renders it.

That rule drove the architecture:

  • a build-time discovery and parsing pipeline instead of a content API;
  • one MDX component map shared by project pages and design docs;
  • strict metadata validation that fails the build rather than shipping a broken page;
  • a single request-time route for project assets, because images live next to their Markdown instead of in public/.

The site also documents itself in its own format — its Architecture, Requirements, and ADRs are rendered by the same pipeline as every other project.

How a Page Gets Built

projects/<folder>/<file>.md
        │
        ├── fast-glob (recursive discovery)
        │        └── gray-matter (frontmatter → typed Project)
        │
content/design-docs/<slug>/meta.yaml
        │
        ├── YAML parse + validation
        │        └── merge with inline `designDocs` (duplicate IDs fail)
        │
        └── getProjects(): filter `visible`, sort by date/order
                 │
                 ├── `/`                     static
                 ├── `/projects/[slug]`      generateStaticParams → SSG
                 ├── `/sitemap.xml`          static
                 └── design docs index/pages → SSG (local docs only)

Everything above the runtime line is resolved before the site is served. That includes the home page, every project page, every local design doc, the sitemap, robots, the manifest, and the OG/Twitter images.

The Static / Dynamic Boundary

SurfaceRenderingWhy
Home, project pagesStatic / SSGContent is known at build time
Design Docs index + pagesSSGGenerated only for projects that declare docs
/sitemap.xml, /robots.txtStaticDerived from the same project list
/project-assets/[...path]Dynamic (Node)Serves co-located images, PDFs, and video

The asset route is the one deliberate exception. It joins the requested segments, resolves them under projects/, rejects anything that escapes the directory, maps the extension to a MIME type, and caches the response for a year as immutable. Project images are referenced relatively (./banner.svg) and rewritten by a remark plugin to /project-assets/<folder>/<file>.

That route is also why the site is static-first, not purely static: a output: "export" build cannot run a request-time filesystem read. Hosting it needs a Node runtime (Vercel or equivalent) — or a migration of project images into public/.

Content Pipeline

  1. Discover — fast-glob walks projects/ recursively for .md/.mdx.
  2. Parse — gray-matter splits frontmatter from body. slug defaults to the filename; dir preserves the folder for asset resolution; image resolves to a project-asset URL or falls back to the placeholder banner.
  3. Validate — apiDocsUrl must be http(s)://; inline designDocs follow the same rules as meta.yaml; duplicate doc IDs fail the build.
  4. Enrich — design docs declared in content/design-docs/<slug>/meta.yaml are loaded and merged with any inline entries.
  5. Sort — visible: false is dropped; the rest order by date descending, then order.
  6. Prerender — generateStaticParams() enumerates every slug up front and dynamicParams = false, so unknown URLs are 404s instead of runtime lookups.

Design Docs

Each project can attach multiple documents, declared once in meta.yaml:

designDocs:
  - id: architecture
    title: Architecture
    type: local
    source: architecture.mdx
    updatedAt: "2026-09-01"

  - id: api-design
    title: API Design
    type: notion
    source: https://www.notion.so/page-id

local docs are MDX rendered by the same component map as project bodies. notion docs are external links — nothing is scraped or embedded. Validation is strict on shape (id, title, type, source), uniqueness, and URL validity, so metadata mistakes surface at build time rather than as a blank page.

One MDX Pipeline

Project bodies and design docs share src/lib/mdx.tsx, so a syntax feature added once works everywhere:

  • remark-gfm — tables, task lists, strikethrough;
  • remarkProjectAssets — rewrites relative image URLs for project bodies;
  • remarkCallouts — > [!info] blockquotes become ten themed callout types;
  • rehypeSlugifyHeadings — stable, deduplicated heading IDs that feed the table of contents.

Rendering is server-side with next-mdx-remote in RSC mode. Only the interactive islands ship JavaScript: the Mermaid renderer (dynamically imported, serialized through a queue, theme-aware, with a pan/zoom viewer), the scroll-spy table of contents, the theme toggle, and the motion primitives.

SEO, Theming, and Motion

  • Metadata — canonical URLs and Open Graph article metadata per page; OG and Twitter images generated by route conventions.
  • Structured data — Person in the root layout, WebSite + ProfilePage on the home page, Article on project pages.
  • Sitemap — home plus one URL per project; design-doc pages are not yet included (a known gap, listed below).
  • Theming — next-themes with a system-first default, a #120F17 dark surface, and a View Transitions–based theme wipe where the browser supports it.
  • Motion — Motion primitives under a global reducedMotion="user" rule; every animation has a still path.

Tech Stack

LayerChoice
FrameworkNext.js 16 (App Router, React Server Components) + Turbopack
LanguageTypeScript
Contentnext-mdx-remote (RSC), gray-matter, yaml, fast-glob
StylingTailwind CSS v4 + shadcn/ui (Radix primitives)
Themingnext-themes
DiagramsMermaid, lazily imported on the client
Motionmotion with reduced-motion enforcement
AssetsGuarded Node route with immutable caching
DeploymentVercel (Node runtime required for project assets)

Honest Trade-offs

  • Static-first, not exportable — co-located assets need a Node runtime; GitHub Pages would require moving images into public/ and deleting the route.
  • Validation stops at metadata — a missing local design-doc file renders a 404 instead of failing the build (validateLocalSources() exists but is not wired in).
  • Design docs are outside the sitemap, and they do not get the default OG image.
  • Relative images inside design docs are not rewritten — the project asset plugin only runs for project bodies.
  • No syntax highlighting beyond styled code blocks, and Mermaid diagrams are invisible to crawlers and no-JS visitors.
  • No automated tests or CI — npm run lint and npm run build are the verification gate.

What This Project Shows

Product sense — documentation is treated as part of the product, not an afterthought: every project can carry architecture docs, and the site documents itself in its own format.

Engineering judgment — the interesting decisions are about boundaries: what belongs at build time, what must be dynamic, where validation should fail loudly, and how to keep one rendering pipeline instead of two. The trade-offs above are documented rather than hidden.

Dive deeper

The full record lives in this project's Design Docs: Architecture, Functional Requirements, Architecture Decisions, Design Docs System, and How to Use.