Admin SPA deploy
The admin console is a Vite + React SPA that talks directly to your Supabase project and the api edge function. It has no server runtime — any static host works.
Build
From the repo root:
VITE_SUPABASE_URL=https://YOUR-REF.supabase.co \
VITE_SUPABASE_ANON_KEY=eyJ… \
VITE_API_BASE_URL=https://YOUR-REF.functions.supabase.co \
npm run -w apps/admin buildThe output lands in apps/admin/dist/.
VITE_API_BASE_URL must point to your Supabase Functions endpoint, not your database URL. All console API calls are proxied through the api edge function.
Deploy options
| Host | Command / workflow |
|---|---|
| Cloudflare Pages | wrangler pages deploy apps/admin/dist --project-name mushi-admin |
| Vercel | vercel apps/admin/dist |
| S3 + CloudFront | See .github/workflows/deploy-admin.yml in the repo |
| Netlify | netlify deploy --dir apps/admin/dist --prod |
SPA routing
All hosts need to serve index.html for every path under the console root. The repo’s reference S3 workflow sets the ErrorDocument to index.html. For Cloudflare Pages and Netlify, a _redirects file or netlify.toml with /* /index.html 200 is sufficient.
First-run setup
After deploy, open the console and complete the Onboarding wizard (/onboarding). It will:
- Generate your first API key.
- Connect your GitHub OAuth app.
- Show the SDK snippet for your first project.
If /onboarding returns a blank screen, confirm VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY are baked into the build — these cannot be injected after build time.