Skip to content
← Back to the blog
infrastructureproduct

Do you need a staging environment for a small app?

When a small app needs a staging environment, and a simple setup with a second Supabase project, branch previews and Stripe test mode that costs little to run.

By Devonauts Team5 min read
Leer en español →
Code on a laptop screen with a test panel showing that all tests passed, against orange striped light

You need a staging environment as soon as your app has real users, real payments or data you can't afford to lose. Before that, preview deployments are enough. For a small app, staging doesn't have to be elaborate: a second database project, a branch that deploys to its own URL with its own environment variables, and payments in test mode cover most of the value.

This guide helps you decide whether you need staging yet, then walks through a lightweight setup for the most common stack in AI-built apps (a front end on Vercel or Netlify, Supabase behind it, Stripe for payments) and a release routine that fits in ten minutes.

Do you actually need staging yet?

Use this as a rough test.

Your situationWhat you need
Prototype, no real users, demo data onlyPreview deployments are enough
A few real users, no paymentsA separate database for testing, previews pointed at it
Paying customers, or personal data you're responsible forA proper staging environment and a release routine
A team of several people shipping changesStaging plus a rule that nothing reaches production untested

The trigger is risk, not size. A tiny app that takes payments needs staging more than a large internal tool with ten users. The most expensive mistakes we're trying to prevent are a migration that drops a column in production, a test that emails every real customer, or a preview that charges real cards.

What does a simple staging setup look like?

Staging is just a copy of production with fake data and test keys. Here are the pieces.

1. A second Supabase project

Create a project named something like yourapp-staging. Supabase's Free plan allows two active projects, though free projects pause after a week of inactivity, which is fine for staging if you don't mind waking it up. On the Pro plan each additional project adds its own compute cost; Supabase's pricing page gives the example of a Pro organization with two Micro projects at $35 a month.

Keep the schema identical to production by applying the same migrations to both, staging first. Our guide to Supabase migrations with the CLI covers how. Never point staging at the production database "just for now".

2. A staging branch with its own variables

Create a staging branch in GitHub. Then:

  • On Vercel, add Preview environment variables scoped to the staging branch with the staging Supabase URL and keys. Branch-specific values override the general preview ones. You can also assign a domain such as staging.yourapp.com to that branch.
  • On Netlify, branch deploys build named branches, and environment variables can have a Branch value for staging.

If you're not sure which variables go where, our guide to production, preview and local variables has a full table.

3. Stripe in test mode

Use Stripe's test keys in staging and create a separate webhook endpoint in test mode that points to your staging URL. Its signing secret is different from the live one, so it needs its own variable. Test payments with Stripe's test cards, such as 4242 4242 4242 4242 with any future expiry date.

4. Auth settings for the staging URL

In the staging Supabase project, set the site URL and redirect URLs to your staging domain. Otherwise sign-up confirmations and password resets in staging will send people to production or localhost.

5. Fake data, not a copy of production

Seed staging with test accounts and realistic but invented records: one admin, two regular users in different organizations, a cancelled subscription. Copying production into staging copies your customers' personal data into a less protected place, and it's rarely needed to find bugs.

6. Keep it private

Staging shouldn't be public or indexed. On Vercel, Standard Protection covers every deployment URL except your production domains, so you can require team members to log in through Vercel Authentication. On Netlify, check which access-control options your plan includes for branch deploys.

What should the release routine be?

Keep it short enough that you actually follow it.

  1. Build features on their own branches; each push creates a preview.
  2. Merge into staging when the feature is ready. Apply any new migration to the staging database.
  3. Run the checklist below on the staging URL.
  4. Merge staging into main. Apply the same migration to production, then let the deploy finish.
  5. Repeat the two most important checks on production.

A ten-minute staging checklist

  • Sign up with a new email, confirm it, log out, log in.
  • Reset the password.
  • Complete a payment with a test card and confirm access is granted.
  • Log in as a second user and make sure you can't see the first user's data.
  • Open the page you changed on a phone.

What are the common mistakes?

  • Shared database. Staging and production using the same Supabase project means a test can delete real data.
  • Migrations applied to production first. Always run them on staging, check the app still works, then production.
  • Forgotten webhooks. Staging's test-mode webhook pointing at production, or the other way round, creates ghost orders.
  • Staging drifts. If nobody uses it for months, it falls out of sync. Apply every migration to both, even small ones.

Quick answers

Is Supabase branching a replacement for a staging project? It can be. Supabase offers database branching; check its docs for the current plan requirements and costs before relying on it.

Can I use the free plans for staging? Often yes. Supabase Free allows two active projects, but remember the inactivity pause. Commercial apps still need a host plan that allows commercial use.

Do I need staging if I build only with Lovable or Bolt? If the app has real users, yes. The builder's preview is not a separate environment if it uses the same database as production.

How much does staging cost? For a small app, usually the price of one more database project and nothing extra on the host. Our guide to hosting costs breaks it down.

Want help setting up staging?

Splitting environments touches your database, host, payments and auth at once, and getting one piece wrong is what staging is meant to prevent. Our maintenance and support plans can set it up and keep it in sync, and larger restructuring falls under custom software development. You can also start with the free health check.

Still stuck with your app?

Run the free health check on your app's URL, or get the $299 App Rescue Audit: a senior engineer reviews the code and sends you a written report in 2 business days.