GithubHelp home page GithubHelp logo

next-storefront's Introduction

Project logo

Next Storefront

Status GitHub Issues GitHub Pull Requests License


A dazzlingly fast E-Commerce solution built with Typescript and NextJS.

๐Ÿ“ Table of Contents

๐Ÿง About

Visit the demo here: https://next-storefront-statik.vercel.app/

๐Ÿ“ This demo will be updated regularly as cool new features are rolled out!

๐Ÿ Getting Started

Installing

Firstly, install @next-storefront/core. This package contains an adapter to pull in and transform data from different data sources. It also contains contexts and hooks.

npm install @next-storefront/core --save

Or

yarn add @next-storefront/core

๐ŸŽˆ Usage

Secondly, pick one or more data sources, and a checkout system.

Use with Shopify

When working with Shopify, Shopify acts as both the source of products and the checkout.

  1. Install @next-storefront/shopify
  2. Configure Shopify as a source:
// next-storefront.config.js

module.exports = {
  sources: [require('@next-storefront/shopify')],
}
  1. Configure Shopify Checkout:
// App layout

import { CartProvider } from '@next-storefront/core'
import * as shopifyCheckout from '@next-storefront/shopify/checkout'

export function Layout({ Component, pageProps }) {
  return (
    <CartProvider checkout={shopifyCheckout}>
      ...
    </CartProvider>
  )
}

Get a Shopify storefront api access token. The best way is to create a private app.

Set environment variables:
NEXT_PUBLIC_SHOPIFY_STOREFRONT_TOKEN=woohoobigtoken
NEXT_PUBLIC_SHOPIFY_STORE_NAME=statikly (as in statikly.myshopify.com)

Use With Stripe

When working with Stripe, Stripe Checkout acts as the checkout. You can pull in product data from anywhere! (Even Shopify)

  1. Install any data source, e.g. @next-storefront/json
  2. Configure your data source:
// next-storefront.config.js

module.exports = {
  sources: [require('@next-storefront/json')],
}
  1. Install @next-storefront/stripe
  2. Configure Stripe Checkout:
// App layout

import { CartProvider } from '@next-storefront/core'
import * as stripeCheckout from '@next-storefront/stripe/checkout'

export function Layout({ Component, pageProps }) {
  return (
    <CartProvider checkout={stripeCheckout}>
      ...
    </CartProvider>
  )
}

Set environment variables:
STRIPE_SECRET_KEY
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY

Create some products by adding .json files to the products directory.

โ›๏ธ Built Using

๐ŸŽ‰ Acknowledgements

TODO Features (in no particular order):

  • Static Generation
  • Serverless deploy with Vercel or Netlify
  • Work with SSG
  • Work with Incremental Static (Re)generation
  • Work with live-updates for things like inventory
  • Use with Shopify
  • Use with Stripe Checkout (This paves the way for retrieving products from anywhere!)
  • Use with Stripe Products
  • Use with other sources
  • Wishlists
  • Search & Filters
  • Custom Checkout
  • Order Pages
  • PWA

next-storefront's People

Contributors

robertbroersma avatar

Watchers

 avatar Acampbell 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.