Spaces:
Sleeping
Sleeping
Backend Deployment Guide
The backend cannot be deployed to Vercel due to Python dependency issues (faiss-cpu compatibility).
Option 1: Deploy Backend to Render (Recommended)
- Go to render.com and sign in
- Click "New +" → "Web Service"
- Connect your GitHub repository
- Configure:
- Name:
escalation-api-backend - Runtime: Python 3
- Build Command:
pip install -r requirements.txt - Start Command:
uvicorn src.main:app --host 0.0.0.0 --port $PORT
- Name:
- Add Environment Variables:
GOOGLE_API_KEY: Your Gemini API key
- Deploy
Your backend will be at: https://escalation-api-backend.onrender.com
Option 2: Deploy Backend to Railway
- Go to railway.app and sign in
- Click "New Project" → "Deploy from GitHub repo"
- Select your repository
- Add environment variables in the Variables tab
- Railway auto-deploys
Your backend will be at: https://your-app.up.railway.app
Update Frontend
After deploying the backend, update the frontend environment variable in Vercel:
- Go to Vercel Dashboard → Your Project → Settings → Environment Variables
- Add/Update:
VITE_API_URL=https://your-backend-url.onrender.com - Redeploy frontend
Local Development
Backend:
pip install -r requirements.txt
uvicorn src.main:app --reload
Frontend:
cd frontend
npm install
npm run dev
Set VITE_API_URL=http://localhost:8000 in frontend/.env