Next.js 16 + Sanity CMS, built for Muna Kalati / MunaWorld — a Cameroon-founded organisation building African children’s media. The content-migration project: 434 blog posts moved from Wix into Sanity, which is where nearly all the interesting engineering lives.
Written up at handover (August 2026), so these notes are retrospective and include the things you only see on the way out — the dead code, the standing bugs, and the three files that were never committed.
Reading order
- 01 — Git — two remotes, sync merges, and a
.gitignorethat excluded the main migration script → general: the git course - 02 — Shell — bun as an ops runner,
curlbefore code, the audit commands used to write these notes, heredoc technique → linux - 03 — Sanity ⭐ (5 notes) — setup, schema design, GROQ, images and Portable Text, the embedded Studio → frameworks/sanity
- 04 — Frontend (3 notes) — App Router structure, ISR and fetch waterfalls, the CMS fallback pattern → frontend · next
- 05 — Migration ⭐ (5 notes) — the whole Wix→Sanity story: anatomy, reading a hostile API, idempotency and reruns, rich-text conversion, repair scripts → data migrations
- 06 — Bugs and Postmortems ⭐ — six real failures written up end to end, plus a standing-issues table
- 07 — Study Path — what this exercised, what it didn’t, and the five things to do next
The stack
| Framework | Next.js 16.2.4, React 19.2.4, App Router, React Compiler on |
| Styling | Tailwind 4 (@theme tokens), next/font self-hosting Baloo 2 + Nunito |
| CMS | Sanity 5 — 16 document types, Studio embedded at /studio |
| Runtime | bun (scripts), Vercel (deploy) |
| Source system | Wix Blog API v3 — 434 posts |
| Scale | ~9,900 lines, 45 commits, 2 contributors |
If you read one thing
06 — Bugs and Postmortems. Five of its six failures were silent — no exception, no failing build, just wrong output that looked right. The slug encoding saga in particular (three commits to get one thing right) is the best single story this project produced.
The five things worth remembering
Normalise at the boundary, in the idempotent direction. Decoded is safe to apply twice; encoded is not.
An ID scheme is a contract with your own future re-runs. Changing it mid-migration turned 434 posts into 868.
fetch resolves on 401 — and a pagination bug that under-fetches raises nothing at all. Reconcile counts before you transform.
The default must be safe. bun run dedup previews; bun run dedup:apply destroys.
A fallback that renders perfectly when the query breaks is worse than a crash. Log when the safety net fires.
Also here
- interview/ — the same material as questions with model answers
Related
- All projects and the domains they exercise
- gees-arise — the other Next.js project, where the depth is auth and Postgres RLS rather than content and migration
Software engineering
Infrastructure & security
Computer science
Hardware & engineering