Introducing the Larz SaaS Starter โ a complete SaaS in one file
A real, deployable SaaS โ accounts, a Pro plan, a billing portal and a metered API โ in about 120 lines of one file.
The fastest way to understand Larz is to run a whole product built on it. The
Larz SaaS Starter is exactly
that: a complete, deployable SaaS in a single app.py.
git clone https://github.com/larz-scripter/larz-saas-starter
cd larz-saas-starter
pip install -r requirements.txt
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
- Accounts โ register / login / logout with scrypt passwords.
- Free tier + Pro plan โ a 3-project free cap and a
@app.plan("pro")upgrade with a 7-day trial. - Billing portal โ the built-in
/larz/account(cancel, invoices, credits). - Metered API โ
@app.api_key_required+@app.metered("$0.01/call"), billed per key from prepaid credit. - Auto-admin โ
larz.adminover your models at/admin. - Templates with inheritance, background email on signup, rate limiting and a bot filter.
Ship it
Fill in a .env (a strong secret, your Stripe keys, SMTP) and deploy:
gunicorn -c deploy/gunicorn.conf.py app:app
The deploy/ folder has a Dockerfile, a systemd unit and an nginx config. Point your
Stripe webhook at /larz/webhook/stripe and you're taking money. The
free course walks through building this from scratch.
Get the starter Deployment docs
FAQ
Is the starter free?
Yes, it's MIT-licensed โ fork it, ship it, charge money.
Do I need Stripe keys to run it?
No. In development it uses a keyless mock provider and sqlite, so it runs with no accounts or keys. Add real keys in .env for production.
How big is it?
The whole SaaS is about 120 lines in one app.py, plus a handful of templates.
startersaas