What's inside SaaScaffold
One site, one database, one ledger
SaaScaffold is a source-code starter for a SaaS site. Your deployment has its own users, orders, credits, tasks and files. Inside that deployment, the modules share one database. A verified payment and the credits it grants commit together. The AI workflow also writes task outcomes and their credit movements together. A retry can then resolve against the original record instead of applying a second balance change.
The stack
The TypeScript application uses React and TanStack Start on Cloudflare Workers. It uses Drizzle with either Cloudflare D1 or PostgreSQL. Public and private files live in R2. Cloudflare Queues and Cron run background work, and the transactional email and Turnstile integrations can be configured for your site.
The modules
- Accounts and authentication. Email verification and password reset, Google sign-in, and explicit linking between sign-in methods.
- Payments and subscriptions. Stripe, PayPal, Waffo and Dodo Payments share order records and the credit ledger. A verified payment can grant credits for a one-time purchase or a paid subscription period.
- Credits. Grants expire by batch. Holds, deductions, releases and audited adjustments appear in the ledger. See how AI tasks reserve and settle credits.
- Storage and AI. Public and private files are separated. AI adapters connect to APIMart, fal.ai, Kie and SeeAPI for text, image, video, speech and music, depending on the model you enable.
- User workspace and admin. Customers can check their account, orders, files, credits and support tickets. Operators can manage the relevant modules and configure notifications.
- Agent runbooks. Claude Code and Codex can follow the repository’s runbooks for branding, local checks, configuration and Cloudflare release.
Local first
The starter can be run locally with D1 before configuring a Cloudflare account. A fresh checkout starts with the repository instructions:
pnpm install
cp apps/web/.dev.vars.example apps/web/.dev.vars
pnpm db:migrate
pnpm dev
The repository includes tests and a release check. PostgreSQL tests require a disposable test database.
What “done” means
An integration in the source can be configured and exercised separately on each deployment. Before enabling a payment, mail or AI provider, verify it with your own accounts and the release checklist. SaaScaffold Early Access gives you access to the private repository under a commercial license. See pricing and delivery for the email request process and what is included.