Choose a framework
Astro is the standard choice for a new customer site. Choose Next.js when the project depends on its ecosystem or needs its framework-specific server-rendering path.
Astro and Next.js are the supported framework integrations. If you are migrating a site on another framework, work with your Gradial team to plan the frontend transition.
Start with a generated project
The initializer creates the required routes, adapters, tests, and build configuration. This is the fastest and safest setup for either framework.--with-starter-content when you want the integration, empty registries, design system, and project guidance without the sample pages and components.
Shared project contract
Both starters use this structure:
Keeping framework imports out of contract files lets ACI extract and validate the same content model independently of the runtime component implementation.
Astro
The Astro starter configures ACI as an Astro integration and renders CMS-managed routes through a catch-all page.Astro site configuration
rendererProtocol is starter-managed integration configuration. Keep the generated value unless your Gradial team directs otherwise.
Astro integration
astro.config.mjs includes withAci() alongside the rest of your Astro configuration:
Catch-all page
The generatedsrc/pages/[...slug].astro uses ACI’s Astro helpers to:
- enumerate known routes for a static build;
- load and normalize the page for the current route;
- resolve layout slots and default fragments;
- map content blocks through
src/cms/registry.ts; and - handle an unknown route through the project’s authored 404 page.
src/pages/404.astro in place when you customize routing. It is part of the starter’s not-found behavior.
Register an Astro component
Next.js
The Next.js starter connects ACI to the App Router. Use it when Next.js is already a project requirement or your application depends on its React ecosystem.Next.js site configuration
rendererProtocol is starter-managed integration configuration. Keep the generated value unless your Gradial team directs otherwise.
Next.js configuration
Wrap the project configuration withwithAci():
The Next.js integration currently uses webpack. Run
next dev and next build without --turbopack; the generated package scripts are configured correctly.App Router page
The generated catch-all route delegates content loading, metadata, and rendering to the ACI page helper:Register a React component
Add ACI to an existing frontend
For an existing Astro or Next.js site, generate a clean reference project with the same framework first:next-starter for Next.js. Then:
- Install
@gradial/aciand Zod 4 in the existing project. - Add
.aci.yamland thesrc/cms/contract and registry structure. - Add the framework integration and CMS-managed catch-all route from the reference project.
- Map your existing components to new contracts in
src/cms/registry.ts. - Add content under
.content/. - Bring over the generated conformance tests and relevant build scripts.
- Run the complete verification loop.
Development and build commands
Both starters provide the same core scripts:npm run preview for its local production preview. The generated package scripts carry the required ACI environment and build hooks, so prefer them over recreating the underlying commands in CI.
Framework migration checklist
If you move between Astro and Next.js, the content and contract layer can remain unchanged. Review these framework-owned pieces:- runtime component implementations;
src/cms/registry.tsimports;- the catch-all route;
- framework configuration and build scripts;
- error-page components; and
- framework-specific tests and deployment settings.
Next: CLI reference →