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:
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:
- In CloudFlare, edit the
portalA record — change it to a CNAME pointing tocname.vercel-dns.com - Set Proxy status to "DNS only" (grey cloud)
- In Vercel, add
portal.matthewscleaningco.com.auas a domain on the client-portal project - Optionally remove
portal2domain 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¶
- Vercel dashboard: vercel.com/matthews-cleaning-co
- Vercel account is linked to Glenn's GitHub account (
glenn-mcc)