Skip to content
[Logo]

Getting Started

Head Start is a starterkit to easily bootstrap your next web project. Here's how to get started.

Prequisites

Head Start requires Node.js to be installed. See /.nvmrc for the correct version.

Create a repository

git clone ...
cd ...
npm install
cp .env.example .env
# .env
HEAD_START_PREVIEW_SECRET=create-your-own

Before you can run your project locally, you need to set-up a DatoCMS project.

Create a DatoCMS project

# .env
DATOCMS_READONLY_API_TOKEN=copy-read-only-token
DATOCMS_API_TOKEN=copy-full-access-token
npx datocms migrations:run --destination=start --fast-fork
npx datocms environments:promote start
// datocms-environment.ts:
export const datocmsEnvironment = 'start';

[!WARNING] Head Start has an open issue on providing seed scripts. You will manually add a bit of required (placeholder) content to your new CMS instance for the global SEO data, Home and 404 Page.

You can now run your project locally:

npm run dev

Add DatoCMS secrets to repository

Head Start provides GitHub Actions which include linting code and validating HTML on PR changes. These Actions require the DatoCMS tokens to be available.

Go to your repository's Settings > Secrets and Variables > Actions > Repository Secrets (/settings/secrets/actions#repository-secrets) add DATOCMS_API_TOKEN and DATOCMS_READONLY_API_TOKEN.

Your PR's will now be able to run the pre-configured GitHub Actions.

The next step is creating a Cloudflare Pages application so your project can be deployed to the cloud.

Create a Cloudflare Pages application

You're project is now deployed and will automatically be deployed on every git commit. To ensure changes in the CMS also redeploy the project, we need to connect DatoCMS to Cloudflare.

Connect DatoCMS to Cloudflare Pages

That's it. Now deployments are automatically triggered from both git and when editors hit 'Build now' in the CMS. If you add additional build triggers in the future, you can repeat those steps. Note that buildTriggerId in /datocms-environment.ts should always be set to the production build trigger.

What's next?

Read the docs for more details on the setup Head Start provides.