Skip to content

Dev Testing

Preview Deployments

When you open a PR against staging or main in an enabled repo, a live preview of your branch is automatically deployed. You get a unique URL to test your changes against the shared staging database — no local setup needed.

How it works

  1. Open or update a PR targeting staging or main
  2. A bot comments: "Preview deployment triggered..."
  3. Your branch is built and deployed (~5–6 minutes)
  4. Once ready, the bot posts the preview URL as a PR comment
  5. When the PR is closed or merged, the preview is automatically torn down

What you need

  • Your repo must be enabled for previews (via auto-pr repo)
  • Your repo must have a Dockerfile at the root
  • The PR must target staging or main (PRs from staging to main are excluded)

Redeployments

Every push to the PR branch triggers a redeploy automatically. The URL may stay the same — but best to take the latest one you get on PR comment.

Things to know

  • Previews share the staging database — they don't have isolated data
  • If a deployment fails, the bot posts a comment with a link to the build logs
  • Only one deployment runs per PR at a time — rapid pushes cancel the previous build

Custom Backend Override

You can point the frontend to a custom backend by adding ?be=<url> to any page URL. The override is stored in sessionStorage and persists across navigations within the same tab. Closing the tab clears it.

Usage

Dev / staging / preview environments:

http://localhost:3000/?be=https://preview-studio-backend-pr-42.preview-dev.scenarix.ai

Production hostnames (app.studiojadu.com, studio-internal.scenarix.ai) — requires a secret key param beKey:

https://app.studiojadu.com/?be=https://custom-backend.com&beKey=<secret>

Environment Variables

Variable Description
NEXT_PUBLIC_BE_PROD_HOSTS Comma-separated hostnames where the override key is required (e.g. app.studiojadu.com,scenarix-internal.scenarix.ai)
NEXT_PUBLIC_BE_OVERRIDE_KEY Secret key required for override on production hostnames
NEXT_PUBLIC_BE_ALLOWED_HOSTS Comma-separated backend hostnames allowed as override targets (e.g. localhost,my-staging.aws.com). If not set, any host is allowed

Override Indicator

When a custom backend is active, an orange badge appears at the bottom-left of the page. Click the × button on the badge to remove the override.


Putting it Together

A typical workflow for testing a backend PR against the frontend:

  1. Push your backend changes and open a PR to staging
  2. Wait for the preview deployment URL from the bot comment
  3. Open the frontend (local or staging) with the backend override:
    http://localhost:3000/?be=https://preview-studio-backend-pr-42.preview-dev.scenarix.ai
    
  4. Test your changes end-to-end
  5. When done, close the tab (clears the override) or click the × on the orange badge