Skip to content
Patterns
Case study

How this site is built.

This catalog applies the disciplines it teaches. Each section names the decision record it comes from.

The system at a glance.

Every page view

  1. Browser
  2. Static pages

Only a form

  1. Form
  2. API
  3. Database

From the C4 container view

Six decisions on the record.

  1. ADR-0001 Hexagonal architecture

    Dependencies point inward.

    The domain imports no framework. Routes, storage, and email are adapters behind ports. The frontend follows the same rule.

  2. ADR-0006 Fitness functions as guardrails

    CI checks the architecture.

    Fitness functions fail the build when a layer imports the wrong way or a colour leaks into a screen.

  3. ADR-0007 Content as code

    Every article is a pull request.

    Patterns are MDX files in git. A typed schema fails the build on an invalid article.

  4. ADR-0002 Next.js static export

    Pages are static.

    A page view costs no server work. Only the forms call the API.

  5. ADR-0004 VPS dev, Cloudflare production

    One code base, two hosts.

    The same API runs in a Node container on the dev mirror and as Pages Functions in production.

  6. ADR-0011 Security headers owned by the repo

    The repository owns the security policy.

    Security headers live in the repository. A test compares them with what each host sends.