Чек-лист продакшен-деплоя Supabase: RLS, ключи, бэкапы, мониторинг.

Звёзды2 926
Авторjeremylongshore
Установок28

Установка

SKILL.md

Supabase Production Deployment Checklist

Overview

Actionable 14-step checklist for taking a Supabase project to production, based on Supabase's official production guide. Each step below carries its verification checklist inline; the full SQL, TypeScript, and CLI commands for every step live in references/step-commands.md.

Prerequisites

  • Supabase project on Pro plan or higher (required for PITR, network restrictions)
  • Separate production project (never share dev/prod)
  • @supabase/supabase-js v2+ installed
  • Supabase CLI installed (npx supabase --version)
  • Domain and DNS configured for custom domain
  • Deployment platform ready (Vercel, Netlify, Cloudflare, etc.)

Instructions

Work top to bottom. Every checkbox must be satisfied before go-live. Each step names the commands to run; copy them from references/step-commands.md.

Step 1: Enforce Row Level Security on ALL Tables

RLS is the single most critical production requirement. Without it, any client with your anon key can read/write every row. Start with the audit query — it must return zero rows before going live:

-- Find tables WITHOUT RLS enabled (must return zero rows before launch)
SELECT schemaname, tablename, rowsecurity
FROM pg_tables
WHERE schemaname = 'public' AND rowsecurity = false;

Then ALTER TABLE ... ENABLE ROW LEVEL SECURITY and add per-command policies — full CREATE POLICY patterns in step-commands.md.

  • <!-- -->RLS enabled on every public table (zero rows from audit query above)
  • <!-- -->SELECT, INSERT, UPDATE, DELETE policies defined for each table
  • <!-- -->Policies tested with both authenticated and anonymous roles
  • <!-- -->No tables use USING (true) without intent (public read tables only)

Step 2: Enforce Key Separation — Anon vs Service Role

The anon key is safe for client-side code. The service_role key bypasses RLS entirely and must never leave server-side environments. See the two-client setup in step-commands.md.

  • <!-- -->Anon key used in all client-side code (NEXT_PUBLIC_ prefix)
  • <!-- -->Service role key used only in server-side code (API routes, Edge Functions)
  • <!-- -->Service role key not in any client bundle (verify with grep -r "service_role" dist/)
  • <!-- -->Database password changed from the auto-generated default

Step 3: Configure Connection Pooling (Supavisor)

Supabase uses Supavisor for pooling. Serverless functions (Vercel, Netlify, Cloudflare Workers) MUST use the pooled connection string (port 6543) to avoid exhausting the database connection limit — direct connections (port 5432) are for migrations and admin tasks only. Connection strings and client config in step-commands.md.

  • <!-- -->Application code uses pooled connection string (port 6543)
  • <!-- -->Direct connection reserved for migrations and admin tasks only
  • <!-- -->Connection string in deployment platform env vars (not hardcoded)
  • <!-- -->Verified pool mode: transaction for serverless, session for long-lived connections

Step 4: Enable Database Backups

Supabase provides automatic daily backups on Pro plan. Point-in-time recovery (PITR) enables granular restores.

  • <!-- -->Automatic daily backups enabled (Pro plan — verify in Dashboard > Database > Backups)
  • <!-- -->Point-in-time recovery configured (Dashboard > Database > Backups > PITR)
  • <!-- -->Tested restore procedure on a staging project (do not skip this)
  • <!-- -->Migration files committed to version control (supabase/migrations/ directory)
  • npx supabase db push tested against a fresh project to verify migrations replay cleanly

Step 5: Configure Network Restrictions

Restrict database access to known IP addresses. This prevents unauthorized direct database connections even if credentials leak.

  • <!-- -->IP allowlist configured (Dashboard > Database > Network Restrictions)
  • <!-- -->Only deployment platform IPs and team office IPs are allowed
  • <!-- -->Verified that application still connects after restrictions applied
  • <!-- -->Documented which IPs are allowed and why

Step 6: Configure Custom Domain

A custom domain replaces the default *.supabase.co URLs with your brand domain for API and auth endpoints.

  • <!-- -->Custom domain configured (Dashboard > Settings > Custom Domains)
  • <!-- -->DNS CNAME record added and verified
  • <!-- -->SSL certificate provisioned and active
  • <!-- -->Application code updated to use custom domain URL
  • <!-- -->OAuth redirect URLs updated to use custom domain

Step 7: Customize Auth Email Templates

Default Supabase auth emails show generic branding. Customize them so users see your domain and brand.

  • <!-- -->Confirmation email template customized (Dashboard > Auth > Email Templates)
  • <!-- -->Password reset email template customized
  • <!-- -->Magic link email template customized
  • <!-- -->Invite email template customized
  • <!-- -->Custom SMTP configured (Dashboard > Auth > SMTP Settings) — avoids rate limits and improves deliverability
  • <!-- -->Email confirmation enabled (Dashboard > Auth > Settings)
  • <!-- -->OAuth redirect URLs restricted to production domains only
  • <!-- -->Unused auth providers disabled

Step 8: Understand Rate Limits Per Tier

Supabase enforces rate limits that vary by plan. Hitting these in production causes 429 errors.

ResourceFreeProTeam
API requests500/min1,000/min5,000/min
Auth emails4/hour30/hour100/hour
Realtime connections200 concurrent500 concurrent2,000 concurrent
Edge Function invocations500K/month2M/month5M/month
Storage bandwidth2GB/month250GB/monthCustom
Database size500MB8GB50GB
  • <!-- -->Rate limits documented for your plan tier
  • <!-- -->Client-side retry logic with exponential backoff for 429 responses
  • <!-- -->Auth email rate limits understood (use custom SMTP to increase)
  • <!-- -->Realtime connection limits planned for expected concurrent users

Step 9: Review Monitoring Dashboards

Supabase provides built-in monitoring. Review these before launch to establish baselines, and deploy a health check endpoint (full route handler in step-commands.md).

  • <!-- -->Dashboard > Reports reviewed (API requests, auth, storage, realtime)
  • <!-- -->Dashboard > Logs > API checked for error patterns
  • <!-- -->Dashboard > Database > Performance Advisor reviewed and recommendations applied
  • <!-- -->Health check endpoint deployed and monitored (uptime service)
  • <!-- -->Error tracking configured (Sentry, LogRocket, etc.)
  • <!-- -->Alerts set for: error rate spikes, high latency, connection pool exhaustion

Step 10: Deploy Edge Functions with Proper Env Vars

Edge Functions run on Deno Deploy. Set environment variables via the Supabase CLI or Dashboard, not hardcoded. Secret commands and a webhook function template in step-commands.md.

  • <!-- -->All Edge Functions deployed to production (npx supabase functions deploy)
  • <!-- -->Environment secrets set via npx supabase secrets set (not hardcoded)
  • SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY available automatically (no need to set)
  • <!-- -->Edge Functions tested with npx supabase functions serve locally before deploying
  • <!-- -->CORS headers configured for Edge Functions that receive browser requests

Step 11: Verify Storage Bucket Policies

Storage buckets need explicit policies, similar to RLS on tables. Without policies, buckets are inaccessible (default deny). Inspection queries and example policies in step-commands.md.

  • <!-- -->Each bucket has explicit SELECT/INSERT/UPDATE/DELETE policies
  • <!-- -->Public buckets are intentionally public (not accidentally open)
  • <!-- -->File size limits set per bucket (file_size_limit in bucket config)
  • <!-- -->Allowed MIME types restricted per bucket (allowed_mime_types)
  • <!-- -->User upload paths scoped to auth.uid() to prevent overwrites

Step 12: Add Database Indexes on Frequently Queried Columns

Missing indexes are the leading cause of slow queries after launch. Add indexes on foreign keys, filter columns, and sort columns. Diagnostic queries (missing-index, slow-query, table-bloat) and index DDL in step-commands.md.

  • <!-- -->Indexes on all foreign key columns
  • <!-- -->Indexes on columns used in WHERE, ORDER BY, and JOIN clauses
  • pg_stat_statements enabled for ongoing query monitoring
  • <!-- -->Performance Advisor reviewed (Dashboard > Database > Performance)
  • statement_timeout set for authenticated role to prevent runaway queries
  • <!-- -->Table bloat checked — VACUUM if dead tuple percentage > 10%

Step 13: Apply Migrations with npx supabase db push

All schema changes must go through migration files, never manual Dashboard edits in production. Migration commands in step-commands.md.

  • <!-- -->All schema changes in supabase/migrations/ directory (version controlled)
  • npx supabase db push tested against a fresh project
  • <!-- -->Migration history matches between local and remote (npx supabase migration list)
  • <!-- -->Rollback migration prepared for risky schema changes
  • <!-- -->No manual schema edits in production Dashboard

Step 14: Pre-Launch Final Verification

Run the final linked-project verification commands in step-commands.md, then confirm:

  • <!-- -->CORS settings match production domain (Dashboard > API > CORS)
  • <!-- -->Environment variables set correctly in deployment platform
  • <!-- -->Realtime enabled only on tables that need it (reduces connection usage)
  • <!-- -->Webhook endpoints registered and tested
  • <!-- -->Load test completed on staging (see supabase-load-scale)
  • <!-- -->SSL enforcement enabled (Dashboard > Database > Settings > SSL)
  • <!-- -->DNS and custom domain verified end-to-end

Output

  • All 14 checklist sections verified with zero unchecked items
  • RLS enforced on every public table with tested policies
  • Key separation verified (anon client-side, service_role server-side only)
  • Connection pooling via Supavisor (port 6543) for all application code
  • Backups, PITR, monitoring, Edge Functions, Storage policies, indexes all verified
  • Migrations applied cleanly via npx supabase db push

Error Handling

Common go-live failures and their fixes. Full catalog (with HTTP status codes, alert thresholds, and a Supabase error-code switch handler) in references/errors.md.

IssueCauseSolution
403 Forbidden on all API callsRLS enabled but no policies createdAdd SELECT/INSERT/UPDATE/DELETE policies for each role
429 Too Many RequestsPlan rate limit exceededUpgrade plan or implement client-side backoff with retry
Connection timeout under loadUsing direct connection in serverlessSwitch to pooled connection string (port 6543)
Auth emails not deliveredDefault SMTP rate-limitedConfigure custom SMTP provider (SendGrid, Resend, Postmark)
PGRST301 permission deniedService role key used where anon expectedCheck client initialization — use anon key for client-side
Storage upload failsMissing bucket policy or size limit exceededAdd INSERT policy and check file_size_limit on bucket
Slow queries after launchMissing indexes on filter/join columnsRun Performance Advisor and add indexes per Step 12
Migration conflictsManual Dashboard edits diverged from migration filesRun npx supabase db diff to capture drift, then commit

Examples

Lean patterns below; complete, copy-paste versions (Next.js client setup, health check endpoint, full RLS policy set, storage policies, Edge Functions, rollback) in references/examples.md.

RLS Policy Pattern

ALTER TABLE public.posts ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Public read published" ON public.posts
  FOR SELECT USING (status = 'published');
CREATE POLICY "Authors manage own" ON public.posts
  FOR ALL USING (auth.uid() = author_id)
  WITH CHECK (auth.uid() = author_id);

Rollback

npx supabase migration new rollback_bad_change  # Create reversal SQL
npx supabase db push                             # Apply rollback
# For data: Dashboard > Database > Backups > PITR
# For app: vercel rollback / netlify deploy --prod

Resources

  • references/step-commands.md — Full SQL/TypeScript/CLI for every step
  • references/examples.md — Complete copy-paste code patterns
  • references/errors.md — Error catalog + alert thresholds
  • references/implementation.md — Pre-deploy config + post-launch monitoring
  • Going to Production — Official production checklist
  • Maturity Model — Project lifecycle stages
  • Shared Responsibility Model — What Supabase manages vs. what you manage
  • Connection Pooling — Supavisor configuration
  • RLS Guide — Policy patterns and examples
  • Edge Functions — Serverless Deno functions
  • Хранилище — файловое хранилище с политиками

Дальнейшие шаги

  • Об обновлении версии SDK см. supabase-upgrade-migration
  • О нагрузочном тестировании перед запуском см. supabase-load-scale
  • О мониторинге в продакшене см. supabase-monitoring
  • О шаблонах Edge Functions см. supabase-edge-functions

Вставить в README

Ссылка на карточку для вашего README — без картинок и счётчиков.

[DarkPlay: supabase-prod-checklist](https://darkplay.ru/ai/skills/jeremylongshore-claude-code-plugins-plus-skills-supabase-prod-checklist)

Похожие скиллы и другие разделы каталога

Популярное в разделе «Скиллы»

Самые востребованные скиллов раздела по установкам и звёздам.

find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
4 400 000 устан.
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
1 600 000 устан.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
1 600 000 устан.
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
1 600 000 устан.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
1 600 000 устан.
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
1 500 000 устан.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
1 400 000 устан.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
1 300 000 устан.
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
1 300 000 устан.
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.
1 300 000 устан.
Похожее в других разделах каталога

Соседние разделы каталога: возможно, нужный инструмент живёт там.

eccaffaan-m · Нативный для harness операторский слой ECC: 67 агентов, 278 навыков, 94 шима устаревших…
441 комп.
Agent Evaluatoraffaan-m · Оценивает результат агента по рубрике качества из 5 критериев (точность, полнота…
225 587 ★
Database Revieweraffaan-m · Специалист PostgreSQL: оптимизация запросов, схемы, безопасность, Supabase.
225 587 ★
Django Revieweraffaan-m · Ревьюер Django: ORM, DRF, миграции, безопасность и production-практики.
225 587 ★
Fastapi Revieweraffaan-m · Проверяет FastAPI-приложения: async, DI, Pydantic, безопасность, OpenAPI и тесты.
225 587 ★
Gan Planneraffaan-m · GAN Harness — агент-планировщик: разворачивает промпт в полную спецификацию продукта.
225 587 ★
Marketing Agentaffaan-m · Маркетинг-стратег и копирайтер: кампании, позиционирование, тексты и контент-планы.
225 587 ★
Mle Revieweraffaan-m · Ревьюер ML-инженерии: данные, признаки, обучение, оценка, сервинг и мониторинг.
225 587 ★
Opensource Packageraffaan-m · Готовит open-source упаковку: CLAUDE.md, README, LICENSE, CONTRIBUTING и шаблоны.
225 587 ★
Spec Mineraffaan-m · Извлекает поведенческие спецификации из кода для OpenSpec в виде блоков Requirement и…
225 587 ★

Лучшие ИИ-инструменты для генерации видео

Генерация видео

Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,

VEED.IOVeed
По запросу
5.0
MootionMootion
По запросу
5.0
FlyviFlyvi
Есть бесплатный тариф
4.9
Google Veo 3.1Google
Платно
4.9
Sora (OpenAI)OpenAI
Платно
4.9
PikaPika
Платно
4.9
captions space
Есть бесплатный тариф
4.8
Клайп
Есть бесплатный тариф
4.8
viralpulse.appViralpulse
По запросу
4.8
Viral Maker AIViral-maker
Есть бесплатный тариф
4.8

Лучшие ИИ-инструменты для генерации текста и копирайтинга

Генерация текста и копирайтинг

Подборка нейросетей для генерации текстов и копирайтинга. Сервисы, которые помогают создавать статьи, посты и рекламные объявления с нуля или по черновику, экономя часы рутинной ра

NeuroscribeNeuroscribe
Есть бесплатный тариф
5.0
GoGPTGogpt
По запросу
5.0
ChatsonicChatsonic
По запросу
4.9
НейроТекстерNeuro-texter
По запросу
4.9
ChatGPTOpenAI
По подписке
4.9
Редактум
Есть бесплатный тариф
4.8
ChadGPTChadgpt
По запросу
4.8
Cosmo ScribeCosmoscribe
Есть бесплатный тариф
4.8
Memo HelperCopilot33
По запросу
4.8
LibraChatLibrachat
Есть бесплатный тариф
4.8

Лучшие ИИ-инструменты для генерации изображений

Генерация изображений

Подборка нейросетей для генерации изображений от фотореализма до концепт-арта. Сервисы, которые экономят часы ручной работы, создавая визуал для блогов, рекламы и дизайна за минуты

MagviMagvi
По запросу
5.0
DALL-E 3OpenAI
По подписке
5.0
SupaLabSupalab
По запросу
5.0
Freestyling.aiFreestyling
Есть бесплатный тариф
4.9
ArtGeneration.meArtgeneration
Есть бесплатный тариф
4.9
BigjpgBigjpg
По запросу
4.9
Художник от VKVK
Бесплатно
4.9
Wonderink — ИИ-книги
Есть бесплатный тариф
4.8
Avato AI12ai
По запросу
4.8
Virton AIVirton
По запросу
4.8