Merouane Mousselmal

A blog with no database

Ref PG-02Sheet 02 / 05

Case study, sheet 01

A Next.js and MDX blog with search, tags, saved posts and RSS, built without a CMS, a database or an admin panel.

  • Next.js
  • TypeScript
  • Tailwind CSS
  • MDX
  • Zod
  • Pagefind
  • Vercel

Visit blog.merouanemousselmal.com (opens in a new tab)

Title
A blog with no database
Client
Personal
Year
2026
Role
Design, development and writing
Services
Web development
Scale
1:1
Sheet
01
Dwg no.
PG-02-01
The blog's home page: the headline “I write about the web I build, the AI I find useful, and the XR I'm watching” above the featured articles.
View Ablog.merouanemousselmal.com

Brief

I wanted a place to write about the web I build, the AI tools I find useful and the XR products I'm watching, and I wanted to own it. Medium, Substack or WordPress would have been faster to start, but there the articles live in someone else's system and the features are the ones the platform picked.

So the brief I set myself: a fast reading site where every article is a file in my Git repository, with search, tags, an RSS feed and a newsletter, and nothing to keep running on a server. It also had to be a project I could point to, which is why it is on this sheet.

Constraints

I wrote the rules down before the first line of code, and they settled most arguments later:

  • A reading product. Fast and readable first; features come second.
  • No backend unless forced. Anything that seems to need a server has to justify it. In the end only the newsletter form does.
  • Content fails loudly. A mistake in an article's header stops the build and names the file.
  • One source of truth for structure. Sections and subsections are defined in one file and used everywhere else.
  • Nothing tracks readers without asking. Analytics and comments wait for consent.

Approach

Three sections, each with two or three subsections: Web for evergreen articles and resources, AI for curated tools and repositories, XR for dated news. An article lives at content/{section}/{subsection}/{slug}.mdx, and its URL is the same path, so there is nothing to look up.

Every article also has a format that tells readers what to expect: a full article, a quick pick on one tool (what it is, who it's for, one limitation), news with its source, or a short roundup.

An article page on the blog: the section and subsection above the title, the date and reading time, a Save button, and an 'On this page' list of headings on the right.
View BArticle page, desktop
  1. 1Section and subsection: the folder path is the URL
  2. 2Search, from a static index with no server
  3. 3Dark mode: only the colour variables change
  4. 4On this page: the article's headings
  5. 5Reading time, worked out from the text
  6. 6Save: a reading list kept in the reader's own browser

Each piece of the stack answers a named problem; none is there because it was fashionable.

Stack
NeedChoice and reason
Framework

Next.js App Router, TypeScript

Static generation, good SEO defaults, and the tools I already use for client work.

Styling

Tailwind CSS, tokens as CSS variables

Colours, type and spacing are defined once; dark mode only swaps the variables.

Content

MDX with next-mdx-remote

Markdown for writing, components when Markdown is not enough.

Validation

Zod

A bad header fails the build instead of reaching readers.

Search

Pagefind

A static search index that runs in the browser.

Newsletter

MailerLite

Double opt-in, and the API token stays on the server.

Comments

Giscus

Stored as GitHub Discussions; they load only when a reader asks.

Analytics

Google Analytics 4

Loads only after the visitor accepts.

Hosting

Vercel

Deploys on every push to main.

Tests

Vitest and Playwright in GitHub Actions

Unit tests for the logic, browser tests for the flows that matter.

Build details

The core is a short pipeline from file to page:

  1. I write an .mdx file: a header (the frontmatter) and a body.
  2. A loader reads every file under content, and Zod validates the header.
  3. The loader checks that the section and subsection in the header match the folder, and throws with the file path if they don't.
  4. The body compiles to React, with plugins for heading links, tables and highlighted code.
  5. Next.js builds a static page for each article, plus the section and tag pages, the sitemap and the RSS feed.
  6. After the build, a script writes the search index.

The schema does the editing I would otherwise forget: descriptions between 80 and 170 characters, lowercase hyphenated tags, a subsection that belongs to its section, and alt text whenever there is a cover. Drafts show in development and stay out of production, the sitemap, the feed and search.

Dark mode follows the reader's system setting. Drag across the view to compare:

The blog's home page in the light theme.
The same home page in the dark theme.
View CHome page, light and dark themes

I built it in four phases, so it was usable early and never half-broken: a blog that works; a blog people can navigate (tags, search, related posts, generated social images); a blog people can follow (featured posts, comments, the newsletter); and a blog that is pleasant to write (callouts, code tabs, link cards, figures and the saved list).

Each feature started as a small spec file with a goal, tasks and acceptance criteria that can be checked. I refined the specs with an AI assistant, GitHub Copilot wrote the implementation one file at a time, and I reviewed every change and made every commit myself.

What went wrong

Each of these worked on my machine and failed somewhere else:

  • Search broke the deployment. Pagefind was indexing the HTML in .next, and on Vercel it found none. The search records now come from the same content loader as the pages.
  • Search results opened a 404. The index stored links ending in .html, which the site doesn't serve. Stripping the extension fixed it.
  • A wide figure ran under the table of contents. The sidebar column got wider on large screens, and figures are capped to match.
  • CI couldn't find a script that only existed on my machine. Everything the pipeline needs is committed now, and it runs on a clean checkout.

Result

Posts publishedas of November 2026
19
Formatsarticle, quick pick, news, roundup
4
Server routesthe newsletter form
1

The blog runs with no database, no accounts and no admin panel. Every page is static HTML on Vercel, and publishing is a commit.

What I'd change: write the tests earlier instead of fitting them around finished code, and make cover images a rule from day one, because adding them later touched every list page and the schema.

The full story, with a step-by-step plan to build your own, is on the blog: How I built this blog, the logic behind it, and how to build yours (opens in a new tab).