A demo using Schematic to implement packaging in an application.
This app is an image search engine using the Flickr API. It:
- Implements metered packaging model
- Checks for feature access based on the current subscription
- Reports usage of a feature
- Manages the subscription lifecycle using Schematic
We believe that B2B businesses should not reinvent the wheel to support pricing and packaging, and that a single platform, not a collection of disconnected code, tools, and processes, should support customers from purchase to feature delivery and ultimately billing.
Schematic decouples billing and entitlements logic from application code. With it, you can launch, package, meter, and monitor features without needing to restructure your app or introduce breaking changes.
- Clone the repo:
git clone https://github.com/SchematicHQ/billy-python.git
- Create and activate a virtualenv in the directory
python3 -m venv venv
. venv/bin/activate
- Install all requirements:
pip install -r requirements.txt
npm install
npm is used as a task runner and to support TailwindCSS.
- Initialize the .env file by copying the example file:
cp .env.example .env
- Populate your .env file
- Generate Flickr API keys here (to fill in FLICKR_API_KEY, FLICKR_SECRET_KEY): https://www.flickr.com/services/apps/create/ (you will need to create a dummy app - call it anything)
- Generate Schematic API keys in your account here (to fill in SCHEMATIC_API_KEY): https://docs.schematichq.com/quickstart#setting-up-dev-and-prod-environments
- Log into your Schematic account
- Run the following to seed your Schematic environment with flags, features, and plans for Billy (make sure your .env file has a valid Schematic API key first):
npm run populate-schematic
- Run the Billy app locally
Run the following command:
npm start run
Open the app locally at http://127.0.0.1:5000/. Create an account on the sign up page and log in.
Once you log in, Schematic will register the company and user and assign access appropriately. You can also now use Schematic to manage plans, limits, and entitlements for anyone you register with Billy.
To see how Schematic is integrated into the Billy app to manage features and plans, go here.
To read more about how to use the Schematic app, go here.