A modern, intelligent code analysis platform that provides instant code reviews, security analysis, and improvement suggestions using multiple AI providers with automatic fallback for maximum reliability.
β If you find this project helpful, please consider giving it a star on GitHub! It helps others discover this tool and motivates continued development.
- π Multi-Provider AI: Seamlessly switches between Gemini, Groq, and HuggingFace if one fails
- π― Customizable Models: Easy to change AI models for each provider (see Model Configuration)
- β‘ Real-time Analysis: Instant feedback on code quality, security, and performance
- π¨ Modern UI: Clean interface with syntax highlighting, drag-drop, and file upload
- π Smart Reports: Toggle between raw JSON and beautiful UI visualizations
- π‘οΈ Production Ready: Built with TypeScript, proper error handling, and validation
- Gemini:
gemini-2.5-flash(Google's latest fast model) - Groq:
llama-3.3-70b-versatile(Latest Llama model for versatile tasks) - HuggingFace:
bigcode/starcoder2-15b(Specialized for code analysis)
- Node.js 18+
- PNPM If you don't have pnpm installed, install it using
npm i -g pnpm - At least one AI API key (get them here)
# Clone and install
git clone <your-repo-url>
cd ai-powered-codementor
pnpm install
# Setup environment
cd backend && cp .env.example .env
# Add your API keys to .env file
# Start the app
cd .. && pnpm devπ That's it! Open http://localhost:5174 and start analyzing code!
- π Upload Code: Drag & drop files or paste code directly
- ποΈ Choose Analysis: Pick from general, security, performance, or maintainability
- π€ Select AI Provider: Use auto-selection or pick your preferred AI
- π Get Results: View detailed analysis with actionable recommendations
Want to use different AI models? Easy! Just modify these files:
File: /backend/src/services/geminiService.ts (line 35)
this.model = this.genAI.getGenerativeModel({ model: 'gemini-2.5-flash' });File: /backend/src/services/groqService.ts (line 15)
model: 'llama-3.3-70b-versatile'File: /backend/src/services/huggingFaceService.ts (line 16)
model: 'bigcode/starcoder2-15b'- Go to Google AI Studio
- Click "Create API Key" β Select project β Copy key
- Visit Groq Console
- Sign up (takes 30 seconds) β Go to API Keys β Create new key
- Go to HuggingFace Tokens
- Create new token β Copy and save
# In /backend/.env
PORT=3001
NODE_ENV=development
CORS_ORIGIN=http://localhost:5173
# Add API keys (recommended to have all three,but at least one is required)
GEMINI_API_KEY=your_gemini_key_here
GROQ_API_KEY=your_groq_key_here
HUGGINGFACE_API_KEY=your_hf_key_here| Layer | Technologies |
|---|---|
| π¨ Frontend | React 18, TypeScript, Vite, Tailwind CSS, Zustand |
| β‘ Backend | Node.js, Express, TypeScript, Fallback System |
| π€ AI Providers | Google Gemini, Groq, HuggingFace |
| π¦ Package Manager | PNPM Workspaces |
| π οΈ DevTools | ESLint, Prettier, Nodemon |
- π Automatic Fallback: If Gemini fails β tries Groq β then HuggingFace
- π‘οΈ Type Safety: Full TypeScript coverage with proper interfaces
- π― Modular Design: Easy to add new AI providers
- β‘ Fast Development: Hot reload for both frontend and backend
# π Development
pnpm dev # Start both frontend & backend
pnpm dev:frontend # Frontend only (port 5174)
pnpm dev:backend # Backend only (port 3001)
# ποΈ Building
pnpm build # Build everything for production
pnpm lint # Check code quality
pnpm clean # Remove build artifacts| Endpoint | Method | Purpose |
|---|---|---|
/api/analyze |
POST | π Analyze code with AI |
/api/explain |
POST | π‘ Get code explanations |
/api/improve |
POST | β‘ Get improvement suggestions |
/api/report |
POST | π Generate comprehensive reports |
/api/providers |
GET | π€ Check AI provider status |
β Input validation on all endpoints β File size limits for uploads β API key security with environment variables β CORS protection with configurable origins β Error handling without sensitive data exposure β TypeScript for compile-time safety
Contributions are welcome!
π¨ Build Errors?
- Run
pnpm installto ensure dependencies are installed - Check Node.js version (need 18+)
π€ AI Not Working?
- Verify API keys in
/backend/.env - Check console for error messages
- Try a different AI provider
π Frontend Not Loading?
- Make sure backend is running on port 3001
- Check CORS settings in backend config
MIT License - feel free to use this in your own projects!