Final Repository
π Features
- Cart
- Product grid
- Product page
- Dynamic Inventory Checking
- Image optimization with Gatsby Image
- Styled Components with Emotion
- Google Analytics
- SEO
π¦ Dynamic Inventory Checking
The Shopify product inventory is being checked in realtime, therefore no rebuilding and redeploy is needed when a product goes out of stock. This avoids problems where products could still be available even though they're out of stock due to redeploy delay.
π Quick start
-
Start developing.
Navigate into your new siteβs directory and start it up.
cd my-shopify-store/ gatsby develop
-
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
my-shopify-store
directory in your code editor of choice and editsrc/pages/index.js
. Save your changes and the browser will update in real time! -
Connect your own Shopify store.
Open both
.env
files located in the root directory of your page end replace the credentials with your own. Don't forget to restart Gatsby for your store to be loaded!β οΈ Make sure to use the Shopify storefront API credentials, not the regular Shopify API!
π Learning Gatsby
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.
π ToDo
I'll happily merge any pull request to improve the starter. π
- Convert Layout to function component.
- Add dynamic inventory checking to avoid re-building after every purchase.
- Add better styling.
- Add image optimization using Gatsby sharp plugin.
- Convert ProductForm to function component.