Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Gatsby + Contentful + Snipcart ecommerce starter for building a customizable online store.
OneShopper is a Gatsby starter template for building ecommerce websites, pairing Contentful as the content management system and Snipcart as the shopping cart and checkout layer.
OneShopper is an open-source Gatsby starter that produces a static ecommerce site. It takes a Contentful space ID and access token, plus a Snipcart API key, as input, and outputs a deployable ecommerce front end. The project is maintained by Rohitguptab on GitHub and includes a live demo at https://oneshopper.netlify.com. The starter uses gatsby-source-contentful to fetch products and content, and gatsby-plugin-snipcart to add cart and checkout functionality.
gatsby-source-contentful to pull product data and site content from Contentful; a oneshopper.json file is provided to import the required content models via the Contentful CLI.gatsby-plugin-snipcart, giving you a drop-in cart and checkout without building your own payment flow.gatsby new OneShopper from the GitHub repository and start installing dependencies.gatsby develop starts a local server at http://localhost:8000 with live updates on edit, plus a GraphQL playground at http://localhost:8000/___graphql for querying Contentful data.src/pages/index.js, which you can edit to customize the home page while following Gatsby's standard directory layout.src/pages and use Gatsby's data layer to restyle the site to match a brand.The README outlines a four-step setup: clone the repository with the Gatsby CLI, import Contentful models using the contentful CLI and the oneshopper.json file, add your Contentful space ID, access token, and Snipcart API key in the configuration, then run npm install and gatsby develop to start editing. The site is then ready to deploy, with a Netlify button provided.
Run contentful space import --content-file oneshopper.json with your space ID using the Contentful CLI. The blog post linked in the README explains the import/export process in detail.
You need your Contentful space ID and access token from Contentful, and a Snipcart API key from Snipcart. These are entered as configuration in the starter.
The demo is hosted at https://oneshopper.netlify.com, linked from the README's header.
Yes, the README includes a Deploy to Netlify button that connects the GitHub repository, so you can set up hosting with one click. Other hosting providers that support static sites would also work with the Gatsby output.
