Environments and deployment
QA Sync’s production runtime is a static single-page app on Vercel plus a production Supabase project. There’s no application server to deploy.
Environments
Section titled “Environments”| Environment | Frontend | Supabase |
|---|---|---|
| Local | npm run dev on port 3000 |
Local stack in Docker (supabase start) |
| Preview | Vercel preview deployments | As configured in the Vercel project |
| Production | Vercel production deployment | Production Supabase project |
Browser environment variables
Section titled “Browser environment variables”The frontend needs only two public, browser-safe values:
VITE_SUPABASE_URL="https://<project-ref>.supabase.co"VITE_SUPABASE_ANON_KEY="<production anon key>"Set them in the Vercel project settings (or in a local .env.production when validating a release build).
Set up the production Supabase project
Section titled “Set up the production Supabase project”-
Create the Supabase project.
-
Link the repository to it:
Terminal window supabase link --project-ref <project-ref> -
Apply migrations (this targets the linked production project; run it only when you intend to):
Terminal window supabase db push -
Configure Auth:
- Site URL and Redirect URLs: the production frontend origin.
- Sign-up: disabled. QA Sync never offers public sign-up.
- Email confirmation: choose the policy deliberately.
-
Verify the storage buckets created by migrations exist:
feedback-attachments,task-request-attachmentsandqa-evidence.
First admin
Section titled “First admin”Signing in never makes anyone an admin: an account gets a role only when an admin provisions it (or, later, from an accepted organisation invitation). Make the first QA Sync platform operator by hand in the Supabase SQL editor with insert into public.platform_admins (user_id) select id from auth.users where email = '<operator email>';, give the first organisation admin their role deliberately, confirm they can reach /app/admin, and provision everyone else from the admin workspace.
Deploy the frontend
Section titled “Deploy the frontend”-
Set the production env vars in Vercel.
-
Validate the env contract:
Terminal window npm run validate:prod-env -
Build:
Terminal window npm run build -
Deploy. One Vercel project serves everything from the repository root:
vercel.jsonrunsnpm run build, which builds both apps and assemblesdist/with the landing page at/, these docs at/docs/and the web app at/app/. Every/app/...path is rewritten to the app’sindex.htmlso direct refreshes on/app/admin,/app/testerand the other workspace routes load the SPA. The old paths (/app/login,/app/admin,/app/tester, …) redirect to their/app/...equivalents.
The landing page and these docs are the apps/landing workspace (Astro Starlight). They ship in the same Vercel project as the app, and the request form reuses the app’s VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY, so no extra variables are needed. Set the production Supabase Site URL (Authentication → URL Configuration) to https://<your-domain>/app so auth emails link into the app. Run npm run preview to check the assembled site locally with the same redirects and rewrites.
Website forms and email
Section titled “Website forms and email”Get started (/get-started) and Book a demo (/book-demo) post to the public-forms Supabase Edge Function, which validates and rate-limits the request, stores it (access_requests or demo_requests) and emails the QA Sync team through Resend. Deploy it with supabase functions deploy public-forms and set its secrets with supabase secrets set RESEND_API_KEY=<key> NOTIFY_EMAIL=<address>. Locally, run supabase functions serve next to npm run dev; without a Resend key the forms still work and the email is logged. The full guide is docs/website-forms-and-email.md in the repository.
Release gates
Section titled “Release gates”Don’t publish if any of these are true:
- the production login shows dev-only login shortcuts;
- a direct route refresh returns a host 404;
- admin access depends on manual table patching after login;
- a task-request publish changes status without creating a real task outcome;
- critical flows only work against local Supabase.
Also confirm before release:
npm run validate:prod-envpasses and the production build succeeds;- public sign-up is disabled;
- Supabase diagnostics don’t appear on the login page or non-admin screens;
- immutable audit logging is enabled for privileged access and workflow mutations;
- local demo accounts aren’t used for production access.
Smoke test after deploy
Section titled “Smoke test after deploy”- Open the production login page. Confirm no dev login shortcuts or Supabase diagnostics are shown.
- Sign in as an admin and confirm you reach
/app/admin. - Create or check one tester and one developer through Users, with explicit app access.
- Confirm the tester and developer reach their own workspaces and see only their apps.
- As admin, create or update a task with instructions and an expected result.
- Move it to Staging; as the tester, record one passing and one failing QA run.
- As the developer, triage an issue and send one suggestion for admin review.
- As admin, review and publish the resulting task request.