Skip to content

akanksha106-code/code-reviewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Reviewer - Powered by Gemini AI

A modern code review application using Google's Gemini AI to analyze code and provide detailed feedback on quality, best practices, and potential improvements.

Features

  • 🚀 Real-time Code Analysis: Get immediate feedback on your code
  • 🔍 Detailed Code Reviews: Receive comprehensive analysis from an AI with senior developer expertise
  • 💡 Improvement Suggestions: Get actionable recommendations to improve your code
  • Modern UI: Clean, intuitive interface for a seamless experience

Prerequisites

  • Node.js v18 or higher
  • Google Gemini API key (for the AI powered reviews)

Installation

1. Clone the repository

git clone https://github.com/akanksha106-code/code-reviewer.git
cd code-reviewer

2. Set up the Backend

cd BackEnd
npm install

# Create a .env file with your Gemini API key
echo "GOOGLE_GEMINI_KEY=your_gemini_api_key_here" > .env

# Start the backend server
node server.js

The backend will run on http://localhost:3000

3. Set up the Frontend

cd ../Frontend
npm install

# Start the frontend development server
npm run dev

The frontend will run on http://localhost:5173

Environment Variables

Backend

The backend requires the following environment variables:

# Server Configuration
NODE_ENV=development
PORT=3000

# MongoDB Configuration
MONGODB_URI=mongodb://localhost:27017/code-reviewer

# JWT Configuration
JWT_SECRET=your_jwt_secret_key_here

# CORS Configuration
ALLOWED_ORIGINS=http://localhost:5173,http://localhost:3000

# API Keys
GOOGLE_GEMINI_KEY=your_gemini_api_key_here

Copy the .env.example file to .env and update the values accordingly:

cd BackEnd
cp .env.example .env

Frontend

The frontend requires the following environment variables:

# API Configuration
VITE_API_URL=http://localhost:3000/api

Copy the frontend .env.example file:

cd Frontend
cp .env.example .env

Docker Setup

This application can be run using Docker containers. Make sure you have Docker and Docker Compose installed on your system.

Running with Docker

  1. Clone the repository:
git clone <repository-url>
cd code-reviewer
  1. Set up environment variables:
# Create a .env file in the root directory
echo "GOOGLE_GEMINI_KEY=your_gemini_api_key_here" > .env
  1. Start the application using Docker Compose:
docker-compose up --build

This will start both the frontend and backend services:

To stop the application:

docker-compose down

Services included in Docker setup:

The MongoDB data is persisted using a Docker volume named mongodb_data.

Development with Docker

The Docker setup includes volume mounts for both frontend and backend, enabling hot-reload during development. Any changes you make to the source code will be reflected immediately in the running containers.

Usage

  1. Enter your code in the editor on the left side
  2. Click the "Review Code" button
  3. View the AI-generated review on the right side

Project Structure

code-reviewer/
├── BackEnd/             # Express.js backend
│   ├── src/
│   │   ├── controllers/ # Request handlers
│   │   ├── routes/      # API routes
│   │   ├── services/    # Business logic
│   │   └── app.js       # Express app setup
│   ├── .env             # Environment variables
│   └── server.js        # Server entry point
│
└── Frontend/            # React frontend
    ├── public/          # Static assets
    └── src/             # React components and styles

Technologies Used

Backend

  • Node.js
  • Express.js
  • Google Generative AI (@google/generative-ai)

Frontend

  • React
  • Vite
  • CSS3
  • Prism.js (code highlighting)
  • Axios (API requests)

License

MIT

Acknowledgements

  • Google Gemini AI for providing the code review capabilities
  • React and the open-source community for the amazing tools

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages