A demo of using tier to implement pricing in an application.
- Install tier
- Connect tier to Stripe. Note: it's best to run this demo using a Stripe account with an empty test mode data set, so you can more easily see what's going on.
- Run
tier push pricing.json
. Later, to see changes to the pricing model, you can runtier push pricing-2.json
, or just edit the firstpricing.json
file and push that file again. - Run
npm install
- Run
npm start
- Open http://localhost:8300 and poke around.
The initial commit is "the app, without any Tier". It's basically a stub, many things have intentionally not been implemented, or implemented so laughably naively as to be a joke.
The tier-integration
branch is a step-by-step integration of
Tier into the app. You can walk through it bit by bit, or view
the final merge commit to see it all together at once.
Most of the tier-related parts are in lib/routes.js
, and the
templates in lib/templates/*.ejs
for the various pricing/plan
related pages.
Put this in your .env
file:
NODE_ENV=development
PORT=8300
STRIPE_KEY=<private key for stripe>
STRIPE_PUBLISHABLE_KEY=<publishable key for stripe>
And run env $(cat .env) npm start