This guide will help you deploy RefactorAI to Render as a single full-stack service using the included render.yaml configuration.
RefactorAI is deployed as a single Node.js web service that:
- Serves the React frontend as static files
- Handles API requests on
/ai/*endpoints - Automatically builds the frontend during deployment
- GitHub repository with your code
- Render account (free tier available)
- Google AI API key
Make sure your code is pushed to a GitHub repository that Render can access.
- Go to render.com and sign in
- Click "New" → "Blueprint"
- Connect your GitHub repository
- Render will automatically detect the
render.yamlfile
Set these in the Render dashboard for the service:
| Variable Name | Required | Description | Example |
|---|---|---|---|
GOOGLE_API_KEY |
Yes | Google AI API key for code review functionality | AIzaSy... |
NODE_ENV |
No | Node environment (automatically set to production) | production |
PORT |
No | Port number (automatically set by Render) | 10000 |
- Click "Apply" in the Render dashboard
- Render will:
- Install backend dependencies
- Build the frontend automatically
- Start the single service serving both frontend and API
Once deployed, you'll have:
- Single URL:
https://refactorai-app-[hash].onrender.com - Frontend served at the root (
/) - API available at
/ai/*endpoints - Health check at
/health
Deploy as a single Web Service (not static site):
Service Type: Web Service (Node.js)
Build Command:
cd backend && npm install && npm run buildStart Command:
cd backend && npm startEnvironment Variables:
GOOGLE_API_KEY(required)NODE_ENV=production
Note: No separate frontend service needed! The backend serves both API and frontend.
- Go to Google AI Studio
- Create a new API key
- Copy the key and add it to your Render service environment variables
# Build frontend and start backend with nodemon
node build.js
cd backend && npm run dev# Terminal 1: Start backend with nodemon (auto-restart on changes)
cd backend && npm run dev
# Terminal 2: Start frontend with Vite dev server (hot reload)
cd frontend && npm run dev# Build frontend and start backend (no hot reload)
node build.js
cd backend && npm startFor local development environment variables:
GOOGLE_API_KEY=your_google_ai_api_key_here
PORT=3000
NODE_ENV=development
VITE_API_BASE_URL=http://localhost:3000
- Frontend: React + Vite (built and served as static files)
- Backend: Node.js + Express API server (also serves frontend)
- AI Service: Google AI (Gemini) for code review
- Deployment: Single web service on Render
- Single service = lower cost (one service instead of two)
- Render Free Tier includes:
- 750 hours/month of usage
- Auto-sleep after 15 minutes of inactivity
- Custom domains available
-
Build Failures:
- Check build logs in Render dashboard
- Ensure both
backend/package.jsonandfrontend/package.jsonexist - Verify build command can access frontend directory
- "vite: not found" error: The build script installs dev dependencies with
--include=devflag
-
Frontend Not Loading:
- Check if
frontend/distdirectory exists after build - Verify static file serving is working at
/healthendpoint
- Check if
-
API Connection Issues:
- Test API endpoints directly:
/ai/get-review - Check backend logs for errors
- Test API endpoints directly:
-
Google AI Errors:
- Ensure
GOOGLE_API_KEYis valid and has proper permissions - Test API key locally first
- Ensure
Access logs through the Render dashboard:
- Go to your service → "Logs" tab
- Monitor real-time deployment and runtime logs
- Check both build logs and runtime logs
Visit /health endpoint to verify service is running:
{
"status": "OK",
"message": "RefactorAI Backend is running"
}If you encounter issues:
- Check Render documentation: render.com/docs
- Verify environment variables are correctly set
- Check service logs for error messages
- Test locally using
node build.jsfirst