GithubHelp home page GithubHelp logo

shrey-weybee / graphcms-commerce-starter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hygraph/hygraph-commerce-starter

0.0 0.0 0.0 158 KB

Home Page: https://commerce.withheadlesscms.com

License: MIT License

JavaScript 100.00%

graphcms-commerce-starter's Introduction

GraphCMS Commerce Starter

Build modern, SEO ready commerce storefronts with GraphCMS, Next.js, Stripe and Tailwind CSS

Clone project Deploy with Vercel

About

This project is an example of how to build fully-functioning Next.js commerce storefront with GraphCMS and Stripe. View the demo on https://commerce.withheadlesscms.com/.

Features

Usage

This reference application requires a Stripe account

  1. Clone the repository with degit and install project dependencies.
npx degit GraphCMS/graphcms-commerce-starter#main graphcms-commerce-starter
cd graphcms-commerce-starter
yarn
  1. Create a new GraphCMS project using the Commerce Starter template.

  2. Add a .env file by cloning .env.sample and providing the required variable values.

It is recommended you create separate GraphCMS auth tokens to handle querying and mutating data.

GRAPHCMS_MUTATION_TOKEN=
NEXT_PUBLIC_GRAPHCMS_TOKEN=
NEXT_PUBLIC_GRAPHCMS_URL=
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=
STRIPE_SECRET_KEY=
  1. Setup a Stripe webhook for the checkout.session.completed event to order to enable GraphCMS fulfilment via the mutation API.

  2. Configure support for more locales or currencies in graphcms.config.js if required. Learn more here.

  3. Run yarn dev

Configuration

Project configuration for supported locales and currencies is managed in graphcms.config.js.

It is important that the locales array reflects the enabled locales in your GraphCMS project.

module.exports = {
  locales: [
    {
      value: 'en',
      label: 'English',
      default: true
    },
    {
      value: 'de',
      label: 'German'
    }
  ],
  currencies: [
    {
      code: 'GBP',
      default: true
    },
    {
      code: 'EUR'
    }
  ]
}

graphcms-commerce-starter's People

Contributors

ynnoj avatar jpedroschmitz avatar ronakganatra avatar notrab 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.