An AI-powered web application that analyzes source code, detects errors, explains logic, and suggests improvements.
This project is built using Flask and Groq API and is suitable for first-year students as a mini project.
- 🔍 Detects programming language
- 📖 Explains code in simple terms
- ❌ Finds errors in code
- 🚀 Suggests improvements
- ⏱ Shows time & space complexity
- ⭐ Gives code quality score
- 📋 Copy improved code easily
- 🎨 Clean and simple UI
- Python
- Flask
- Groq API
- HTML, CSS
- JavaScript
ai-code-analyzer/ │ ├── app.py ├── templates/ │ └── index.html ├── static/ │ └── style.css ├── .env └── README.md
pip install flask groq python-dotenv
Step 2: Create .env file
GROQ_API_KEY=your_api_key_here
Step 3: Run the App
python app.py
Step 4: Open Browser
http://127.0.0.1:5000
🧪 Sample Input
def add(a, b):
return a + b
📌 Output Includes
Language detection
Code explanation
Errors (if any)
Improvements
Time & space complexity
Improved code
🎓 Academic Use
✔ Suitable for first-year project
✔ Simple and understandable
✔ Practical implementation
✔ Good for viva and demonstration
🔐 Note
Do not upload your .env file to GitHub.
📌 Author
Aanya Cloud
GitHub: https://github.com/aanyacloud
⭐ Future Improvements
Syntax highlighting
File upload support
PDF report generation
Deployment to cloud