Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Gatsby starter that builds a static e-commerce shop with Snipcart for cart and checkout, with markdown-based products.
The Gatsby and Snipcart e-commerce starter is a boilerplate for building a static e-commerce shop on Gatsby, with Snipcart providing the shopping cart and checkout and product data stored as markdown files. It is created by Issy Dennis and distributed through GitHub under the repository issydennis/gatsby-snipcart, intended to be cloned and customized.
The starter pairs the Gatsby static site generator with Snipcart's embeddable e-commerce cart to create a shop that can be hosted anywhere static files are served. It takes markdown item files from a content/items folder and generates product pages at build time, while Snipcart handles cart logic, checkout, and payment. The project uses styled-components for styling, with a theme file and a global style reset. It runs on Gatsby's build tooling and requires a Snipcart public API key in gatsby-config.js to connect the frontend to Snipcart's test or live environment.
content/items is a folder with an index.md file and an image; editing these markdown files updates the shop's catalog.src/templates/item.js generates individual item pages from the markdown data at build time.src/styles/theme.js and src/styles/globalStyle.js, letting you change the site's color scheme by editing one file.src/components/layout.js provides a base layout applied to all pages, and src/pages/index.js is the shop's homepage.gatsby develop to see a working storefront at localhost:8000 with fake checkout transactions.content/items, replace the markdown metadata and image, and the product appears on the generated item pages.src/styles/theme.js to apply a new color scheme across the whole site, or remove styled-components entirely and use your own CSS approach.To get started, you create a new Gatsby site using the starter, then create a Snipcart account to obtain a test public API key. After installing dependencies and running gatsby develop, you paste your API key into gatsby-config.js; the site builds product pages from the markdown files in content/items and Snipcart takes over the cart and checkout when a buyer clicks a product.
Yes — when using Snipcart's test environment, everything is free and fake transactions can be made to test all aspects of your shop. You get a test public API key from your dashboard to use in gatsby-config.js.
No. Snipcart is designed for static sites; the cart and checkout run through Snipcart's service, so the Gatsby site itself is just static HTML, CSS, and JavaScript that includes the Snipcart script and your product definitions.
Yes. The instructions say you can remove all references to styled-components and use your own method of applying styles and CSS.
No. Despite being created with gatsby new copying a blog starter URL, this starter is specifically for a shop; the only pages mentioned are the homepage, generated item pages, and a shared layout.
