Skip to content

GizzZmo/Code-ReViewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
GHBanner

πŸ€– Gemini Code Reviewer

CI Deploy License: MIT

An AI-powered code review tool that provides instant, comprehensive feedback on your code using Google's Gemini API

πŸš€ Live Demo | πŸ“– Documentation | 🀝 Contributing


πŸ“‹ Table of Contents

πŸ’‘ New to the project? Check out our Documentation Guide to navigate all available docs!

🎯 Overview

Gemini Code Reviewer is a web-based application that leverages Google's powerful Gemini AI to provide instant, expert-level code reviews. Simply paste your code, and get comprehensive feedback on:

  • πŸ› Bugs & Issues - Identify logical errors and edge cases
  • ⚑ Performance - Discover bottlenecks and optimization opportunities
  • πŸ“– Readability - Improve code style and naming conventions
  • 🎯 Best Practices - Learn modern patterns and techniques
  • πŸ”’ Security - Detect potential vulnerabilities

Built with React, TypeScript, and Vite for a fast, modern development experience.

✨ Features

Core Functionality

  • πŸ€– AI-Powered Analysis - Leverages Gemini 2.5 Flash for intelligent code review
  • πŸ’» Syntax Highlighting - Clear code presentation with proper formatting
  • πŸ“ Markdown Output - Well-structured, readable feedback
  • ⚑ Real-time Processing - Fast response times with streaming support
  • 🎨 Modern UI - Clean, responsive interface built with Tailwind CSS
  1. Build and deploy - No API key needed at build time!
  2. Push to main - automatic deployment to GitHub Pages
  3. Create releases with git tag v1.0.0
  4. Configure API key - Users enter their API key at runtime in the browser

Developer Experience

  • πŸ”§ TypeScript - Full type safety and autocomplete
  • ⚑ Vite - Lightning-fast development and builds
  • 🎯 React 19 - Latest React features and optimizations
  • πŸ”„ Hot Reload - Instant feedback during development

DevOps & Deployment

  • πŸš€ Automated CI/CD - GitHub Actions workflows for testing and deployment
  • πŸ“¦ Release Management - Automated releases with changelog generation
  • 🌍 Multi-Environment - Staging and production deployments
  • πŸ”’ Security Scanning - Automated security audits and secret detection
  • πŸ“Š Build Monitoring - Artifact validation and size tracking

πŸš€ Quick Start

Prerequisites

  • Node.js 18.x or 20.x
  • npm or yarn
  • Google Gemini API key (Get one here)

Installation

  1. Clone the repository

    git clone https://github.com/GizzZmo/Code-ReViewer.git
    cd Code-ReViewer
  2. Install dependencies

    npm install
  3. Set up environment variables

    cp .env.example .env.local

    Edit .env.local and add your Gemini API key:

    GEMINI_API_KEY=your_api_key_here
  4. Start the development server

  5. Run the app:

    npm run dev
  6. Open your browser Navigate to http://localhost:5173

πŸ“– Usage

Basic Code Review

  1. Paste your code into the left editor panel
  2. Click "Review Code" button
  3. View AI feedback in the right panel with detailed analysis

Example Review

// Paste this code to see a sample review
function calculateSum(arr) {
  var total = 0;
  for (var i = 0; i <= arr.length; i++) {
    total = total + arr[i];
  }
  return total;
}

The AI will identify:

  • Off-by-one error in the loop
  • Use of var instead of const/let
  • Missing input validation
  • Suggestions for modern JavaScript features

βš™οΈ Configuration

Environment Variables

Variable Description Required Default
GEMINI_API_KEY Your Google Gemini API key βœ… Yes -
NODE_ENV Environment mode ❌ No development

Customizing the AI Prompt

Edit services/geminiService.ts to customize the review criteria:

const systemInstruction = `
  Your custom review instructions here...
`;

πŸš€ Deployment

Quick Deploy to GitHub Pages

  1. Add API key to repository secrets

    • Go to Settings β†’ Secrets and variables β†’ Actions
    • Add GEMINI_API_KEY secret
  2. Push to main branch

    git push origin main
  3. Automatic deployment

    • GitHub Actions will build and deploy automatically
    • Access at https://yourusername.github.io/Code-ReViewer

Other Deployment Options

  • Vercel: One-click deploy with automatic builds
  • Netlify: Drag-and-drop or Git integration
  • Custom Hosting: Use the dist/ folder after npm run build

πŸ“– See DEPLOYMENT.md for detailed deployment instructions.

πŸ› οΈ Development

Project Structure

Code-ReViewer/
β”œβ”€β”€ .github/workflows/     # GitHub Actions workflows
β”œβ”€β”€ components/            # React components
β”‚   β”œβ”€β”€ CodeEditor.tsx    # Code input component
β”‚   β”œβ”€β”€ ReviewOutput.tsx  # Review display component
β”‚   β”œβ”€β”€ Header.tsx        # App header
β”‚   └── icons/            # SVG icon components
β”œβ”€β”€ services/             
β”‚   └── geminiService.ts  # Gemini API integration
β”œβ”€β”€ App.tsx               # Main application component
β”œβ”€β”€ index.tsx             # Application entry point
β”œβ”€β”€ index.html            # HTML template
β”œβ”€β”€ vite.config.ts        # Vite configuration
└── tsconfig.json         # TypeScript configuration

Available Scripts

Command Description
npm run dev Start development server
npm run build Build for production
npm run preview Preview production build
npx tsc --noEmit Type check without building

Code Quality

# Type checking
npx tsc --noEmit

# Security audit
npm audit

# Build size analysis
npm run build

πŸ“š API Reference

reviewCode(code: string): Promise<string>

Main function to review code using Gemini API.

Parameters:

  • code (string): The code snippet to review

Returns:

  • Promise<string>: Markdown-formatted review

Example:

import { reviewCode } from './services/geminiService';

const review = await reviewCode('function hello() { console.log("Hello"); }');
console.log(review);

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Quick Contribution Steps

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow TypeScript best practices
  • Maintain existing code style
  • Add tests for new features
  • Update documentation as needed
  • Ensure all CI checks pass =======
  1. Configure your API key:
    • Open the app in your browser
    • Enter your Gemini API key in the configuration panel at the top
    • Your API key is stored securely in your browser's local storage
    • Get your API key from Google AI Studio

Note: The API key is no longer required at build time. Users can configure their API key directly in the application UI, and it's stored locally in their browser.

πŸ€– GitHub Workflows

This repository includes comprehensive GitHub Actions workflows:

  • πŸ”„ CI/CD - Automated testing and building on every push
  • πŸš€ Deployment - GitHub Pages and custom deployments
  • πŸ“¦ Release Management - Automated releases and packaging
  • πŸ”’ Security - Secret validation and security scanning
  • 🌍 Multi-Environment - Staging and production deployments

πŸ“– See .github/workflows/README.md for detailed workflow documentation.

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“ž Support


Made with ❀️ by the Code-ReViewer team

⭐ Star us on GitHub β€” it motivates us a lot!

About

AI Driven with AR support

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •