Do not commit .env or any file with real secrets. Use .env.example as a template; set values in your environment or in the host dashboard.
MetaShift is a monorepo: backend (Node/Express + WebSocket) and frontend (React/Vite). Deploy backend first, then frontend, and set the frontend’s VITE_BACKEND_URL to the backend URL.
| Variable | Description |
|---|---|
PORT |
Set by Render automatically; default 3001 locally. |
SUPABASE_URL |
Supabase project URL. |
SUPABASE_SERVICE_KEY |
Supabase service_role key (keep secret). |
SUPABASE_JWT_SECRET |
Supabase JWT secret (Settings → API) for auth. |
Optional: CORS_ORIGIN = comma-separated frontend URLs (e.g. https://your-app.vercel.app). Omit in dev to allow all.
Optional: GEMINI_API_KEY for resolution suggestions.
Vite bakes these in at build time. API and WebSocket URLs are derived from VITE_BACKEND_URL.
| Variable | Description |
|---|---|
VITE_BACKEND_URL |
Backend base URL, no trailing slash (e.g. https://metashift-backend.onrender.com). |
VITE_SUPABASE_URL |
Same as backend SUPABASE_URL. |
VITE_SUPABASE_ANON_KEY |
Supabase anon public key. |
Use when the backend is already deployed (e.g. on Render).
- Vercel → Add New → Project → import the MetaShift repo.
- Root Directory: set to
frontend. - Environment variables: Add (use your real backend URL and Supabase values; do not commit them):
VITE_BACKEND_URL= your backend URL (e.g.https://metashift-backend.onrender.com)VITE_SUPABASE_URL,VITE_SUPABASE_ANON_KEY
- Deploy. Set backend
CORS_ORIGINto include your Vercel URL.
-
Supabase: Create a project, run migrations from
supabase/migrations/, and copy URL, anon key, service role key, and JWT secret. Do not commit them. -
Blueprint: Render → New → Blueprint → connect the MetaShift GitHub repo. Render reads
render.yamland creates metashift-backend and metashift-frontend. -
Backend: In the backend service dashboard, add env vars:
SUPABASE_URL,SUPABASE_SERVICE_KEY,SUPABASE_JWT_SECRETCORS_ORIGIN= your frontend URL(s), comma-separated (e.g.https://metashift-frontend.onrender.com)- Optional:
GEMINI_API_KEYSave; Render redeploys. Health check uses GET /health (returns{ "ok": true }).
-
Note the backend URL (e.g.
https://metashift-backend.onrender.com). -
Frontend: In the frontend service dashboard, add env vars:
VITE_BACKEND_URL= backend URL from step 4 (no trailing slash)VITE_SUPABASE_URL,VITE_SUPABASE_ANON_KEYSave and redeploy the frontend so the build uses the new values.
-
Open the frontend URL; dashboard and WebSocket should connect. SPA routing is handled by the rewrite in
render.yaml(/*→/index.html).
- CI: On push/PR to
main(ormaster), GitHub Actions runs:- Backend:
npm ci+npm run testinbackend/. - Frontend:
npm ci+npm run test+npm run buildinfrontend/.
- Backend:
- Secrets: No secrets are required for CI. For deployment, configure env vars in Vercel and Render dashboards (not in GitHub repo secrets unless you use GitHub Actions to deploy).
- Supabase project created; migrations run; no secrets committed.
- Backend deployed; GET /health returns
{ "ok": true }. - Frontend env has
VITE_BACKEND_URL(and Supabase keys); frontend redeployed after setting. - Backend
CORS_ORIGINincludes the frontend URL(s). - Browser opens the app; dashboard loads and WebSocket connects.