- Go to: https://aistudio.google.com/app/apikey
- Sign in with Google
- Click "Create API Key"
- Copy the key
# Make script executable and run it
chmod +x setup-ai.sh
./setup-ai.shEdit the .env file that was created:
# Replace with your actual key
GEMINI_API_KEY=your_actual_gemini_key_here# Start everything (builds frontend + starts server)
npm start- Open:
http://localhost:3000 - Create/join a room
- Look for "Show AI Review" button in sidebar
- Click it to see the AI panel
- Write code and click "🔍 Review Code"
# Check if AI service loaded
curl http://localhost:5000/api/status
# Should show: "aiCodeReview": true# Start Redis with Docker
docker run -d --name redis -p 6379:6379 redis:alpine
# Or install locally:
# macOS: brew install redis && brew services start redis
# Ubuntu: sudo apt install redis-server- ✅ Make sure you have a valid Gemini API key
- ✅ Check internet connection
- ✅ Verify the key at: https://aistudio.google.com/
# 1. Install dependencies
npm install
# 2. Create .env file
echo "GEMINI_API_KEY=your_key_here" > .env
# 3. Start Redis
docker run -d -p 6379:6379 redis:alpine
# 4. Build and start
npm run build
npm start# Start with auto-reload
npm run start:dev
# This starts:
# - Redis server
# - Node.js with auto-reload on file changesWhen working correctly, you should see:
Console output:
✅ AI Code Review service loaded
🤖 Initializing AI Code Review service...
✅ AI Code Review routes loaded
🚀 Server running on port 5000
Browser UI:
- "Show AI Review" button in sidebar (green)
- When clicked: AI panel opens on right
- Panel header shows: "🆓 Gemini" or "🤖 AI Code Review"
- "🔍 Review Code" button works
- Completely FREE: 15 requests/minute, 1500/day
- No credit card: No billing setup needed
- High quality: Excellent code analysis
- Easy setup: Just get API key and go
- Test locally first before deploying
- Use larger code blocks for better analysis
- Try different analysis types (bugs, security, style, etc.)
- Share reviews with team members in real-time
- Comments system for collaborative feedback
🎯 Your AI-powered collaborative code editor is ready! Happy coding! 🤖