# Production-readiness checklist for AI-built apps

From Vinibyte (https://www.vinibyte.com/production-readiness-checklist.html). Free to share.

## Accounts and private data

- [ ] Each user can only read and change their own data (Sign in as a second user and try changing IDs in the app's network requests.)
- [ ] Database access rules are switched on (Row-level security in Supabase, security rules in Firebase, checks on every server endpoint.)
- [ ] Admin screens and admin API routes check the user's role on the server (Hiding a button in the interface is not enough.)
- [ ] Password reset and email verification work end to end (Try them with a real email address.)
- [ ] Sessions expire, and signing out actually ends the session

## Secrets and configuration

- [ ] No secret keys in frontend code (Search the deployed JavaScript for sk_, sk-, secret and your provider names.)
- [ ] Any key that was ever in frontend code has been rotated
- [ ] Production and test environments use different keys and databases
- [ ] Secrets are stored in the hosting provider's settings, not in the repository

## Payments

- [ ] Access is granted from the payment provider's webhook, not the success page
- [ ] Declined cards, expired cards and abandoned checkouts are handled (Use the provider's test cards for each case.)
- [ ] Subscription renewals, failures and cancellations update the app
- [ ] Refunds can be issued and are reflected in the app
- [ ] Invoices include the details you're legally required to show, such as GST

## Limits and running costs

- [ ] Sign-up, login and password reset are rate limited
- [ ] Every endpoint that calls a paid API is rate limited per user
- [ ] AI features have a per-user usage cap
- [ ] Budget alerts are set with your AI, hosting and database providers

## Data safety

- [ ] Automatic daily database backups are running
- [ ] You have restored a backup at least once to prove it works
- [ ] Database changes are made through reviewed migration files
- [ ] File uploads are checked for type and size

## Knowing when something breaks

- [ ] Errors are reported to a tracker such as Sentry
- [ ] An uptime check alerts you when the site is down
- [ ] Server logs are kept and searchable for at least a couple of weeks

## Changing things safely

- [ ] The code is in a Git repository you own
- [ ] A few automated tests cover sign-up, the main task and payment
- [ ] Tests run automatically before every deploy
- [ ] There's a staging copy of the app to try changes on before production

## Legal basics

- [ ] A privacy policy that matches what the app really collects
- [ ] Terms of service
- [ ] A way for users to delete their account and data (Expected under India's Digital Personal Data Protection Act, and under GDPR for users in Europe.)
- [ ] Cookie consent, if you use analytics or advertising cookies for users in Europe
