This is a technology spike — nothing here is a committed HDC deployment.Learn more →

← Back to all entries

Spike evaluation: Next.js (static export) + Pagefind + Decap CMS

Second SSG iteration through SPECIFICATION.md's open questions, built to the same bar as the Astro spike (spikes/astro/content-pages/evaluation.md) and reading the same shared /data + /schema, so the two are directly comparable rather than independently scoped. Pagefind was reused as-is rather than re-running the 5-engine search comparison a second time — that comparison doesn't change per SSG, see spikes/astro/content-pages/search-engines.md.

What this spike proves works

Friction encountered (and fixed)

Second layout, images, and environment rendering (SPECIFICATION.md, "Demonstrate alternative layouts and images" / "Individual environments/rendering")

Search-index-driven listing and pagination (SPECIFICATION.md, "Search-index-driven listings with pagination")

CMS future-requirements read-through (SPECIFICATION.md, "CMS gui like options")

No different from the Astro spike's read on these, since Decap CMS's actual capabilities don't change per SSG — only the config file changes, and barely:

What was actually run (for reproducibility)

npx create-next-app@latest nextjs --typescript --eslint --app --src-dir --import-alias "@/*" --turbopack --no-tailwind --yes
npm install yaml marked
npm install -D pagefind decap-server serve
npm run build          # next build && pagefind --site out
npm run preview         # serve out — verified via curl
npm run cms             # decap-server from repo root; queried its API directly for entries/pages/banner

Also run directly against the built output, not inferred from code:

Post-spike code review (senior developer/architect pass)

An independent review of this spike's code, conducted after completion, from the perspective of a senior developer/architect deciding what carries into the next stage of development. The spike passed its functional bar; the findings below are the patterns that must not be copied verbatim into a product, plus the questions to answer before the first production sprint.

AI declaration: original implementation by Claude Sonnet 5 (claude-sonnet-5); this review by Claude Fable 5 (claude-fable-5), based on a full read of every source file in this spike plus the spec, report, and canonical schema for cross-checking. Every finding below was verified against the actual code, not inferred.

Code-level improvements

Architectural concerns

Security considerations

Questions for the next stage

  1. What generates the TS types and Decap config from the JSON Schema, and where does entry validation run — build gate, CI, or CMS-side?
  2. Decap's github backend needs an OAuth proxy that a GCS bucket + CDN cannot host — what serves that in production?
  3. Zero automated tests exist — what's the minimum harness (build + ajv gate + a Playwright "Sangya" smoke test) before iteration two?
  4. Is the (site)/(articles) route-group split — two full root layouts to maintain — actually needed in a product, or was it spec-driven demonstration only?
  5. Given this scaffold's own AGENTS.md breaking-changes warning and the async-params change already encountered, who owns Next.js major-version upgrades — and does that maintenance cost tip the balance further toward the recommended Eleventy?