0.0.6 β€’ Published 3 years ago

gatsby-starter-essentials v0.0.6

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

Gatsby default starter extended with tools to help you boost your development experience.

Feel free to submit suggestions and bug reports.

πŸš€ Getting Started

  1. Create a Gatsby site.

    Use the Gatsby CLI to create a new site, specifying the gatsby-essentials-starter.

    # create a new Gatsby site using the `gatsby-essentials-starter` starter
    gatsby new hello-world https://github.com/MK-IT/gatsby-starter-essentials
  2. Configure.

    Navigate into your new site’s directory and copy the example dotenv secrets.

    cd hello-world && cp .env.example .env

    Note: You can change any of the secrets defined in .env. However, all of the pre-defined variables are required by the installed Gatsby plugins.

  3. Start developing.

    Start it up.

    gatsby develop

    Note: You can change the contents of src/ in any way you like. The pre-defined pages and components are for demo purposes only.

  4. 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.

    Open the hello-world directory in your code editor of choice and edit src/pages/index.js. Save your changes and the browser will update in real time!

⭐ Features

ProjectPluginsComponents
πŸ’ͺ Latest JS support♻️ NProgress🌐 Page
πŸ’Ž ReactJS & PropTypesπŸ“ˆ Google Analytics🌐 Header (stub)
⚑️ ESLint, Prettier, EditorConfigπŸ“ˆ Facebook Pixel🌐 Footer (stub)
πŸ›  .env configurationπŸ“¬ MailChimp🌐 SEO + JSON-LD
πŸ“‚ Clean folder structureβ›‘ React Helmet
🚦 Pre-commit hooksπŸ“œ Manifest
🀝 Commit message lintingπŸ€– Robots.txt
:πŸ§—πŸ»β€β™‚οΈ: Built-in semver automation🌐 Sitemap
πŸš€ Production ready✈️ Offline
πŸ‘‰ Webpack Root Import
πŸ‹οΈβ€β™‚οΈ Webpack Size

πŸ›  .env configuration

You can provide environment variables to your site to customize its behavior in different environments. See Gatsby's guide on environment variables.

Gatsby's Node API can access both "OS Env Vars" and "Project Env Vars" all the time. Your client-side JS can access any "OS Env Vars" and any "Project Env Vars" prefixed with `GATSBY`._

🀝 Commit message linting

Keep your commit messages human- and robot-readable using a shared convention, i.e. Commitlint.

Husky's Git hooks make sure that your commit messages follow the convention. Moreover your code will be formatted and linted before every commit.

You can use Commitlint's CLI for fast authoring of your commit messages.

:πŸ§—πŸ»β€β™‚οΈ: Built-in semver automation

The package standard-version helps you generate CHANGELOG.md, tag, and bump the version by following the semver convention.

πŸ‘‰ Webpack Root Import (Path Aliases)

The project uses Webpack's resolve.alias feature to ease module imports.

# path aliases can be found in `gatsby-config.js`, `jsconfig.json`, and `.eslintrc.js`
~src --> src/
~pages --> src/pages/
~layout --> src/layout/
~containers --> src/containers/
~components --> src/components/
// instead of...
import MyComponent from '../../../components/MyComponent';
// you can do...
import MyComponent from '~components/MyComponent';

🧐 What's inside?

πŸ‘·β€β™‚οΈ Available Scripts

# local development
yarn develop

# production build
yarn build

# serve production build
yarn serve

# clean tmp files (.cache, public)
yarn clean

# format code with Prettier
yarn format

# lint code with ESLint
yarn lint

# semver and release
yarn release

πŸ“‚ Folder Structure

.
β”œβ”€β”€ .vscode               # VSCode workspace config
β”‚Β Β  β”œβ”€β”€ extensions.json
β”‚Β Β  └── settings.json
β”œβ”€β”€ src                   # Source code
β”‚Β Β  β”œβ”€β”€ components          # Components
β”‚Β Β  β”œβ”€β”€ containers          # Containers
β”‚Β Β  β”œβ”€β”€ layout              # Top level "layout" components
β”‚Β Β  └── pages               # Pages
β”œβ”€β”€ static                # Static assets
β”‚Β Β  └── images
β”œβ”€β”€ .commitlintrc.js      # Commitlint
β”œβ”€β”€ .editorconfig         # EditorConfig
β”œβ”€β”€ .env.example          # Default `dotenv` secrets
β”œβ”€β”€ .eslintrc.js          # ESLint
β”œβ”€β”€ .gitignore            # Ignored files by Git
β”œβ”€β”€ .huskyrc.js           # Husky
β”œβ”€β”€ .prettierignore       # Ignored files by Prettier
β”œβ”€β”€ .prettierrc.js        # Prettier
β”œβ”€β”€ gatsby-browser.js     # Gatsby Browser API
β”œβ”€β”€ gatsby-config.js      # Gatsby Config
β”œβ”€β”€ gatsby-node.js        # Gatsby Node API
β”œβ”€β”€ gatsby-ssr.js         # Gatsby SSR API
β”œβ”€β”€ jsconfig.json         # VSCode JS settings
β”œβ”€β”€ CHANGELOG.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
β”œβ”€β”€ ROADMAP.md
β”œβ”€β”€ package.json
└── yarn.lock

πŸ’« Deploy

Do yarn build to build your app. The output in public/ is your ready-to-use production bundle.

The public/ folder can then be statically served by any CDN, GitHub Pages or more advanced service like Netlify.

Before deploying, make sure you run yarn build && yarn serve to preview your changes 🏁.