Quick Start
Get a Chord Autonomy Gatsby site up and running quickly.
Chord has a starter that allows you to get a fully functional ecommerce site up and running in a few minutes. Our starter is built on the Gatsby framework, so we'll use the Gatsby CLI.
This guide assumes you already have Node.js and Git installed on your machine. If you don't, there are some helpful instructions in Gatsby's documentation.

Install the Gatsby CLI

1
npm install -g gatsby-cli
Copied!
This installs the Gatsby CLI on your machine.
Rather use Yarn? No problem.

Configure access to Chord's private Github repositories

Share your Github username with the Chord team to gain access to Chord's Github repositories. You'll need to do two things:
  1. 1.
    Make sure you have access to the starter repository at https://github.com/chordcommerce/gatsby-starter-assembly.
  2. 2.
    Configure your local npm to install Chord's packages from GitHub Packages:
  • Go to https://github.com/settings/tokens and click Generate new token. Make sure you select the read:packages scope. Copy the token.
  • If you don't already have one, create a .npmrc file in your home directory (touch ~/.npmrc).
  • Append the following to ~/.npmrc, replacing the <YOUR PERSONAL ACCESS TOKEN> with the Github token you just created:
1
//npm.pkg.github.com/:_authToken=<YOUR PERSONAL ACCESS TOKEN>
2
@chordcommerce:registry=https://npm.pkg.github.com
Copied!
This means that any npm packages with the @chordcommerce scope will be installed from Github Packages instead of the npm public registry. If you have any trouble on this step, see Github's documentation on configuring npm for use with Github Packages.

Create a new Chord Commerce site

1
gatsby new my-site [email protected]:chordcommerce/gatsby-starter-autonomy.git
Copied!
This clones the Chord Commerce Starter into a directory called my-site on your machine.

Change directories to your site folder

1
cd my-site
Copied!

Configure your site's environment

1
cp .env.example .env
Copied!
You'll need to populate this .env file with some environment variables, including your Chord API URL and credentials to your Contentful space. Talk to the Chord team to get these.

Start your development server

1
npm start
Copied!
You can see your new site at http://localhost:8000. Hot reload is enabled by default. For additional build commands, check out the starter documentation.
That's it! You're off and running. Time to make this site your own. ✨
Last modified 5mo ago