Staging Environment Setup
Overview
main → production (shikshaos.triverseinfotech.com)staging → staging (staging-shikshaos.vercel.app or custom subdomain)
One-time setup
1. Create a staging Supabase project
Go to supabase.com → New project → name itshikshaos-staging. Apply all migrations to it:
2. Create the staging git branch
3. Configure Vercel
In the Vercel dashboard for this project:- Settings → Git → Production Branch — keep as
main - Settings → Environment Variables — for each variable in
.env.staging.example, add it scoped to Preview and set Git branch = staging
Variables that can be shared with production (same values):
NEXT_PUBLIC_LIVEKIT_*— can point to same LiveKit instanceSENTRY_DSN— same project, differentenvironmenttag
4. Verify the staging deploy
staging branch to a preview URL. Check the Vercel dashboard for the URL.
Deploy workflow
- Develop on a feature branch
- Open PR against
main— Vercel creates an ephemeral preview URL - After review, merge to
stagingfor full integration testing - When QA passes, merge
staging→mainto ship to production
Running crons against staging
Vercel Cron Jobs only run on production deployments. To test cron jobs against staging:Database migrations on staging
Always run migrations on staging first. PointDATABASE_URL at the staging project (Supabase dashboard → Project
Settings → Database → Connection string → URI), then:
schema_migrations in the
same transaction, so the two cannot drift. A failure rolls that migration back
and stops; earlier ones stay applied, so you fix the SQL and re-run.
The script prints the database host before doing anything — read that line
before confirming, so you never apply a staging migration to production.