National Commerce Docs

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

ProductionStaging
Addressportal.nationalcommerce.comnational-commerce-staging.vercel.app
Git branchmainstaging
Supabase projectaxzbddunsdtgjpnycprbuhdgrqwlunidtqpcfvyl (national-commerce-staging)
DataReal, from ShipHero and the n8n flowsA small set of placeholder data, loaded by hand
LoginsEveryoneNC 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

  1. Build the change on a feature branch.
  2. Open a pull request into staging, not main. Merging it deploys staging.
  3. 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.
  4. Sean approves the change.
  5. Open a pull request from staging into main. 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:

  1. Build it against the staging Supabase project.
  2. Run its intake and check that the data landed correctly in the staging database.
  3. 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_trigger on Orders and the inventory_update_trigger on Inventory. Both post to production n8n.
  • process_shipment_queue, process_po_updates_queue, and resend_shipping_threshold_notifications post to an address that does not exist, so they fail instead of reaching n8n. Their cron jobs are not scheduled. Only prune-auth-events and 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

VariableProductionStaging and previews
NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY, NEXT_SUPABASE_SERVICE_ROLE_KEYProduction projectStaging project
N8N_INVITE_WEBHOOK_URL, N8N_CREATE_BRAND_WEBHOOK_URL, N8N_SHIPHERO_COOKIES_WEBHOOK_URLSetNot set
SLACK_BOT_TOKENSetNot 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.

On this page