DeepReviewer is an AI-powered code reviewer designed to provide expert-level feedback on code snippets across multiple programming languages. Built using Node.js and integrated with the Groq SDK, it leverages the DeepSeek-R1-Distill-Qwen-32B model to analyze, review, and optimize code. The AI acts as a senior developer with 15+ years of experience, ensuring high-quality, structured feedback.
- Automated Code Review: Provides detailed code analysis and suggestions.
- Multi-Language Support: Reviews and converts code between Python, Java, C, and C++.
- Best Practices Compliance: Ensures adherence to industry standards and coding principles.
- Performance Optimization: Identifies redundant operations and suggests optimizations.
- Scalability & Maintainability Checks: Recommends improvements to enhance future adaptability.
- Security Auditing: Detects vulnerabilities and ensures secure coding practices.
- Time & Space Complexity Analysis: Evaluates computational efficiency.
- Constructive Feedback & Fixes: Offers refactored solutions and clear explanations.
-
Front-end :
-
β React β JavaScript library for building UI components
-
π¨ Tailwind CSS β Utility-first CSS framework for styling
-
π react-simple-code-editor β Lightweight code editor component
-
π react-markdown β Renders Markdown content
-
π rehype-highlight β Syntax highlighting for Markdown-rendered code -π Axios β HTTP client for API requests
-
Backend: Node.js
-
AI Model: DeepSeek-R1-Distill-Qwen-32B
-
API Integration: Groq SDK
-
Version Control: Git & GitHub
Ensure you have the following installed:
- Node.js (v16+)
- NPM or Yarn
- Git
git clone https://github.com/iamafridi/DeepReviewer.git
cd DeepReviewernpm installCreate a .env file and add your Groq API Key:
GROQ_API_KEY=your_api_key_herenode index.jsconst Groq = require("groq-sdk");
const groq = new Groq({ apiKey: process.env.GROQ_API_KEY });
async function getResponse(prompt) {
const chatCompletion = await groq.chat.completions.create({
model: "deepseek-r1-distill-qwen-32b",
messages: [
{
role: "user",
content: prompt,
},
{
role: "system",
content: `
Act as a senior software engineer (15+ years experience) reviewing code.
Your responsibilities:
- Ensure clean, maintainable, and efficient code.
- Suggest refactored solutions with explanations.
- Analyze time & space complexity.
- Provide alternative implementations in Python, Java, C, and C++.
- Highlight security risks and performance bottlenecks.
- Recommend industry best practices.
Use this format:
1οΈβ£ **Suggestions**
2οΈβ£ **Improved Code in JavaScript**
3οΈβ£ **Equivalent Code in Python, Java, C, and C++**
4οΈβ£ **Time & Space Complexity**
5οΈβ£ **Personalized Learning Resources**
`,
},
],
});
return chatCompletion.choices[0].message.content;
}
module.exports = getResponse;function sum() {
return 1 + 1;
}π Issues:
β Redundant Calculation: The function always returns 2, making the computation unnecessary.
β Poor Naming: "sum" suggests adding variables, but no parameters are accepted.
β No Error Handling: If modified to accept parameters, validation is missing.
β
Recommended Fix:
const SUM_RESULT = 2;
function getFixedSum() {
return SUM_RESULT;
}
- The API key is stored in an
.envfile and never hardcoded. - Error handling is implemented to catch API failures.
- No external user inputs are processed directly, reducing injection risks.
β DRY Principle
β SOLID Design Principles
β Error Handling & Logging
β Code Readability & Maintainability
β Scalability & Performance Optimization
DeepReviewer is designed to assist developers in writing better, more efficient, and more secure code. It ensures adherence to best practices, improves maintainability, and enhances performance. Whether you're a beginner or an experienced developer, this tool provides actionable insights to help you write high-quality code.
Contributions are welcome! If you find a bug or want to improve functionality, feel free to submit a pull request.
- Fork the repository
- Create a feature branch (
git checkout -b feature-name) - Commit changes (
git commit -m "Added new feature") - Push to the branch (
git push origin feature-name) - Open a pull request
This project is licensed under the MIT License.
For any questions or collaboration opportunities, reach out to:
- GitHub: iamafridi
- Portfolio: iamafrididev.netlify.app
π Happy Coding! π―
