Comments (4)
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.
@christophercliff Will give this a go then report back. Thanks :]
from flatmarket.
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.
@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)
- Convert to JSON Schema v4
- flatmarket-aws returning unhandled errors as 200
- Scheme for publishing/archiving versioned cloudformation template.json and lambda.zip
- 502 (Bad Gateway) error trying to buy a product in test mode HOT 6
- Make sure errors returned by Stripe client are mapped to readable errors in Flatmarket
- HTTPS error? HOT 2
- Is the product amount updated? HOT 1
- Is this project still being developed? HOT 2
- Are you using Flatmarket in production? HOT 3
- Error trying to build app.js HOT 2
- Additional flatmarket-cli options HOT 3
- Dockerize
- Integrating a different static front-end? HOT 1
- multiple products in a single transaction HOT 1
- No app.js is created when running the script. HOT 1
- Differences in Philosophy and Features HOT 3
- Can't install the cli HOT 3
- Test site: Invalid API key provided HOT 1
- cant find flatmarket file HOT 1
- Error: Cannot find module '/node_modules/flatmarket-cli/node_modules/flatmarket-theme-bananas/index.jsx'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flatmarket.