Skip to content

iamafridi/DeepReviewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DeepReviewer (DeepSeek-R1 Powered)

πŸ“Œ Project Overview

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.

alt text

πŸ› οΈ Features

  • 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.

πŸš€ Technology Stack

  • 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

πŸ“œ Installation & Setup

Prerequisites

Ensure you have the following installed:

  • Node.js (v16+)
  • NPM or Yarn
  • Git

Clone the Repository

git clone https://github.com/iamafridi/DeepReviewer.git
cd DeepReviewer

Install Dependencies

npm install

Set Up Environment Variables

Create a .env file and add your Groq API Key:

GROQ_API_KEY=your_api_key_here

Run the Application

node index.js

πŸ“Œ Code Breakdown

Main Functionality (reviewer.js)

const 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;

πŸ“ Example Output

Input Code:

function sum() {
  return 1 + 1;
}

AI-Generated Review:

πŸ” 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;
}

πŸ›‘οΈ Security Considerations

  • The API key is stored in an .env file and never hardcoded.
  • Error handling is implemented to catch API failures.
  • No external user inputs are processed directly, reducing injection risks.

πŸ† Best Practices Followed

βœ” DRY Principle
βœ” SOLID Design Principles
βœ” Error Handling & Logging
βœ” Code Readability & Maintainability
βœ” Scalability & Performance Optimization

🎯 Conclusion

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.

🀝 Contributing

Contributions are welcome! If you find a bug or want to improve functionality, feel free to submit a pull request.

Steps to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature-name)
  3. Commit changes (git commit -m "Added new feature")
  4. Push to the branch (git push origin feature-name)
  5. Open a pull request

πŸ“„ License

This project is licensed under the MIT License.

πŸ“¬ Contact

For any questions or collaboration opportunities, reach out to:


πŸš€ Happy Coding! 🎯

About

DeepReviewer is an AI-powered code review assistant that analyzes code quality, enforces best practices, and optimizes performance using Node.js, Groq SDK, and the DeepSeek-R1-Distill-Qwen-32B model. Acting as a virtual senior engineer, it delivers precise, actionable feedback for developers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors