Overview
Clear every item before directing real users to a new deployment, and verify against the production build, not a local dev server. This page is the breakage, security, and observability counterpart to launch-a-new-site, which covers deploy order, DNS, and SEO sequencing. The security items are the gaps most often left open because each is an easy development shortcut and invisible until someone probes it; the broader threat model is owasp-top-10.
Verify the app renders and recovers
- No white screen or frozen spinner on first load. Check in an incognito window with devtools open, and read the console for unhandled rejections and hydration mismatches.
- Forms keep their values after a validation error.
- Wrap anything that fetches remote data, renders user content, or calls a third-party SDK in an error boundary (
<ErrorBoundary>in React,try/catchin server components), so one exception cannot blank the page. - Every route in the sitemap returns 200. Crawl for broken links with audit-checklist.
- Throttle devtools to Fast 3G and confirm loading states appear instead of blank frames.
Keep secrets out of the client bundle
Search the built output (dist/, .next/) for your key patterns. Private keys, service tokens, and database URLs must not appear in any file served to the browser (secrets-and-env).
Enable RLS on every table
Postgres leaves row-level security off by default, and tables created by raw SQL stay open. Run SELECT tablename, rowsecurity FROM pg_tables WHERE schemaname = 'public'; and require true everywhere. A table with RLS off and a public Data API key exposes all rows to any request. Policies: supabase-rls.
Rate-limit auth and public endpoints
Login, signup, and password reset need limits before launch; automated attempts start soon after a hostname goes live. A starting point to tune against real traffic: 5 login attempts per 15 minutes per IP and 3 password resets per hour. Give general public endpoints a generous ceiling too. Cloudflare WAF rules or middleware both work; pick one and confirm it fires.
Enforce auth on every protected route and handler
Write a test that calls each protected endpoint without a session and expects 401, not data. Commented-out guards from development are easy to forget (auth-sessions).
Validate input on the server
Client validation is a UX courtesy; server-side validation is the security control.
Authenticate transactional email
Set SPF, DKIM, and DMARC on the sending domain so password resets and receipts do not land in spam (email-deliverability).
Cover the legal basics
- Privacy policy and terms linked from the footer before any data is collected (GDPR and CCPA expect the policy to be reachable).
- Cookie consent if you set non-essential cookies (analytics, ads, A/B buckets) for EU or UK visitors. A login-only session cookie is usually exempt; confirm with counsel.
- Payments: know whether your processor (payments-stripe) is merchant of record or you must remit sales tax. It rarely blocks a small launch, but ignoring it creates retroactive liability.
Wire error tracking before users arrive
Install the tracker in the production environment and confirm a test error reaches the dashboard, so a wrong DSN is not discovered during a 3 AM outage (error-tracking). Define the on-call process in incident-response.
Copy-paste checklist
## Pre-launch checklist
### Day-one breakage
- [ ] No white screen or spinner on first load (incognito)
- [ ] Console clear of unhandled rejections and hydration errors
- [ ] Forms keep values after validation errors
- [ ] Error boundaries on remote-data and third-party components
- [ ] All sitemap routes return 200
- [ ] Tested on Fast 3G throttle
### Security
- [ ] Built output searched for secret patterns; none found
- [ ] RLS enabled on every public-schema table (pg_tables)
- [ ] Auth endpoints rate-limited; public endpoints have a ceiling
- [ ] Every protected route returns 401 without a session
- [ ] Server-side validation on all form and API handlers
- [ ] SPF, DKIM, DMARC set on the sending domain
### Legal / ops
- [ ] Privacy policy and terms linked from footer
- [ ] Cookie consent assessed
- [ ] Payment tax and merchant-of-record exposure documented (if taking payments)
### Observability
- [ ] Error tracker verified in production with a test error
- [ ] On-call and incident process defined