Skip to content

SV4: sveltekit-saas becomes an Orun baseline - #5

Merged
ruehowl merged 1 commit into
mainfrom
sv/4-a-baseline
Oct 28, 2026
Merged

ruehowl merged 1 commit into
mainfrom
sv/4-a-baseline

Conversation

@ruehowl

@ruehowl ruehowl commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

This PR makes sveltekit-saas an Orun baseline. One build takes a new SvelteKit SaaS from nothing to live on stage and prod, in its own repository, in one landing. It is built on saas-starter's baseline machinery, with this product's chain and no Hyperdrive.

What a build does

  • 01-product creates the repository, mints the Cloudflare and Supabase credentials, and lands the product as one PR.
  • Its merge converges supabase → db-migrate → web per environment. Each edge is enforced on a push to main and advisory on a PR.
  • Before verifying, the bootstrap waits for the service-role key to be published on stage and prod (orun.secrets/exists). The web lane reads that key only as an optional ref, and only that environment's deploy pushes it to the Worker.
  • 02-docs records the live deployment from probed facts. That includes whether Stripe and email are connected, read from each environment's /api/health.
  • Stripe and Resend stay the owner's to connect afterwards; the card asks for neither.

What is added

  • The card and build document: blueprint.yaml (requires GitHub, Cloudflare and Supabase; four secrets; ~14 min) and repo-blueprint.yaml (01-product 13 min + 02-docs 1 min).
  • .baseline/ (identity, the product's README, task contracts), BOOTSTRAP.md, docs/phases/ and ai/context/.
  • The rename engine. Its product-name seam is WebsiteName in apps/web/src/config.ts; the links to CMSaasStarter stay as credits.
  • The bootstrap helpers (tooling/bootstrap/), the deployment-record renderer (hooks/) and the catalog's component docs.
  • baseline.yml and tag.yml.

Tests, all green locally

  • The contract tiers: manifest, phases, coverage, rebrand, retouch, bootstrap-defer, and component docs --check.
  • The leak gate, and placement (the offline bootstrap and the product's own plans).
  • The e2e, end to end:
    • The 01-product landing's checks, then terraform validate.
    • A Supabase project stood in for (testing/lib/fake-supabase-api.py): Postgres with Supabase's roles, the auth and storage schemas, Auth with its admin API, the Data API calls the app makes, and the Management API's query endpoint.
    • The db-migrate lane applies the template's migrations verbatim: the trigger, the avatars bucket and its policies.
    • The stage web lane runs in its staged job tree. The service-role key ends up in no bundle.
    • Served without the key, the Worker fails its own smoke. With the key it passes, and every route answers.
    • The user flow: sign-up, the profile (written by the trigger, completed under RLS), dashboard, billing without Stripe, settings, the email opt-out, the contact form via the service role, a second user, sign-in, sign-out, and an account deleted.
    • Row-level security, as the Data API's roles see it.

Fixed along the way: SvelteKit runs universal loads on the server too, and its server-side fetch enforces CORS there as a browser does. So the stand-in answers with the CORS headers Supabase's gateway sends.


Generated by Claude Code

One build takes a new SvelteKit SaaS from nothing to live on stage and
prod in one landing: 01-product creates the repository, mints the
Cloudflare and Supabase credentials and lands the product, whose merge
converges supabase → db-migrate → web per environment; the bootstrap
awaits the service-role key's publication on stage and prod before it
verifies; 02-docs records the deployment, Stripe and email included.

Built on saas-starter's baseline machinery (card, build document, rename
engine with its seam at WebsiteName in apps/web/src/config.ts, bootstrap
helpers, deployment-record renderer, test tiers), without Hyperdrive.
The e2e serves the built Worker a Supabase project stood in for — the
auth and storage schemas, Auth with its admin API, the Data API calls
the app makes (with Supabase's CORS headers: SvelteKit's server fetch
enforces CORS in universal loads), the Management API's query endpoint —
and takes a user from sign-up to a deleted account.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019PcpNVpFBcbeiX3EHdXfmn
@ruehowl
ruehowl marked this pull request as ready for review October 28, 2026 23:20
@ruehowl
ruehowl merged commit 833254a into main Oct 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants