A web application which uses the Google Gemini API to provide automated, AI-powered reviews for source code files. Users can upload a code file through a simple dashboard and receive a detailed report on readability, performance, best practices, and potential bugs.
- Simple Web Dashboard: Easy-to-use interface for uploading code files.
- AI-Powered Analysis: Leverages the Google Gemini API to generate in-depth code reviews.
- Structured Reports: Get feedback organized into key areas like Readability, Performance, and Best Practices.
- Fast Setup: Runs locally with minimal configuration.
- Real-time Feedback: The dashboard provides status updates while the AI is at work.
- Backend: Python, Flask
- Frontend: HTML, CSS, JavaScript
- AI Model: Google Gemini Pro
- Dependencies:
google-generativeai,python-dotenv
Follow these instructions to set up and run the project on your local machine.
- Python 3.7+
- A Google Gemini API Key
-
Clone the repository:
git clone [https://github.com/YourUsername/code-review-assistant.git](https://github.com/YourUsername/code-review-assistant.git) cd code-review-assistant -
Create and activate a Python virtual environment:
- Windows:
python -m venv venv venv\Scripts\activate
- macOS / Linux:
python3 -m venv venv source venv/bin/activate
- Windows:
-
Install the required dependencies:
pip install -r requirements.txt
-
Set up your environment variables:
- Create a new file named
.envin the root of the project directory. - Add your Google Gemini API key to this file:
GOOGLE_API_KEY="YOUR_API_KEY_HERE"
- Create a new file named
-
Start the Flask server:
flask run
-
Open the application:
- Navigate to
http://127.0.0.1:5000in your web browser.
- Navigate to
- Open the web application in your browser.
- Click the "Select Code File" button.
- Choose a source code file (e.g.,
.py,.js,.java) from your computer. - The application will automatically upload the file and display status updates.
- Once the analysis is complete, a detailed review report will appear on the dashboard.