This project uses Render for both frontend and backend deployment with automatic deployments on code pushes.
- Backend: FastAPI Web Service with SQLite
- Frontend: Static Site hosting
- Database: SQLite (embedded, no persistence needed)
- CI/CD: Render Auto-Deploy
- ✅ Single platform: Everything in one place
- ✅ Free tier: 750 hours/month for both services
- ✅ Ephemeral storage: Perfect for static scripture data
- ✅ Simple setup: One set of credentials
- ✅ GitHub integration: Automatic deployments
Service Type: Web Service
Configuration:
- Build Command:
uv sync && python setup_database.py - Start Command:
uv run uvicorn app.main:app --host 0.0.0.0 --port $PORT - Environment Variables:
RENDER=truePYTHON_VERSION=3.11
Features:
- SQLite database embedded in deployment
- Ephemeral storage (resets on each deployment)
- Automatic restarts on code changes
Service Type: Static Site
Configuration:
- Build Command:
cd frontend && npm ci && npm run build - Publish Directory:
frontend/dist - Environment Variables:
VITE_API_URL=https://your-backend-service.onrender.com
Features:
- Built React app served as static files
- Global CDN distribution
- Automatic rebuilds on code changes
- Automatic: Render detects code pushes and deploys automatically
- No Configuration: No GitHub Actions or secrets needed
- Simple: Just push to main branch and Render handles the rest
- Includes Submodules: SQLite database is automatically included
-
Backend Service:
- Go to Render Dashboard
- Click "New +" → "Web Service"
- Connect your GitHub repository
- Set build command:
uv sync && python setup_database.py - Set start command:
uv run uvicorn app.main:app --host 0.0.0.0 --port $PORT - Add environment variable:
RENDER=true
-
Frontend Service:
- Go to Render Dashboard
- Click "New +" → "Static Site"
- Connect your GitHub repository
- Set build command:
npm ci && npm run build - Set publish directory:
dist - Add environment variable:
VITE_API_URL=https://your-backend-service.onrender.com
- Get your frontend domain from Render Dashboard (e.g.,
https://your-app-name.onrender.com) - Update CORS configuration in
backend/app/utils/config.py:CORS_ORIGINS = [ "http://localhost:5173", # Vite dev server "http://localhost:3000", # Alternative dev port "http://127.0.0.1:5173", "http://127.0.0.1:3000", "https://your-frontend-domain.onrender.com", # Add your frontend domain here ]
- Commit and push the changes to trigger a new backend deployment
- Push changes to
mainbranch - Check Render Dashboard for deployment status
- Verify both services are running on Render
- Test the frontend to ensure it can call the backend API
- Push to main branch → Render detects changes
- Backend deploys → FastAPI service updates
- Frontend deploys → React app rebuilds with new API URL
- Services restart → New code is live
- Backend: Push changes to
backend/orsubmodules/ - Frontend: Push changes to
frontend/ - Both: Push changes to root files
- Service status and logs
- Build history
- Environment variables
- Custom domains
- Deployment status
- Build logs
- Error tracking
-
Backend won't start:
- Check
uvicornis in requirements - Verify
$PORTenvironment variable - Check SQLite database path
- Check
-
Frontend build fails:
- Check Node.js version compatibility
- Verify all dependencies in
package.json - Check
VITE_API_URLis set correctly
-
API calls fail:
- Verify
VITE_API_URLpoints to correct backend - Check CORS configuration in backend
- Ensure backend service is running
- Verify
-
CORS errors:
- Verify frontend domain is in
CORS_ORIGINSlist - Check browser console for specific CORS error messages
- Ensure backend has been redeployed after CORS changes
- Test API endpoint directly to confirm it's working
- Verify frontend domain is in
- Backend logs: Render Dashboard → Service → Logs
- Frontend build logs: Render Dashboard → Frontend service
- API errors: Backend service logs
- 750 hours/month (enough for 24/7 for one service)
- Shared CPU (sufficient for scripture reading app)
- Ephemeral storage (perfect for static data)
- $7/month: Dedicated CPU + persistent disk
- $25/month: Professional plan with more resources
- Custom domains: Free with any plan
- Never commit secrets to Git
- Use GitHub Secrets for sensitive data
- Rotate API tokens regularly
- Backend configured for frontend domain
- Important: After deploying your frontend, update
backend/app/utils/config.pyto add your frontend domain toCORS_ORIGINS:CORS_ORIGINS = [ "http://localhost:5173", # Vite dev server "http://localhost:3000", # Alternative dev port "http://127.0.0.1:5173", "http://127.0.0.1:3000", "https://your-frontend-domain.onrender.com", # Add your frontend domain here ]
- Commit and push the changes to trigger a new backend deployment
- Add production domains to CORS origins
- Restrict to specific domains in production
- High traffic (>1000 requests/minute)
- Need persistent storage
- Custom domain requirements
- Advanced monitoring needs
- Start with free tier
- Upgrade individual services as needed
- Add custom domains when ready
- Consider CDN for global distribution