Giter Site home page Giter Site logo

limbocafe's Introduction

Gatsby + Shopify

Gatsby Starter Hello World Shopify

Netlify Status

This Gatsby starter is the skeleton you need to create your own headless Shopify store experience using Gatsby.

🚀 Quick start

Set up your Shopify account

  1. Create a new Shopify account and store if you don’t have one.

  2. Create a private app in your store by navigating to Apps, then Manage private apps.

  3. Create a new private app, with any “Private app name” and leaving the default permissions as Read access under Admin API.

  4. Enable the Shopify Storefront API by checking the box that says “Allow this app to access your storefront data using Storefront API”. Make sure to also grant access to read product and customer tags by checking their corresponding boxes.

Create a Gatsby site

Use the Gatsby CLI to create a new site, specifying this starter.

# create a new Gatsby site using the hello-world-tailwind-css starter
gatsby new my-new-store https://github.com/ohduran/gatsby-starter-hello-world-shopify

Configure your Gatsby site to talk to your Shopify store

Check out the env.example file. Rename it as .env and introduce your shopify credentials (don't worry, this file will be ignored by git):

  1. SHOP_NAME: The domain name of your Shopify shop.

Example: 'gatsby-source-shopify-test-shop' if your Shopify address is 'gatsby-source-shopify-test-shop.myshopify.com'.

If you are running your shop on a custom domain, you need to use the whole domain as the shop name, without a trailing slash, for example: 'gatsby-shop.com'.

  1. SHOP_TOKEN: An API access token to your Shopify shop.

You can generate an access token in the "Manage private apps" section of your shop's Apps settings. In the Storefront API section, be sure to select "Allow this app to access your storefront data using the Storefront API". More info here.

Add some products to your Shopify store

Now is the time to add some Products on your Shopify admin panel with pictures and variants - size, color, etc.

Start developing

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

cd my-new-store/
gatsby develop

Open the source code and start editing!

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

Notice that each product is listed on the index page, and you can access to its detail page with info about variants and prices. The Add to Cart functionality is already set up, as well as the Go to Checkout section on the cart page.

Not convinced? See it for yourself on the demo.

🎓 Learn more

Looking for more guidance? A quick tutorial on how to use Shopify with Gatsby lives on the Gatsby website.

limbocafe's People

Contributors

dimstefanakis avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.