FastAPI backend for AITutor application with OpenRouter AI integration.
- GitHub repository with backend code
- Render account
- OpenRouter API key
- Push backend code to GitHub
- Go to Render
- Click "New +" → "Web Service"
- Connect your GitHub repository
- Select the backend folder/repository
- Use the
render.yamlconfiguration - Set environment variable:
OPENROUTER_API_KEY - Click "Create Web Service"
- Create new web service on Render
- Set these configurations:
- Runtime: Python 3.12
- Build Command:
pip install -r requirements.txt - Start Command:
python -m uvicorn app.main:app --host 0.0.0.0 --port $PORT - Health Check:
/api/v1/tutor/health
Set in Render dashboard:
OPENROUTER_API_KEY: Your OpenRouter API keyPYTHON_VERSION: 3.12PORT: 8000
# Install dependencies
pip install -r requirements.txt
# Run development server
python -m uvicorn app.main:app --reload --port 8000
# Health check
curl http://localhost:8000/api/v1/tutor/healthGET /api/v1/tutor/health- Health checkPOST /api/v1/tutor/learn- Generate explanation and quizPOST /api/v1/tutor/score- Score quiz answersPOST /api/v1/tutor/adaptive-question- Generate adaptive questionsPOST /api/v1/tutor/true-false- Generate true/false statements
After deployment: https://aitutor-backend.onrender.com
Full API docs available at: https://aitutor-backend.onrender.com/docs