An AI-powered code analysis and optimization tool. Paste your code, select a language, and get instant feedback on complexity, issues, and an optimized version.
🔗 Live Demo → codeenhancer.vercel.app
- Detects syntax errors with line references
- Analyzes time and space complexity
- Identifies performance issues and anti-patterns
- Suggests better algorithms and data structures
- Returns a clean optimized version of your code
Python · C++ · C · Java · C#
Frontend
- Next.js 14 (App Router)
- TypeScript
- Tailwind CSS
Backend
- Python Flask
- OpenRouter API
- GROQ API
cd backend
pip install -r requirements.txtCreate a .env file:
OPENROUTER_API_KEY=your_key_here
OPENROUTER_MODEL=openai/auto
GROQ_API_KEY=your_key_here
GROQ_MODEL=llama-3.1-70b-versatile
FLASK_DEBUG=1
CORS_ORIGINS=http://localhost:3000,http://127.0.0.1:3000,https://codeenhancer.vercel.app
Run the server:
python run.pycd frontend
npm installCreate a .env.local file:
NEXT_PUBLIC_API_URL=http://127.0.0.1:5000
Run the dev server:
npm run devRequest
{
"code": "your source code here",
"language": "python"
}Response
{
"status": "success",
"syntax_check": { "valid": true, "errors": [] },
"analysis": {
"language": "python",
"detected_patterns": ["nested loops"],
"time_complexity": "O(n^2)",
"space_complexity": "O(1)"
},
"issues": [],
"optimizations": [],
"optimized_code": {
"code": "optimized version here",
"notes": "key changes made"
}
}Returns service status.