Skip to content

About

A complete, deployable money-native SaaS starter in one Python file — built on the Larz framework. Accounts, subscriptions, a metered API, an admin panel and deploy recipes.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

⚡ Larz SaaS Starter

A complete, deployable money-native SaaS in one Python file — accounts, a Pro plan with a trial, a self-serve billing portal, a metered API with API keys, an auto-admin panel, and background email. Built on Larz, with zero dependencies beyond Larz + gunicorn.

pip install -r requirements.txt
cp .env.example .env          # optional — dev works with no keys
python3 app.py                # http://127.0.0.1:8000

That's a working SaaS: sign up, hit the 3-project free-tier cap, upgrade to a 7-day Pro trial, manage billing at /larz/account, grab an API key, and call the metered API.

What's inside (~120 lines of app.py)

Feature How
Accounts larz.auth — register / login / logout, scrypt passwords
Free tier + Pro plan @app.plan("pro"), 7-day trial, 3-project free cap
Billing portal built-in /larz/account (cancel, invoices, credits)
Metered API @app.api_key_required + @app.metered("$0.01/call")
Auto-admin larz.admin over User and Project at /admin
Templates inheritance (base.html) + filters
Background email @app.money.on_grant → app.jobs.enqueue(...)
Security rate limiting + bot filter middleware
Config .env via ops.load_env()

Going to production

Fill in .env (a strong SECRET, STRIPE_KEY + STRIPE_WEBHOOK_SECRET, SMTP), then:

gunicorn -c deploy/gunicorn.conf.py app:app

The deploy/ folder has a Dockerfile, a systemd unit, an nginx.conf, and a gunicorn.conf.py. Point your Stripe webhook at /larz/webhook/stripe. See the Larz deployment docs.

Test

python3 tests/test_app.py     # 9 checks — signup, free-tier cap, upgrade, admin

Learn it

The free Larz course walks through building this from scratch. Full docs: larzos.com/larz/docs.

License

MIT — fork it, ship it, charge money.

About

A complete, deployable money-native SaaS starter in one Python file — built on the Larz framework. Accounts, subscriptions, a metered API, an admin panel and deploy recipes.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages