Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

AI Code Reviewer 🚀

An intelligent web application that leverages the Google Gemini API to provide instant, expert-level code reviews. Paste your code and receive detailed feedback on quality, best practices, performance, and potential bugs, just as you would from a senior developer.

AI Code Reviewer Demo (Image is a representative mock-up of the application's UI)


✨ Features

  • Interactive Code Editor: A clean, simple code editor with JavaScript syntax highlighting powered by PrismJS.
  • Expert AI Analysis: The backend uses Google's gemini-2.0-flash model with a detailed system instruction to act as a Senior Code Reviewer with 7+ years of experience.
  • Comprehensive Feedback: The review covers:
    • Code Quality & Best Practices
    • Efficiency & Performance Bottlenecks
    • Error Detection & Security Vulnerabilities
    • Readability & Maintainability
    • Adherence to DRY & SOLID principles
  • Formatted Output: The AI's response is rendered as Markdown, preserving code blocks, lists, and other formatting for easy reading.
  • Modern Tech Stack: Built with a React/Vite frontend and a Node.js/Express backend.

🛠️ Tech Stack

  • Frontend:

    • React
    • Vite
    • Axios
    • Prism.js
    • Markdown
  • Backend:

    • Node.js
    • Express.js
  • AI Service:

    • Google Gemini

📦 Getting Started

Follow these instructions to get the project up and running on your local machine.

Prerequisites

Project Structure

For this guide, we'll assume your project is structured with separate frontend and backend directories.

1. Backend Setup

First, let's configure and run the backend server.

  1. Navigate to the backend directory:

    cd backend
  2. Install dependencies:

    npm install
  3. Create an environment file: Create a file named .env in the backend root directory.

  4. Add your API key to the .env file:

    # .env
    GOOGLE_GEMINI_KEY="YOUR_GOOGLE_GEMINI_API_KEY"

    Replace YOUR_GOOGLE_GEMINI_API_KEY with your actual key.

  5. Start the backend server:

    npm start

    The server should now be running on http://localhost:3000.

2. Frontend Setup

Now, let's get the React frontend running.

  1. Open a new terminal and navigate to the frontend directory:

    cd frontend
  2. Install dependencies:

    npm install
  3. Start the frontend development server:

    npm run dev

    The React application should now be running and accessible at http://localhost:5173 (or another port if 5173 is busy).


🚀 Usage

  1. Open your web browser and navigate to the frontend URL (e.g., http://localhost:5173).
  2. You will see a code editor on the left and an empty review panel on the right.
  3. Paste or write any JavaScript code snippet into the editor.
  4. Click the "Review" button.
  5. The application will send your code to the backend, which queries the Gemini API.
  6. The AI-generated code review will appear in the right-hand panel, formatted for readability.

🤝 Contributing

Contributions are welcome! If you have suggestions for improvements, please feel free to fork the repository, create a new branch, and submit a pull request.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License.

About

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages