Skip to content

Hosting & production infrastructure

Overview

Both the BMS and client portal are React apps hosted on Vercel under the "Matthews Cleaning Co" team. Vercel automatically deploys when code is pushed to the master branch on GitHub. Backend data flows through Supabase Edge Functions, which query Supabase (database) and Airtable.

URLs

App Production URL Vercel default URL
BMS bms.matthewscleaningco.com.au Via Vercel dashboard
Client portal portal2.matthewscleaningco.com.au Via Vercel dashboard

portal2 is temporary. When ready to switch, see Switching to production domain below.

Vercel projects

App Vercel project name Git repo Branch
BMS bms github.com/glenn-mcc/mcc-systems master
Client portal client-portal github.com/glenn-mcc/mcc-systems master

Both are monorepo apps — Vercel is configured to build from apps/bms and apps/client-portal respectively. Framework: Vite (auto-detected).

Architecture

User → CloudFlare DNS → Vercel CDN → React App → Supabase Edge Functions → Supabase DB / Airtable / Xero

The React frontends are static sites hosted on Vercel. They make API calls to Supabase Edge Functions, which query Supabase (for BMS data and tender responses), Airtable (for legacy portal data), and Xero (for invoicing).

DNS (CloudFlare)

Type Name Target Proxy
CNAME bms cname.vercel-dns.com DNS only (grey cloud)
CNAME portal2 cname.vercel-dns.com DNS only (grey cloud)

Client-side routing

Both apps have a vercel.json in their app directory with a rewrite rule to handle React Router:

{
  "rewrites": [
    { "source": "/(.*)", "destination": "/index.html" }
  ]
}

This ensures all routes are handled by the React app, not Vercel's server.

Deployment

Automatic (normal workflow): Push to master on GitHub. Vercel detects the push and deploys both apps. Typically under 2 minutes. Monitor at the Vercel dashboard under each project's Deployments tab.

Manual redeployment: Vercel dashboard → Deployments → click the three dots on the latest deployment → Redeploy.

Database and Edge Functions do not deploy automatically — see Deploying changes to production.

Costs

Vercel Pro plan. Current usage is well within included limits (100GB bandwidth/month).

Switching to production domain

When ready to replace portal2 with portal:

  1. In CloudFlare, edit the portal A record — change it to a CNAME pointing to cname.vercel-dns.com
  2. Set Proxy status to "DNS only" (grey cloud)
  3. In Vercel, add portal.matthewscleaningco.com.au as a domain on the client-portal project
  4. Optionally remove portal2 domain from Vercel and CloudFlare

Troubleshooting

Issue Solution
404 on page refresh Check vercel.json exists with rewrites config
"Invalid Configuration" in Vercel Verify CNAME in CloudFlare points to cname.vercel-dns.com with proxy disabled
SSL certificate error Wait a few minutes — Vercel generates certs automatically
Changes not appearing after push Check Vercel Deployments tab; ensure git push succeeded
CORS errors Check Supabase Edge Function CORS headers include the domain

Access