Deployment¶
Architecture¶
Users
|
v
+---------------+
| Vercel CDN |
| (Frontend) |
| Next.js 16 |
+-------+-------+
|
+-----------+-----------+
| |
v v
+------------------+ +------------------+
| Supabase | | Hugging Face |
| (PostgreSQL) | | Spaces (Docker) |
| shared_results | | FastAPI + MACE |
| Public RLS | | Port 7860 |
+------------------+ +------------------+
Frontend — Vercel¶
- Push your repo to GitHub
- Import the repo at vercel.com
- Set environment variables:
| Variable | Required | Purpose |
|---|---|---|
NEXT_PUBLIC_SUPABASE_URL | Yes | Supabase project URL |
NEXT_PUBLIC_SUPABASE_ANON_KEY | Yes | Supabase anonymous key |
MACE_API_URL | No | Remote backend URL (omit for local mode) |
Backend — Hugging Face Spaces¶
- Create a new Space at huggingface.co (SDK: Docker)
- Push
mace-api/contents to the Space repo - Copy the Space URL (e.g.,
https://<user>-mace-api.hf.space) - Set
MACE_API_URLin Vercel to the Space URL
The Dockerfile in mace-api/ is pre-configured for Spaces deployment on port 7860.
Local development¶
No remote backend needed. When MACE_API_URL is not set, the Next.js API route spawns a local Python subprocess:
Requires mace-torch and ase installed in your Python environment.
Backend standalone (FastAPI)¶
For development or custom deployment: