Gatsby starter for blog with Flotiq Headless CMS
Tags: webdev, headlesscms, gatsby, tutorial
Published: 2022-05-09 13:51:56

Kick off your project with this blog boilerplate. This starter ships with the main Gatsby configuration files you might need to get up and running blazing fast with the blazing fast app generator for React.
![Flotiq headless cms Blog Starter](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/drgguc721p20n4bgl7m8.png)
 
Live Demo: https://flotiqgatsbyblog2.gatsbyjs.io

**This project use:**

- [Flotiq](https://flotiq.com/) - Headless CMS for string your data (You can create account [here](https://editor.flotiq.com/register.html))
- [Tailwind](https://tailwindcss.com/) - utility-first CSS framework
- [Flotiq source plugin](https://github.com/flotiq/gatsby-source-flotiq) - connector for fetching data from Flotiq
- [Flotiq components for react](https://flotiq.github.io/flotiq-components-react) - components library designed and written to work perfectly with Flotiq Content Objects and display your data beautifully

This project works on node ^14.17.0 || >=16.0.0, we do not support node 15.

## Quick start
1. Start the project from template using Flotiq CLI

```
npm install -g flotiq-cli
flotiq start [flotiqApiKey] [projectName] https://github.com/flotiq/flotiq-gatsby-blog-2.git
```

- `flotiqApKey` - Read and write API key to your Flotiq account
- `projectName` - project name or project path (if you wish to start project in or import data from the current directory - use `.`)

2. You can also start the project from template using Gatsby CLI

```
gatsby new my-hello-world-starter https://github.com/flotiq/flotiq-gatsby-blog-2.git
```

3. Configure application

The next step is to configure our application to know from where it has to fetch the data.

You need to create a file called `.env.development` inside the root of the directory, with the following structure:

```
GATSBY_FLOTIQ_API_KEY=YOUR FLOTIQ API KEY
GA_TRACKING_ID=YOUR GA TRACKING KEY
```

4. Start developing.

Navigate into your new site’s directory and start it up.

```
cd flotiq-gatsby-blog-2/
gatsby develop
```

This step is optional and is not necessary if you used flotiq-cli to start the project.

If you wish to import example data to your account, before running `gatsby develop` run:

```
flotiq import [flotiqApiKey] .
```

It will add two example objects to your Flotiq account.

Note: You need to put your Read and write API key as the `flotiqApiKey` for import to work, You don't need any content types in your account.

5. Open the source code and start editing!

Your site is now running at `http://localhost:8000`!

> Note: You'll also see a second link: `http://localhost:8000/___graphql`. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the [Gatsby Tutorial](https://www.gatsbyjs.com/docs/tutorial/part-4/#use-graphiql-to-explore-the-data-layer-and-write-graphql-queries).

Open the flotiq-gatsby-blog-2 directory in your code editor of choice and edit src/templates/index.js. Save your changes and the browser will update in real time!

6. Manage your content using Flotiq editor

You can now easily manage your content using [Flotiq editor](https://editor.flotiq.com/)