Giter VIP home page Giter VIP logo

Comments (4)

christophercliff avatar christophercliff commented on June 9, 2024 2

Getting Started Guide

Install node.js

Make sure you have node.js installed. Flatmarket currently targets 0.10.x, but the newer versions may work too. Will migrate to the latest major once they merge with io.js.

If you're using Mac OS X, you probably want node-v0.10.40.pkg.

Install Git

See the GitHub docs.

Clone the example repo

Flatmarket comes with a working example to help you get started. Clone the example repo by running:

$ git clone [email protected]:christophercliff/flatmarket-example.git

Install the dependencies

node.js comes with a package manager called npm. Use it to install the dependencies:

$ npm install

You may need to use sudo.

Create a flatmarket.json

Create a file ./src/flatmarket.json. This file must be a valid Flatmarket schema.

{
  "info": {
    "name": "Your Store"
  },
  "products": {
    "sku_001": {
      "amount": 1000
    }
  },
  "server": {
    "host": "your-flatmarket-server.herokuapp.com"
  },
  "stripe": {
    "publishableKey": "your_publishable_key"
  }
}

Also note that contents of the ./src/ directory will be copied to the ./build/ directory. It should contain any static assets you want to make public.

Run Flatmarket in development mode

Flatmarket has a special mode for developing locally. You can run this in the background while developing. When you change a file, the changes will be automatically reflected in the browser.

$ ./node_modules/.bin/flatmarket build \
    --component ./lib/index.jsx \
    --stripe-secret-key your_secret_key \
    --dev

Notice the example repo specifies a index.jsx component, specified with the --component option. You can customize this file any way you like. See the React docs for more information.

Build in production mode

Once you're satisfied with your changes, run a production build:

$ ./node_modules/.bin/flatmarket build \
    --component ./lib/index.jsx \

This command will generate the website in the ./build/ directory.

Deploy to a static file server

You can deploy the contents of the ./build/ directory to any web hosting service. GitHub Pages and AWS S3 are popular choices. See the static web hosting guide for more info.

Deploy the Flatmarket server

The static website communicates with Stripe through a proxy server, specified in flatmarket.json. This is a simple service that's aware of your Stripe secret key. It can run on any VPS with node.js support.

Flatmarket comes with a Heroku-ready server that can be installed for free with just one click. Go to flatmarket-server-heroku and click "Deploy to Heroku". Enter the configuration information when prompted and start the service.

from flatmarket.

koobs avatar koobs commented on June 9, 2024

@christophercliff Will give this a go then report back. Thanks :]

from flatmarket.

cjliu49-zz avatar cjliu49-zz commented on June 9, 2024

thanks @christophercliff any updates on this in 2017? Looks like you moved some things around :) will be trying out flatmarket over the next few days. appreciate your work on this!

from flatmarket.

johnsgill3 avatar johnsgill3 commented on June 9, 2024

@christophercliff agree with @cjliu49, looks like some things have moved around and maybe node version dependencies need to be looked at. I was trying on my OSX machine with node -v = v7.7.1 and it doesn't seem to run very smoothly. Maybe I need to downgrade node?

from flatmarket.

Related Issues (20)

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.