- Push code to GitHub
- Go to Render
- Click "New +" β "Web Service"
- Connect your GitHub repository
- Select the
render.yamlconfiguration - Set environment variable:
OPENROUTER_API_KEY
- Install Vercel CLI:
npm i -g vercel - Run:
cd src/frontend && vercel --prod - Set environment variable in Vercel dashboard:
NEXT_PUBLIC_API_URL: Your Render backend URL
In src/backend/app/main.py, update CORS origins:
app.add_middleware(
CORSMiddleware,
allow_origins=["https://your-app.vercel.app"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
){
"version": 2,
"builds": [
{
"src": "src/frontend/package.json",
"use": "@vercel/next"
}
],
"routes": [
{
"src": "/api/(.*)",
"dest": "/api/$1"
}
]
}vercel --prodOPENROUTER_API_KEY: Your OpenRouter API keyNEXT_PUBLIC_API_URL: Backend URL (for frontend)
- Render: In service settings
- Vercel: In project settings
aitutor/
βββ vercel.json # Vercel configuration
βββ render.yaml # Render configuration
βββ src/
β βββ backend/ # FastAPI backend
β βββ frontend/ # Next.js frontend
βββ deployment/ # Deployment guides
βββ vercel-deployment.md
βββ render-deployment.md
- URL:
/api/v1/tutor/health - Response:
{"status":"ok"}
- Next.js automatically handles build optimization
- Static files served from CDN
- CORS Errors: Update allowed origins
- API Key Missing: Set environment variables
- Build Failures: Check Python/Node versions
- Connection Issues: Verify URLs and ports
- Render: Dashboard β Logs
- Vercel: Dashboard β Functions β Logs
After deployment: