Tutorial
Build a small but complete Next.js website with Alinea, one feature at a time. Each step adds to the code of the previous one and ends with a list of things you can check in the browser and the dashboard. The finished code of every step is in the repository at apps/web/tutorial-sites.
Landing page: one fixed homepage entry with a title and SEO metadata, and live previews.
Content blocks: a list of text, image and weather blocks that editors arrange freely.
Shared root: a settings root with the header and footer text used on every page.
Blog: a blog overview with nested posts, dedicated routes and previous/next links.
Catch-all route: one route that renders every page, so editors can build their own page tree.
Before you start
Set up a Next.js project with Alinea by following the Quickstart: alinea init gives you the API route, the dev and build scripts and a cms.ts file that you replace in step 1. The tutorial uses the App Router, TypeScript and Next.js 16.
Conventions used in every step
One folder per page type and block type. Each folder holds a schema file (
LandingPage.schema.tsx) and a server component that renders it (LandingPage.tsx). Page types live inentries/, block types inblocks/.Components fetch their own data. Every page component queries the entry it renders and exports its own
generateMetadata. The files inapp/stay thin and only pass route parameters along.The config is
cms.tsxin the project root, and the@/*path alias intsconfig.jsonpoints to the root, so imports read@/cmsand@/entries/.... If your project keeps its code insrc/, put these folders there instead.
Because each component loads its own data, you can make any of them a cached component when it fits. Step 2 does this for a block that calls a weather API.