Project stack:
- Gatsby (React).
- Mobx (for state).
- Emotion (for CSS).
- Bootstrap
- Prismic SDK (for headless CMS).
- Commercetools SDK
- Eslint
- Proptypes
-
Start developing.
Navigate into your new site’s directory and start it up.
npm i npm start
-
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.
A quick look at the important top-level files and directories you'll see in a Gatsby project.
-
/src
: This directory will contain all of the code related to what you will see on the front-end of your site (what you see in the browser) such as your site header or a page template.src
is a convention for “source code”. -
gatsby-browser.js
: This file is where Gatsby expects to find any usage of the Gatsby browser APIs. -
gatsby-config.js
: This is the main configuration file for a Gatsby site. This is where you can specify information about your site (metadata) like the site title and description, which Gatsby plugins you’d like to include, etc. Many different plug-ins configurations and settings can be found here. -
gatsby-node.js
: This file is where Gatsby expects to find any usage of the Gatsby Node APIs (if any). These allow customization/extension of default Gatsby settings affecting pieces of the site build process. This is the place where all GraphQL/Rest queries are done, before filled in the interernal GraphQL storage. -
package-lock.json
(Seepackage.json
below, first). This is an automatically generated file based on the exact versions of your npm dependencies that were installed for your project. (You won’t be changing this file directly). -
.babelrc
: Babel additional settings, presets and plug-ins. -
.env.development / .env.production
: Development / production enviroment settings for API, SDKs and plug-ins. -
.eslintrc.js
: Custom eslint rules for common code style. -
buildspec.yml / cf-template.yml
: Related files to the deployment on AWS Codebuild / S3. -
mobx-provider.js
: Inserts mobx provider to all pages and access to the stores. -
buildspec.yml / cf-template.yml
:
Looking for more guidance? Full documentation for Gatsby lives on the website. Here are some places to start:
-
For most developers, we recommend starting with our in-depth tutorial for creating a site with Gatsby. It starts with zero assumptions about your level of ability and walks through every step of the process.
-
To dive straight into code samples, head to our documentation. In particular, check out the Guides, API Reference, and Advanced Tutorials sections in the sidebar.