How to build a SaaS website from scratch (architecture, legal and launch)
To build a SaaS website that can actually take money and run reliably, you need far more than a landing page and a database table: you need authentication, server-verified billing and subscriptions, an auditable ledger or entitlement layer, private file storage, background job recovery, and an admin panel for refunds and support. Your main decision on day one is whether to hand-build that shared plumbing from scratch or start from a tested SaaS codebase and spend your time on the product feature customers pay for.
This guide breaks down the exact modules every paid SaaS website needs, compares building from scratch against using a starter, answers whether you need an LLC before launching, and walks through a six-step launch checklist.
What actually makes a SaaS website different from a normal site?
A brochure site or blog only serves content. A SaaS website manages stateful customer accounts and recurring money. Before writing code, list the six infrastructure layers your app will depend on:
- Accounts and authentication: Email verification, password reset, OAuth (such as Google sign-in), bot protection and session management.
- Database and schema migrations: Repeatable migrations so you can evolve tables safely without wiping production data.
- Billing, subscriptions and entitlements: Checkout creation, signature-verified webhooks, idempotent event handling (so a retried webhook never grants access twice), renewals and refunds.
- File storage with access control: Public assets served fast, paired with private user outputs or deliverables served only after permission checks.
- Background queues and failure recovery: Long-running tasks (reports, exports, AI generation) decoupled from HTTP requests so stalled jobs recover without double-charging users.
- Operations and admin tools: User lookup, order/refund handling, audit logs, transactional email and operational alerts.
Building from scratch vs. starting from a SaaS starter
Writing every layer yourself is a good way to learn, but it usually delays your first paying customer by weeks or months. Compare the three common approaches:
| Approach | Time to first live checkout | Maintenance & upgrade burden | Best for |
|---|---|---|---|
| Build every layer from scratch | Several weeks to months | Full control, but you maintain auth, webhooks, refunds, migrations and deployment scripts alone | Teams with highly unusual compliance or architecture requirements |
| Assemble open-source snippets / tutorials | 2–4 weeks | High glue-code risk; auth, billing and job queues rarely share one atomic transaction model | Developers experimenting with prototypes |
| Production SaaS starter (such as SaaScaffold, our own starter) | Days | Core billing, auth, ledger, storage and deployment runbooks come pre-wired and tested | Indie builders and small teams who want to ship their unique feature fast on their own cloud account |
Disclosure: SaaScaffold is our own commercial source-code starter. If your product is a simple free tool with no accounts or billing, you do not need a full SaaS starter.
Step-by-step: how to build and launch a SaaS website
1. Define one paid workflow and pricing unit
Pick one narrow problem and decide how customers pay for it before designing your database:
- Recurring subscription: Monthly or yearly access (optionally with periodic credit grants).
- One-time credit packs: Pay-as-you-go usage for variable workloads such as AI generation, exports or API jobs.
- Hybrid: A subscription that grants monthly credits plus top-up packs when heavy users run out.
2. Choose a stack you can run locally and deploy cheaply
Pick a stack that lets you develop locally without cloud bills and deploy without managing raw Linux servers. A modern single-runtime option is TypeScript + React (TanStack Start) on Cloudflare Workers, paired with Cloudflare D1 or PostgreSQL, R2 for files, and Queues/Cron for background work.
3. Implement auth, billing and atomic entitlements together
The most common production bugs in early SaaS apps happen at the boundary between payment webhooks and user balances:
- Snapshot the product, price and currency on your server before opening checkout.
- Never trust the browser return URL as proof of payment; verify server-side webhooks or query the provider API.
- Write the payment record and the granted credits or subscription state inside one atomic database transaction, with idempotency checks so duplicate webhooks are safely ignored.
4. Build your core product feature in isolation
Keep your domain-specific pages, copy and database tables separated from shared infrastructure code. That keeps your codebase readable and makes future dependency or base updates low-risk.
5. Publish required trust and policy pages
Before payment providers approve live accounts, they typically review your live domain for:
- Clear pricing and product descriptions
- Terms of Service, Privacy Policy and Refund Policy
- A working support email address and contact page
6. Test in sandbox mode before opening live payments
Run end-to-end checks in test mode: sign up, verify email, buy a test plan or credit pack, confirm the webhook grants access once, trigger a refund, and verify mobile layout and canonical HTTPS redirects.
Do you need an LLC to build and launch a SaaS?
Note: This is general operational information, not legal or tax advice. Confirm requirements with a qualified accountant or lawyer in your jurisdiction.
No—in most jurisdictions you do not legally need an LLC just to build a website, validate demand, or launch an MVP. Many solo founders start as a sole proprietor and form an LLC (or local equivalent company) once revenue becomes meaningful or they want personal liability separation and a dedicated business bank account.
Two practical checkpoints matter early:
- Payment processor onboarding: Some providers accept individuals (sole proprietors), while others require a registered business entity depending on your country.
- Global sales tax and VAT: Selling digital subscriptions worldwide can trigger tax obligations across regions. Using a Merchant of Record (MoR) such as Dodo Payments shifts sales tax and VAT collection/remittance to the provider, which significantly reduces early compliance work compared to managing tax filings yourself.
How SaaScaffold accelerates a Cloudflare Workers SaaS
If you want to skip rebuilding auth, billing, storage and deployment plumbing from scratch, SaaScaffold provides the full TypeScript monorepo running in your own Cloudflare account:
- Local-first development: Start locally with D1, queue and cron emulation before setting up any cloud resources (
pnpm install,cp apps/web/.dev.vars.example apps/web/.dev.vars,pnpm db:migrate,pnpm dev). - Four payment providers on one atomic ledger: Stripe, PayPal, Waffo and Dodo Payments share one order flow and credit ledger, supporting one-time credit packs and subscriptions with verified webhooks, test mode (
admin_test) and refunds. See how one ledger handles four payment providers. - Optional AI task pipeline: APIMart, fal.ai, Kie and SeeAPI adapters for text, image, video, speech and music, using a freeze-then-settle credit flow and lease-based recovery for stalled jobs.
- Extend without forking the base: Your site config, copy, pages and site migrations live in dedicated site-owned files so you can keep merging upstream base updates cleanly.
- 40 agent runbooks: Claude Code and Codex follow the Markdown runbooks in
agents/for branding, pre-launch checks, Cloudflare setup and controlled deployment viapnpm release.


License boundary: SaaScaffold’s standard commercial license lets you build and operate unlimited SaaS sites that you own and operate. Client/agency builds or redistributing the source code require a separate written license (software license).
Five common mistakes when launching your first SaaS
- Spending months on infrastructure before talking to users: Ship the smallest working paid flow first.
- Using only one payment provider without checking regional eligibility: Stripe does not cover every country, and many buyers prefer PayPal or need VAT invoices handled by a MoR.
- Mutating live subscription definitions in place: Once a subscription plan is sold, treat its ID and terms as immutable; create a new plan ID for new pricing so existing renewals stay intact.
- Putting secrets in
.envfiles committed to Git: Keep production payment, mail and AI keys exclusively in encrypted Worker Secrets. - Skipping automated end-to-end payment and recovery tests: A single double-grant or missed-webhook bug costs far more in support time than writing tests upfront.
Next steps
- Review what is inside SaaScaffold to see the full module list and stack.
- Explore multi-provider payments and subscriptions or SaaScaffold Early Access pricing.