Paste any code and let AI explain, debug, or improve it instantly. Built with FastAPI and powered by Groq's free Llama 3.3-70B model.
π Live Demo
A clean, dark-themed web interface where developers paste code and get instant AI-powered analysis.
- π Code Explanation - Step-by-step breakdown of what your code does
- π Bug Finder - Detects errors, edge cases, and potential issues with fixes
- β¨ Code Improver - Suggests better patterns, performance improvements, and best practices
- π Multi-Language Support - Works with Python, JavaScript, SQL, and more
- β‘ Lightning Fast - Powered by Groq's ultra-fast inference engine
- π 100% Free - Uses Groq's free API tier
- π¨ Clean UI - GitHub-inspired dark theme, fully responsive
def fibonacci(n):
if n <= 1:
return n
return fibonacci(n-1) + fibonacci(n-2)
print(fibonacci(10))β¨ AI provides:
- Step-by-step explanation of the recursive logic
- Bug detection (inefficiency, no input validation)
- Improved version using dynamic programming with O(n) complexity
π Try it Live
| Technology | Purpose |
|---|---|
| Python 3.8+ | Core programming language |
| FastAPI | Backend web framework |
| Uvicorn | ASGI server |
| Groq API | AI model inference (Llama 3.3-70B) |
| HTML/CSS/JS | Frontend interface |
| python-dotenv | Environment variable management |
| Railway | Cloud deployment |
git clone https://github.com/smebad/Code-Explainer.git
cd Code-ExplainerWindows:
python -m venv .venv
.venv\Scripts\activateMac/Linux:
python3 -m venv .venv
source .venv/bin/activatepip install -r requirements.txtCreate a .env file in the root directory:
GROQ_API_KEY=your_actual_groq_api_key_hereuvicorn main:app --reloadCopy any code snippet into the text area β Python, JavaScript, SQL, or any language.
| Button | What it does |
|---|---|
| π Explain Code | Breaks down the logic step by step |
| π Find Bugs | Identifies errors and provides fixed code |
| β¨ Improve Code | Suggests optimizations and best practices |
Results appear instantly below with detailed, beginner-friendly explanations.
Code-Explainer/
β
βββ main.py β FastAPI backend (API endpoints & Groq integration)
βββ requirements.txt β Python dependencies
βββ Procfile β Deployment configuration
βββ .env β Secret API keys (never committed to Git)
βββ .gitignore β Git ignore rules
βββ assets/ β Screenshots of test cases
βββ static/
βββ index.html β Frontend UI (HTML, CSS, JavaScript)
Analyzes code using AI.
Request Body:
{
"code": "your code here",
"action": "explain"
}Actions:
explainβ Step-by-step code explanationdebugβ Bug detection and fixesimproveβ Optimization suggestions
Response:
{
"result": "AI-generated analysis here..."
}This app is deployed on Railway for free.
The app has been tested with:
| Test | Language | Result |
|---|---|---|
| Fibonacci recursion | Python | β |
| Division by zero bug | Python | β |
| Array map function | JavaScript | β |
| SELECT query | SQL | β |
| Empty input validation | β | β |
Contributions are welcome! Here's how:
- Fork the repository
- Create a feature branch
git checkout -b feature/AmazingFeature
- Commit your changes
git commit -m 'Add some AmazingFeature' - Push to the branch
git push origin feature/AmazingFeature
- Open a Pull Request
- π¨ Syntax highlighting for code input
- π Copy button for AI responses
- π Support for more programming languages
- π Export analysis as PDF
- π Analysis history/session storage
- π Rate limiting per user
- Rate Limits: Groq free tier has usage limits per minute
- Cold Starts: Railway free tier may have slow initial load after inactivity
- Context Length: Very large code files may be truncated
- π¨ Syntax highlighting in the code editor
- π One-click copy for AI responses
- π Session history to revisit past analyses
- π Multi-language UI support
- π Export analysis as PDF
- π User authentication
- π Usage analytics dashboard
- π€ Support for multiple AI models
This project is licensed under the MIT License.
MIT License
Copyright (c) 2026 Syed Muhammad Ebad
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Syed Muhammad Ebad
- πΌ LinkedIn: linkedin.com/in/syed-ebad-ml
- π GitHub: @smebad
- π§ Email: mohammdedbad1@hotmail.com
If you found this project helpful:
- β Star this repository
- π Report bugs via Issues
- π‘ Suggest features via Issues
- π’ Share with others who might find it useful
- π¬ Open an issue: GitHub Issues
- π§ Email me: mohammdedbad1@hotmail.com
- πΌ Connect on LinkedIn: Syed Ebad
code-explainer ai fastapi groq llama python debugging code-review developer-tools generative-ai web-app railway backend
Made with β€οΈ by Syed Ebad



