Coder Social home page Coder Social logo

ecommerce-bundles-workers-example's Introduction

This is the source code for an e-commerce bundle platform built on Workers, providing AppSumo/Woot-style deals on software/educational content.

Documentation is still in-progress, but here's a list of the important directories to check out:

  • api: Cloudflare Workers application that serves static HTML, CSS, and JS, as well as acts as a serverless API and webhook handler for Stripe.
  • app: Nuxt.js static application that renders data from Sanity.io as HTML/JS components.
  • lambda: A Lambda function managed by Serverless framework that writes information to a Google Sheet via an API request.
  • sanity: The dataset and configuration for the Sanity.io headless CMS deploy that powers this application.

This codebase isn't thoroughly documented yet, though eventually it will be possible to take it and deploy on your own in order to build an e-commerce store using Cloudflare Workers.

Configuration

You should fork this repo onto your personal GitHub account. Once you've done that, comment out the lines found at the bottom of .gitignore.

A number of example configuration files have been set up across the codebase. These can be copied (and .example removed) to prepare the project for deployment:

  • cp config.example.js config.js
  • cp api/wrangler.example.toml api/wrangler.toml
  • cp sanity/sanity.example.json api/sanity.json

In addition, sanity/sanity.json should be duplicated to app/sanity.json so the Nuxt.js frontend can properly talk to your Sanity CMS deployment:

  • cp sanity/sanity.json app/sanity.json

config.js

As much as possible, the configuration has been contained to config.js - this allows the same information to be shared between the frontend, API, and other ancilliary tooling. Make sure to look inside that file for detailed comments on what each key/value pair does, and how to correctly configure it.

Secrets

A number of wrangler secrets should be set for your application to work properly. Note that the wrangler.toml provided with this project contains two environments, a default (development) environment, and a production environment. These secrets should be set on both environments, which can be configured using the environment (-e) flag: e.g. wrangler secret put for development, and wrangler secret put -e production for production:

This section is in progress - the list of secrets can be found below, and explanations on how/where to get these values is coming soon.

Name What is it
AUTH_TOKEN
AWS_ACCESS_KEY
AWS_SECRET_KEY
LAMBDA_FN
MAILGUN_API_KEY
MAILGUN_DOMAIN
SALT
SANITY_DATASET
SANITY_PROJECT_ID
STRIPE_SECRET_KEY
STRIPE_WEBHOOK_SIGNING_SECRET

Example

You can see an example deployment at ecommerce-example.signalnerve.workers.dev.

ecommerce-bundles-workers-example's People

Contributors

kristianfreeman 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.