Getting started
Create a Contentful + Next.js site with one command, then run it locally.
ACES is a framework for marketing sites built with Contentful and Next.js 16. create-aces-app copies a template into a new folder, installs it and sets up the Contentful space behind it. That covers the content model, seed content, Live Preview URLs and a health check. When it finishes, you have a running site that editors can build pages for.
Before you start
-
Node 22 or later. Any of npm, pnpm, yarn or bun works.
-
A Contentful space you can write to, and its space ID.
-
Three tokens for that space:
- a Content Delivery API token
- a Content Preview API token
- a Content Management API token
Create the first two under Settings → API keys, and the management token under Settings → CMA tokens.
Create a project
npx create-aces-app my-site
It asks a few questions, then does the rest:
- Template: today only
marketing-website. - Page components: which ones to include. Image and Rich Text are always included, and components that others depend on are added for you.
- Styling: Unstyled (the default: the same components and layout with neutral tokens and system fonts, for your own design) or the Base skin (the styled ACES look). Rule of thumb: matching a real brand, pick Unstyled; no design to match, pick the Base skin. Switch later with
aces skin. See Which one should I pick?. - App ID: names the site’s Apps entry in Contentful, which holds its navigation, logo and footer. The default is the folder name.
- Demo content: sample pages and navigation, or a minimal starter (an Apps entry and an empty Home page).
- Optimization: whether to add Contentful Optimization, and to which components. See Optimization.
Then it installs dependencies with the package manager you ran it with and runs aces setup. Setup asks for the space ID and tokens, writes .env.local, imports the model and content, creates the Live Preview URLs and runs aces doctor.
Run it
cd my-site
pnpm dev # http://localhost:3000
Open the space in Contentful and open any Page entry. The Live Preview pane shows the local site, and your edits appear as you type.
Unattended runs
For CI or an agent harness, add --yes. Nothing prompts, and a missing value fails the run. Put the space and tokens in the environment rather than in flags, so they don’t show up in ps or shell history:
export CONTENTFUL_SPACE_ID=<space-id> CONTENTFUL_DELIVERY_TOKEN=<cda> \
CONTENTFUL_PREVIEW_TOKEN=<cpa> CONTENTFUL_MANAGEMENT_TOKEN=<cma>
npx create-aces-app my-site --yes --components all --app-id my-site --no-optimization
--yes without --skin creates an Unstyled project. The token flags (--space, --delivery-token, --preview-token, --management-token, --environment) still work and win over the environment.
Options
| Option | What it does |
|---|---|
--template <name> |
Template to copy. Default: ask (today only marketing-website). |
--components <list|all> |
Page components to include, by key or title. Default: ask, all checked. |
--skin <none|base> |
Unstyled or the ACES Base skin. Default: ask (none with --yes). |
--app-id <id> |
App ID for the Apps entry. Default: ask, then the folder name. |
--demo-content / --no-demo-content |
Demo pages and navigation, or the minimal starter. |
--optimization / --no-optimization |
Add Contentful Optimization. Default: ask. |
--optimization-components <list> |
Components to optimize: keys or titles, all or none. |
--pm <npm|pnpm|yarn|bun> |
Package manager. Default: the one that ran the command. |
--no-install / --no-git / --skip-setup |
Skip installing, git init or aces setup. |
--space --environment --delivery-token --preview-token --management-token --site-url |
Passed to aces setup. Or set CONTENTFUL_SPACE_ID, CONTENTFUL_ENVIRONMENT, CONTENTFUL_DELIVERY_TOKEN, CONTENTFUL_PREVIEW_TOKEN, CONTENTFUL_MANAGEMENT_TOKEN. |
-y, --yes |
Never prompt. |
If setup stops partway
If a Contentful step fails (for example, a wrong token), the project is still created. Fix the problem and run setup again; it picks up where it can:
pnpm run aces:setup
pnpm run aces:doctor # shows what is still wrong
Next steps
- Project structure: where things live and what you own.
- Create a component: your first block, from the CLI to Live Preview.
- Create a page type: new URLs with their own allowed components.
- Rebrand and restyle: tokens, surfaces and the skin.
- Deploy: environment variables, and pointing Live Preview at the live site.
Something wrong or missing? Open an issue.