FastAPI SaaS backend checklist
Most B2B SaaS backends need the same plumbing before the first customer can pay. Here is a checklist of the parts that are easy to get subtly wrong, in the order you will usually hit them.
1. Authentication
- Short-lived access tokens (about 15 minutes) and rotating refresh tokens.
- Refresh-token reuse detection: if an old refresh token is replayed, revoke the whole session family.
- Email verification and password reset with single-use tokens stored hashed.
- Rate limits on login and reset endpoints, and the same response for known and unknown emails (no account enumeration).
2. Teams and tenants
- Every user belongs to an organization; roles such as owner, admin and member.
- Every query is filtered by organization. Other tenants' records should return 404, not 403.
- Add and remove members, and prevent removing the last owner.
3. API keys
- Per-organization keys sent in a header such as
X-API-Key. - Show the key once, store only a hash, allow revoking, record last use.
4. Billing with Stripe
- Checkout for new subscriptions and the Customer Portal for changes and cancellations.
- Verify the webhook signature and make handlers idempotent: Stripe retries events.
- Sync the plan from webhooks, not from the browser redirect; decide what happens when a payment is past due.
5. Plan limits
Keep plans in one table (projects, members, API keys per plan) and enforce them in one place, returning HTTP 402 when a limit is hit.
6. Operations
- Dockerfile running as a non-root user, a health check, and PostgreSQL migrations with Alembic that you have tested both up and down.
- Health and readiness endpoints, request IDs in logs, CORS configured on purpose, CI that runs the tests.
Skip the plumbing: LaunchPad API starter
If you would rather start from code that already covers this list, LaunchPad API: FastAPI SaaS Starter is a $29 one-time download with a commercial developer license. It includes all six areas above, 50 automated tests and docs for Stripe setup, deployment and customization. Tests are re-runnable from the README.
Honest scope: it is a JSON API backend, not a UI. Social login, 2FA, background job queues, file uploads and invitation emails are not included; the docs show where each one plugs in. You are responsible for reviewing and securing your own deployment.
Building the public side of your SaaS? Use our free meta tag generator, security headers generator and sitemap validator.