Skip to content

viafoura/demo-site

Repository files navigation

Viafoura Demo Site with Next.js and DatoCMS

This implementation showcases a Next.js Blog using DatoCMS as the data source.

The purpose of this repo is to have a quick start reference that can be set up with the "one-click" button below.

Demo

Have a look at the end result live:

Quick start

  1. Create an account on DatoCMS.

  2. Make sure that you have set up the Github integration on Vercel.

  3. Let DatoCMS set everything up for you clicking this button:

Deploy DatoCMS project

Local setup

Once the setup of the project and repo is done, clone the repo locally.

Set up environment variables

In your DatoCMS' project, go to the Settings menu at the top and click API tokens.

Then click Read-only API token and copy the token.

Next, make a copy of the .env.local.example file in the root directory, and rename it to .env.local (which will be ignored by Git):

cp .env.local.example .env.local

Then on .env.local update GRAPHQL_API_TOKEN with the Read-only API token provided by DatoCMS within the dashboard settings.

Your .env.local file should look like this:

GRAPHQL_API_TOKEN=<read-only-api-token-from-datocms>

Then, update these values in next.config.js according to your site.

vfDomain: "demo.viafoura.com",
vfSiteId: "233586191803414",
vfSiteUUID: "00000000-0000-4000-8000-d47205fca416",

Run your project locally

npm install
npm run dev

Your demo site should be up and running on http://localhost:3000!