An AI-powered code review tool that provides instant, comprehensive feedback on your code using Google's Gemini API
- Overview
- Features
- Quick Start
- Installation
- Usage
- Configuration
- Deployment
- Development
- API Reference
- Contributing
- License
π‘ New to the project? Check out our Documentation Guide to navigate all available docs!
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.
- π€ 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
- Build and deploy - No API key needed at build time!
- Push to main - automatic deployment to GitHub Pages
- Create releases with
git tag v1.0.0 - Configure API key - Users enter their API key at runtime in the browser
- π§ 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
- π 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
- Node.js 18.x or 20.x
- npm or yarn
- Google Gemini API key (Get one here)
-
Clone the repository
git clone https://github.com/GizzZmo/Code-ReViewer.git cd Code-ReViewer -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env.local
Edit
.env.localand add your Gemini API key:GEMINI_API_KEY=your_api_key_here
-
Start the development server
-
Run the app:
npm run dev
-
Open your browser Navigate to
http://localhost:5173
- Paste your code into the left editor panel
- Click "Review Code" button
- View AI feedback in the right panel with detailed analysis
// 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
varinstead ofconst/let - Missing input validation
- Suggestions for modern JavaScript features
| Variable | Description | Required | Default |
|---|---|---|---|
GEMINI_API_KEY |
Your Google Gemini API key | β Yes | - |
NODE_ENV |
Environment mode | β No | development |
Edit services/geminiService.ts to customize the review criteria:
const systemInstruction = `
Your custom review instructions here...
`;-
Add API key to repository secrets
- Go to Settings β Secrets and variables β Actions
- Add
GEMINI_API_KEYsecret
-
Push to main branch
git push origin main
-
Automatic deployment
- GitHub Actions will build and deploy automatically
- Access at
https://yourusername.github.io/Code-ReViewer
- Vercel: One-click deploy with automatic builds
- Netlify: Drag-and-drop or Git integration
- Custom Hosting: Use the
dist/folder afternpm run build
π See DEPLOYMENT.md for detailed deployment instructions.
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
| 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 |
# Type checking
npx tsc --noEmit
# Security audit
npm audit
# Build size analysis
npm run buildMain 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);We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow TypeScript best practices
- Maintain existing code style
- Add tests for new features
- Update documentation as needed
- Ensure all CI checks pass =======
- 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.
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.
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Google Gemini API
- Powered by React and Vite
- UI styled with Tailwind CSS
- π§ Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
- π Documentation: Full Documentation
β Star us on GitHub β it motivates us a lot!