Skip to content

tierrun/tier-node-demo

Repository files navigation

tier-node-demo

A demo of using tier to implement pricing in an application.

Running this demo locally

  1. Install tier
  2. 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.
  3. Run tier push pricing.json. Later, to see changes to the pricing model, you can run tier push pricing-2.json, or just edit the first pricing.json file and push that file again.
  4. Run npm install
  5. Run npm start
  6. Open http://localhost:8300 and poke around.

Notes On This Demo App

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.

To play with payment methods and setup intents

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published