An advanced AI-powered code review platform that leverages Google Gemini 1.5 Pro to provide comprehensive code analysis. Built with modern web technologies for developers who want to improve code quality, catch bugs early, and follow best practices.
- GitHub Integration - Fetch and analyze any public repository
- AI-Powered Reviews - Google Gemini 1.5 Pro provides expert-level feedback
- Interactive Code Viewer - Syntax highlighting with clickable line comments
- Real-time Processing - Instant analysis without database dependencies
- Smart Caching - 7-day localStorage cache for faster re-visits
- Responsive Design - Works seamlessly on desktop, tablet, and mobile
- Dark/Light Mode - Automatic theme detection with manual toggle
- Smooth Animations - Framer Motion powered transitions
- 3D Visual Effects - Interactive background elements
- Multiple AI Models - Fallback system ensures reliability
- TypeScript First - Full type safety throughout the application
- Component Library - Reusable UI components built on Radix UI
- Modern Architecture - Next.js 15 with App Router
- Next.js 15 - React framework with App Router
- React 19 - Latest React features and optimizations
- TypeScript 5 - Type safety and developer experience
- Tailwind CSS 4 - Utility-first styling framework
- Framer Motion - Smooth animations and interactions
- Convex - Real-time backend platform
- Google Gemini AI - Advanced language model for code analysis
- GitHub API - Repository data fetching
- Zod - Runtime type validation
- Radix UI - Accessible component primitives
- React Syntax Highlighter - Code syntax highlighting
- Lucide React - Beautiful icon library
- Node.js 18+ (LTS recommended)
- Google Gemini API Key - Get yours here
- Convex Account - Sign up free
-
Clone and install
git clone https://github.com/gauravxdev/CodeReviewAgent.git cd ai-agent-code-review npm install
-
Set up environment variables
# Create .env.local GOOGLE_GENERATIVE_AI_API_KEY=your_gemini_api_key_here
-
Initialize Convex backend
npx convex dev
-
Start development server
npm run dev
-
Open your browser Navigate to
http://localhost:3000
- Enter any GitHub repository URL (e.g.,
facebook/react
) - Supports both full URLs and owner/repo format
- Smart filtering excludes large files and config directories
- Files cached locally for 7 days
- Three-panel interface: File list | Code viewer | AI review
- Resizable panels for optimal viewing
- Interactive highlighting - click on highlighted lines for detailed feedback
- Syntax highlighting for 20+ programming languages
- Primary: Google Gemini 1.5 Pro for comprehensive analysis
- Fallback: Pattern-based review system for reliability
- Real-time: No database storage, instant results
- Smart prompting: Context-aware analysis based on file type
graph TB
A[π€ User] --> B[π Next.js Frontend]
B --> C[π± GitHub API]
B --> D[β‘ Convex Backend]
D --> E[π€ Google Gemini AI]
B --> F[πΎ Local Storage]
F --> G[π
7-day Cache]
D --> H[π Fallback System]
subgraph "π¨ Frontend Features"
I[π₯ Repository Fetcher]
J[ποΈ Code Viewer]
K[π Review Display]
L[β‘ Interactive UI]
end
B --> I
B --> J
B --> K
B --> L
ai-agent-code-review/
βββ π± app/ # Next.js App Router
β βββ π api/ # API endpoints
β βββ π code/page.tsx # Repository input
β βββ π codereview/page.tsx # Review interface
β βββ π page.tsx # Landing page
βββ π§© components/ # React components
β βββ π¨ ui/ # Reusable UI library
β βββ π code-review.tsx # Review display
β βββ ποΈ file-content.tsx # Code viewer
β βββ π₯οΈ review-client.tsx # Main interface
βββ β‘ convex/ # Backend functions
β βββ π€ agent.ts # AI integration
β βββ π fallbackReview.ts # Backup system
βββ π¨ components/ui/ # Component library
βββ π button.tsx # Button variants
βββ π card.tsx # Card layouts
βββ π¬ dialog.tsx # Modal dialogs
# Development
npm run dev # Start dev server with Turbopack
npx convex dev # Start Convex backend
# Production
npm run build # Build for production
npm run start # Start production server
# Code Quality
npm run lint # Run ESLint
- UI Components β
components/ui/
- Feature Components β
components/
- API Routes β
app/api/
- Backend Logic β
convex/
- New Pages β
app/
- TypeScript strict mode with explicit typing
- ESLint with Next.js and TypeScript rules
- Tailwind CSS for styling with custom design tokens
- Path aliases using
@/
prefix - Functional components with hooks
# Required
CONVEX_DEPLOYMENT=your-convex-deployment-url
NEXT_PUBLIC_CONVEX_URL=https://your-convex-url.convex.cloud
GOOGLE_GENERATIVE_AI_API_KEY=your-google-gemini-api-key
GEMINI_API_KEY=your-gemini-api-key
NEXT_PUBLIC_GITHUB_TOKEN=your-github-token
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your-clerk-publishable-key
CLERK_SECRET_KEY=your-clerk-secret-key
The AI can review code in 20+ languages including:
- JavaScript/TypeScript
- Python, Java, C++
- Go, Rust, Swift
- HTML/CSS, SQL
- And many more...
- Connect your GitHub repository
- Add environment variables
- Deploy automatically
- Netlify: Build command
npm run build
, publish.next
- Railway: Add
GOOGLE_GENERATIVE_AI_API_KEY
- Self-hosted: Use
npm run build && npm start
Don't forget to deploy your Convex backend:
npx convex deploy
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes following the code style guidelines
- Test thoroughly with
npm run build
- Submit a pull request
- Follow TypeScript strict mode
- Add proper type definitions
- Include JSDoc comments for complex functions
- Test on multiple screen sizes
- Ensure accessibility compliance
- π Beginner's Guide - Complete setup and development guide
- π§ AGENT.md - Development commands and coding standards
- π¨ Component Library - UI component documentation
API Key Problems
# Verify your environment variables
echo $GOOGLE_GENERATIVE_AI_API_KEY
Convex Connection Issues
# Restart Convex development server
npx convex dev --clear
Build Errors
# Check TypeScript errors
npm run build
# Fix linting issues
npm run lint
This project is licensed under the MIT License. See LICENSE for details.
- Google AI for the Gemini API
- Convex for the amazing backend platform
- Vercel for Next.js and deployment
- Radix UI for accessible components
- Tailwind CSS for the styling system
- π Bug Reports: GitHub Issues
- π§ Contact: Open an issue for support
Made with β€οΈ for developers who care about code quality
β Star this repo if you find it helpful!