Skip to content

A web application that review code and give feedback and correct the code

Notifications You must be signed in to change notification settings

mr-rishikesh/AI-Code-Review

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AI Code Reviewer

An AI-powered code review application that provides instant feedback on code quality, bugs, security, and best practices using Groq's LLaMA 3.3 70B model.

Features

  • Real-time Code Editor - Syntax highlighting with Prism.js
  • AI-Powered Reviews - Comprehensive code analysis using Groq AI
  • Modern UI - Dark/light theme, responsive design, glassmorphism effects
  • Keyboard Shortcuts - Ctrl/Cmd + Enter to review
  • Copy/Clear Actions - Easy code management

Tech Stack

Frontend: React, Vite, Prism.js, react-markdown, Axios
Backend: Node.js, Express, Groq SDK
AI Model: LLaMA 3.3 70B Versatile

Installation

Prerequisites

Setup

  1. Clone the repository
git clone https://github.com/mr-rishikesh/AI-Code-Review.git
cd ai-code-reviewer
  1. Install dependencies
# Frontend
cd frontend
npm install

# Backend
cd ../backend
npm install
  1. Configure environment variables

Create backend/.env:

GROQ_APIKEY=your_groq_api_key_here
  1. Run the application

Terminal 1 - Backend:

cd backend
npm run dev

Terminal 2 - Frontend:

cd frontend
npm run dev

Open http://localhost:5173 in your browser.

Usage

  1. Paste your code in the editor (left panel)
  2. Click "Review Code" or press Ctrl/Cmd + Enter
  3. View AI feedback in the review panel (right panel)

API Endpoint

POST http://localhost:3000/ai/get-response
Content-Type: application/json

Project Structure

ai-code-reviewer/
├── frontend/
│   ├── src/
│   │   ├── App.jsx          # Main React component
│   │   ├── App.css          # Styles
│   │   └── main.jsx         # Entry point
│   └── package.json
│
├── backend/
│   ├── src/
│   │   ├── controllers/
│   │   │   └── ai.controller.js
│   │   │   └── groq-code-review-simple.service.js
│   ├── server.js            # Server entry
│   └── package.json
│
└── README.md

Configuration

Backend Service

The AI service (backend/src/services/groq-code-review-simple.service.js) uses:

  • Model: llama-3.3-70b-versatile
  • Temperature: 0.7
  • Max Tokens: 2000

Customization

Change the AI prompt in groq-code-review-simple.service.js:

const codeReviewPrompt = `
Your custom prompt here...
`;

Troubleshooting

CORS Errors:

// backend/src/app.js
app.use(cors({
  origin: ['http://localhost:5173']
}));

Groq API Issues:

  • Verify API key in .env
  • Check Groq status
  • Restart backend server after updating .env

License

MIT License - see LICENSE file for details.

About

A web application that review code and give feedback and correct the code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published