Quickly build a subscription based website, taking variable monthly payments.
- You have a subscription service to sell
- Each of your packages have unique selling points (USPs)
- Each have a different reoccurring price
Use Subscribie to build your subscription model business & test your market.
A lot of the hard work has been done for you. If you're a devloper, you can impress your clients quickly, if you're a small business owner, you might want to try the subscription website hosting service but you can always host it yourself too.
- Low risk (not very expensive)
- No coding required
- Simple: Just give us your USPs for each service & price
- Upload your pictures
- Stripe for subscriptions & one-off payments
An abstraction layer for managing variable recurring subscriptions and billing. Abstracts direct debit and token based card payment providers or payment-institutions.
Keywords: subscriptions, payments, PS2, SEPA
git clone https://github.com/Subscribie/subscribie.git
cd subscribie
cp .env.example .env # Copy default .env settings (look at it)
virtualenv -p python3 venv # Create a python3.x virtualenv
. venv/bin/activate # Activate the virtualenv
pip install -r requirements.txt # Install requirements
export FLASK_APP=subscribie
export FLASK_DEBUG=1
flask run # Run the app
Now visit http://127.0.0.1:5000
If you like to use docker-compose workflow for local development:
git clone https://github.com/Subscribie/subscribie.git
cd subscribie
cp .env.example .env
export COMPOSE_DOCKER_CLI_BUILD=1
export DOCKER_BUILDKIT=1
# Build is only required if you want to force the image to be rebuilt
# --force-recreate is for recreating the container (not the image)
docker-compose up --build --force-recreate
Then visit http://127.0.0.1:5000
To go inside the container, you can do: docker-compose exec web /bin/bash
from the project root directory.
To rebuild the latest container, stop docker compose then do: docker-compose build
.
- Edit your
.env
file
Change:
THEME_NAME="jesmond"
toTHEME_NAME="builder"
- (optional) change
TEMPLATE_BASE_DIR
if you want to store themes in a different directory.
-
Stop & start subscribie
-
Complete. The other theme will now load
If you're creating a new theme, then change TEMPLATE_BASE_DIR
to a directory outside of
subscribie root project.
https://subscribie.readthedocs.io
Provide the username & password in a POST request, and a jwt token is returned for use in further requests.
- Install stripe cli https://stripe.com/docs/stripe-cli#install
- Run stripe cli
- Copy the webhook secret "Ready! Your webhook signing secret is whsec_abc123.."
- In your
.env
file setSTRIPE_WEBHOOK_ENDPOINT_SECRET
to the webhook secret
stripe listen --events checkout.session.completed,payment_intent.succeeded --forward-to 127.0.0.1:5000/stripe_webhook
This will allow you to see/process webhook requests locally using test api keys. Note that in production, stripe webhooks are proxied via https://github.com/Subscribie/stripe-connect-webhook-endpoint-router which validates every webhook before it get forwarded.
curl -v -d "username=me@example.com" -d "password=password" http://127.0.0.1:5000/auth/jwt-login
curl -v --user "fred:password" http://127.0.0.1:5000/auth/jwt-login
Then use the bearer token in a request to a protect path. e.g.
curl -v -H "Authorization: Bearer <token>" http://127.0.0.1:5000/auth/protected
Example POST request:
curl -v -H "Content-Type: application/json"
-H "Authorization: Bearer <token>" -d '
{
"interval_unit": "monthly",
"interval_amount": "599",
"sell_price": 0,
"title": "My title",
"requirements": {
"instant_payment": false,
"subscription": true,
"note_to_seller_required": false
},
"selling_points": [
{"point":"Quality"}
]
}' http://127.0.0.1:5000/api/plan
Example PUT request:
curl -v -H 'Content-Type: application/json' -X PUT
-d '
{
"title":"Coffee",
"interval_unit": "monthly",
"selling_points": [
{"point":"Quality"},
{"point": "Unique blend"}
],
"interval_amount":888,
"requirements": {
"instant_payment": false,
"subscription": true,
"note_to_seller_required": false}
}'
http://127.0.0.1:5000/api/plan/229
Example DELETE request:
curl -v -X DELETE -H "Authorization: Bearer <token>" http://127.0.0.1:5000/api/plan/229
https://subscriptionwebsitebuilder.co.uk
To run tests:
. venv/bin/activate # activate virtualenv
python -m pytest --ignore=node_modules # run pytest
Run npm install & pray to the npm gods.
npm install
Might see UnhandledPromiseRejectionWarning: browserType.launch: Host system is missing dependencies!
Install missing packages with:
sudo apt-get install libgstreamer-plugins-bad1.0-0\
libenchant1c2a
To run playwright tests:
npm test
Needed components / services. Check the .env.example
for each of them.
- A redis instance, listening on localhost only (unless protected with iptables)
- A subscribie site with the Builder module installed. The builder module submits new sites for building
- Subscribie deployer is an endpoint which listens for
POST
requests of new sites to be created. The Builder module submits to this endpoint. The server requires uwsgi to be installed. There is an example config in the README. - Stripe connect account announcer Each shop announces its stripe connect account id to a redis endpoing (key is the account id, value is the shop url)
- Stripe webhook router which routes webhooks to the correct shop
- A Redis hostname is set
- Redis is configured with password authentication
- Iptables are configured for redis
- Hostname is setup for stripe-connect-webhook-endpoint-router
- Hostname is setup for stripe-connect-account-announcer (listening on port 8001 by default)