Staging and releases
How a change reaches production. It is built on staging, reviewed and approved by Sean, then released.
Every change for National Commerce goes to a staging copy of the portal first. Steven and Sean review it there, including what each role can see. It reaches production only after Sean approves it.
Staging at a glance
| Production | Staging | |
|---|---|---|
| Address | portal.nationalcommerce.com | national-commerce-staging.vercel.app |
| Git branch | main | staging |
| Supabase project | axzbddunsdtgjpnycprb | uhdgrqwlunidtqpcfvyl (national-commerce-staging) |
| Data | Real, from ShipHero and the n8n flows | A small set of placeholder data, loaded by hand |
| Logins | Everyone | NC staff and one test brand login |
Pull request previews use the staging database too. Only production touches real data. Sean owns the staging Supabase project and pays for it.
Release a change
- Build the change on a feature branch.
- Open a pull request into
staging, notmain. Merging it deploys staging. - Steven and Sean review the change on staging. They check it as NC staff, then as a brand, with Preview as client or the test brand login, and confirm no internal cost or financial data shows to a brand.
- Sean approves the change.
- Open a pull request from
stagingintomain. Merging it deploys production.
Nothing goes straight to main
No NC change reaches production without Sean's sign-off on staging.
Database changes
The project has no migrations, so the two databases stay alike only if every
change runs on both. Run the SQL on staging first, together with the code that
needs it. Run the same SQL on production after Sean approves, right before the
staging to main merge.
New integrations
A new data integration, such as an n8n flow, a worker, or a webhook from an outside system, points at staging first:
- Build it against the staging Supabase project.
- Run its intake and check that the data landed correctly in the staging database.
- Only then switch it to production, or run it against both.
The existing integrations, the ShipHero Handler and the n8n flows, write to production only.
What staging leaves out
Staging has production's tables, functions, access rules, triggers, and sign-in settings. These parts are left out so staging can never reach production systems:
- The
shipping_threshold_exceeded_triggeron Orders and theinventory_update_triggeron Inventory. Both post to production n8n. process_shipment_queue,process_po_updates_queue, andresend_shipping_threshold_notificationspost to an address that does not exist, so they fail instead of reaching n8n. Their cron jobs are not scheduled. Onlyprune-auth-eventsand the weekly report run.- ShipHero credentials and the other Vault secrets. New-sign-in emails are off
because Vault has no
app_url. - The SKU sync and shipment reconcile crons. Vercel runs crons on production only.
Inviting a brand-new email and creating a client connection return "Server configuration error" on staging. Both run through n8n, which writes to production. Create staging logins in the staging Supabase dashboard instead. Giving an existing login more accounts works as usual.
Environment variables
| Variable | Production | Staging and previews |
|---|---|---|
NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY, NEXT_SUPABASE_SERVICE_ROLE_KEY | Production project | Staging project |
N8N_INVITE_WEBHOOK_URL, N8N_CREATE_BRAND_WEBHOOK_URL, N8N_SHIPHERO_COOKIES_WEBHOOK_URL | Set | Not set |
SLACK_BOT_TOKEN | Set | Not set |
Vercel's own login protects every preview. national-commerce-staging.vercel.app
is listed under Deployment Protection Exceptions, so reviewers without a Vercel
account can open it. Every page still needs an NC sign-in.
Related
- Architecture: sign-in settings both projects share.
- Automation: the triggers and cron jobs staging leaves out.
- Preview the portal as a client: the brand view during review.