The pattern: Next.js owns routing and rendering; APIForge owns content. Editors create pages in the CMS; the site updates without deploys.
1 · Model a pages resource
path text (e.g. /services/ai-agents, required, searchable) title text type select (landing / service / article) content blocks (hero, feature-grid, faq, cta…) meta_title text meta_desc textarea
The blocks field is the page builder: editors compose ordered sections; your frontend maps each block type to a React component.
2 · One catch-all route
// app/[[...slug]]/page.tsx
const path = '/' + (params.slug?.join('/') ?? '');
const page = await fetch(
`${API}/pages?filter[path]=${encodeURIComponent(path)}`,
{ headers: { Authorization: `Bearer ${KEY}` }, next: { revalidate: 300 } }
).then(r => r.json()).then(j => j.data?.[0]);
if (!page) notFound();
return ;
3 · Static params from the API
export async function generateStaticParams() {
const { data } = await fetch(`${API}/pages?per_page=500`).then(r => r.json());
return data.map(p => ({ slug: p.path.split('/').filter(Boolean) }));
}
Add a page in the CMS → it exists on the site. No code change.
4 · Draft preview
Enable Project Settings → Draft Preview and send the token from your Next.js draft-mode route as X-Preview-Token. Editors see unpublished pages live; the public site stays cached and clean.
5 · Going multilingual later?
Enable localization, and the same fetch becomes …&locale=sv, with automatic fallback for untranslated pages, and one-click AI translation in the editor.
Try it on a real project
Reading is slower than building here. Spin up a workspace and see for yourself.
Get startedKeep reading
Your first backend in 10 minutes
Create a project, model a resource, grab an API key and make your first authenticated requ...
TutorialsLet Claude build your backend (MCP)
Connect Claude, Cursor or ChatGPT to your personal MCP URL and build a complete backend by...
TutorialsA SaaS backend without a backend team
User accounts with OTP login, user-scoped data, webhooks for Stripe: the unglamorous 80% o...