Skip to content

het-tale/ai-code-review-tool

Repository files navigation

AI Code Review Tool

An intelligent code review tool powered by Mistral AI that provides comprehensive analysis of your code for security vulnerabilities, performance issues, and best practices.

AI Code Review Tool Next.js TypeScript

Features

  • 🤖 AI-Powered Analysis - Uses Mistral AI's latest models for intelligent code review
  • 🔒 Security Focus - Identifies SQL injection, XSS, authentication issues, and more
  • Performance Review - Detects algorithmic complexity and optimization opportunities
  • 📋 Best Practices - Ensures code quality, maintainability, and design patterns
  • 🎯 Multiple Languages - Supports JavaScript, TypeScript, Python, Java, Go, Rust, and more
  • 🎨 Clean UI - Modern, responsive interface built with Tailwind CSS
  • 📊 Severity Levels - Issues categorized as Critical, High, Medium, or Low
  • 💡 Actionable Suggestions - Each issue includes specific fix recommendations

Prerequisites

Quick Start

Option 1: Use Live Demo (Fastest)

Just visit: https://ai-code-review-tool-seven.vercel.app/

Option 2: Run Locally

  1. Clone the repository

    git clone git@github.com:het-tale/ai-code-review-tool.git
    cd ai-code-review-tool
  2. Install dependencies

    npm install
  3. Set up environment variables

    Create a .env.local file in the root directory:

    MISTRAL_API_KEY=your_mistral_api_key_here
  4. Run the development server

    npm run dev
  5. Open your browser

    Navigate to http://localhost:3000

Usage

  1. Paste Your Code - Copy and paste your code into the text area
  2. Select Language - Choose the programming language from the dropdown
  3. Choose Review Focus - Select what to focus on:
    • All - Comprehensive review (security + performance + best practices)
    • Security - Focus on vulnerabilities and security issues
    • Performance - Focus on optimization opportunities
    • Best Practices - Focus on code quality and maintainability
  4. Click "Review Code" - Get your AI-powered analysis in seconds
  5. Review Results - See issues categorized by severity with actionable suggestions

Quick Test

Click the "Load Sample" button to load example code with intentional issues for testing.

Project Structure

code-review-ai/
├── app/
│   ├── api/
│   │   └── review/
│   │       └── route.ts        # API endpoint for code review
│   ├── page.tsx                # Main page component
│   └── layout.tsx              # Root layout
├── components/
│   ├── CodeInput.tsx           # Code input form component
│   └── ReviewResults.tsx       # Results display component
├── lib/
│   └── mistral.ts              # Mistral AI client configuration
├── types/
│   └── index.ts                # TypeScript type definitions
├── .env.local                  # Environment variables (not in git)
└── README.md                   # This file

Tech Stack

  • Framework: Next.js (App Router)
  • Language: TypeScript
  • AI Model: Mistral AI SDK
  • Styling: Tailwind CSS
  • Runtime: Node.js

API Response Format

The tool returns structured JSON with the following format:

{
  "summary": "Brief overall assessment",
  "issues": [
    {
      "severity": "critical" | "high" | "medium" | "low",
      "title": "Issue title",
      "description": "Detailed description",
      "lineNumber": 5,
      "suggestion": "How to fix it"
    }
  ],
  "strengths": ["Positive aspects"],
  "recommendations": ["General improvements"]
}

Development

Code Quality

The project uses:

  • TypeScript for type safety
  • ESLint for code linting

Acknowledgments

About

Review Your Code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors