An AI-powered code review application that analyzes your code for bugs, security issues, performance problems, and best practices. Built with React, Express, and Groq AI.
🚀 Live Demo: https://code-reviewer-frontend.onrender.com
- 🤖 AI Code Analysis - Uses Groq API to review your code instantly
- 🌙 Dark Mode - Switch between light and dark themes
- 💾 Review History - View your past code reviews
- 📊 Detailed Results - Issues organized by severity (Critical, Warning, Info)
- ⚡ Lightning Fast - Groq is the fastest LLM API
- 📱 Responsive Design - Works on desktop, tablet, and mobile
- 🔒 Secure - API keys stored safely in environment variables
- 🌐 Deployed - Frontend and backend live on Render
JavaScript • Python • Java • Go • Rust • C++ • C# • Ruby • PHP • TypeScript • And more!
- Node.js 18+
- npm or yarn
- Groq API key (free at https://console.groq.com)
# Clone the repository
git clone https://github.com/yourusername/code-reviewer-ai.git
cd code-reviewer-ai
# Install backend dependencies
cd code-reviewer-backend
npm install
# Install frontend dependencies
cd ../code-reporter-frontend
npm installBackend (.env file):
# Create .env in code-reviewer-backend/
GROQ_API_KEY=gsk_your_key_here
PORT=8008
NODE_ENV=developmentFrontend (.env.development):
# Create .env.development in code-reporter-frontend/
REACT_APP_API_URL=http://localhost:8008# Terminal 1: Start Backend
cd code-reviewer-backend
npm start
# Terminal 2: Start Frontend
cd code-reporter-frontend
npm start
# Browser opens to http://localhost:3000- Paste this code in the textarea:
var x = null;
console.log(x.foo);- Click "Review Code"
- Wait 5-10 seconds for results
Expected: You'll see a Critical error about null reference ✅
code-reviewer-ai/
├── code-reviewer-backend/
│ ├── server.js # Main backend server
│ ├── package.json # Dependencies
│ └── .env # Environment variables (not committed)
│
├── code-reporter-frontend/
│ ├── src/
│ │ ├── App.jsx # Main app
│ │ ├── App.css # Styles
│ │ └── components/ # React components
│ ├── .env.development
│ ├── .env.production
│ └── package.json
│
└── README.md
User (Your Browser)
↓ (pastes code)
Frontend (React)
↓ (sends code)
Backend (Express)
↓ (creates prompt)
Groq AI
↓ (analyzes code)
Backend
↓ (formats results)
Frontend
↓ (displays issues)
User (sees review)
That's GenAI! 🤖
Your code is checked for:
- 🐛 Bugs - Null references, type errors, crashes
- ⚡ Performance - Slow algorithms, memory leaks
- 🔒 Security - SQL injection, XSS, hard-coded secrets
- ✅ Best Practices - Naming, organization, error handling
- 📊 Code Quality - Dead code, complexity, magic numbers
| Feature | Groq | Others |
|---|---|---|
| Speed | 1-2 seconds ⚡ | 5-30 seconds |
| Cost | Free $5/month | Paid |
| Stability | ✅ Stable | Models change |
| Setup | 2 minutes | 5 minutes |
Groq is the best choice! 🏆
- Toggle with moon icon in header
- Your preference is saved
- Works with all features
- Automatically saves your reviews
- Last 10 reviews stored
- Click any to view again
- Cleared when you clear browser data
Shows for each issue:
- Severity - Critical/Warning/Info
- Issue - What's wrong
- Solution - How to fix it
- Why It Matters - Why it's important
- Go to https://dashboard.render.com
- Click "New +" → "Web Service"
- Connect your GitHub repository
- Select
code-reviewer-backend - Set build command:
npm install - Set start command:
npm start - Add environment variable:
GROQ_API_KEY=gsk_... - Click "Create Web Service"
- Wait 5-10 minutes for deployment
- Click "New +" → "Static Site"
- Connect your GitHub repository
- Select
code-reporter-frontend - Set build command:
npm run build - Set publish directory:
build - Add environment variable:
REACT_APP_API_URL=https://your-backend-url.onrender.com - Click "Create Static Site"
- Wait 3-5 minutes for deployment
Your app automatically redeploys when you push to GitHub! 🎉
Just run:
git add .
git commit -m "your message"
git push origin mainRender sees the new code and deploys automatically.
- ✅ API keys in environment variables (never in code)
- ✅ No secrets committed to GitHub
- ✅ HTTPS in production
- ✅ Input validation (max 10,000 characters)
- ✅ CORS enabled for safe requests
Never commit .env files!
Try these test codes:
Test 1: Null Reference (Critical)
var x = null;
console.log(x.foo);Test 2: Clean Code (No Issues)
function add(a, b) {
return a + b;
}Test 3: SQL Injection (Critical)
var query = "SELECT * FROM users WHERE id = " + userId;Test 4: Unused Variable (Warning)
function test(items) {
var unused = 0;
items.forEach(item => console.log(item));
}Problem: Frontend can't reach backend
Solution:
- Check backend is running:
curl http://localhost:8008/api/health - Check
.env.developmenthas correct API URL - Restart frontend:
npm start
Problem: Port 8008 is busy or Groq API key is wrong
Solution:
# Check port
lsof -i :8008
# Kill if needed
lsof -ti :8008 | xargs kill -9
# Verify API key is correct
cat .envProblem: Old cached version
Solution:
- Open DevTools (F12)
- Go to "Application" → "Clear storage"
- Refresh page
- Node.js 18+
- npm or yarn
- Groq API key (free)
- Text editor (VS Code recommended)
- GitHub account
- Render account (free)
- Your Groq API key
Want to improve this project?
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes
- Commit:
git commit -m "feat: your feature" - Push:
git push origin feature/your-feature - Open a Pull Request
- First request: 5-10 seconds (model loading)
- After that: 1-2 seconds per review
- Max code size: 10,000 characters
- Timeout: 5 minutes
- Follow "Quick Start" above
- Run locally
- Try the test codes
- Deploy to Render
- Add new features (syntax highlighting, etc.)
- Improve UI design
- Add database for permanent storage
- Deploy to your own server
MIT License - Feel free to use this project for anything!
Built with:
- React - Frontend framework
- Express - Backend framework
- Groq - Fast AI API
- Render - Hosting
Your AI code reviewer is ready to use. Start by running locally or deploy to the cloud!
Questions? Open an issue on GitHub!
Found a bug? Create an issue with steps to reproduce!
Have an idea? Fork the repo and send a PR!
Happy coding! 💻✨