ReviewPilot is an AI-powered GitHub code review assistant that automatically analyzes your pull requests, provides constructive feedback, and helps you merge with confidence. Built with Next.js and powered by Google's Gemini 2.5 Flash, ReviewPilot understands your entire codebase to give context-aware code reviews.
- Automated PR Reviews: Automatically generates detailed code reviews when a PR review is requested.
- Context-Aware Analysis: Uses Retrieval-Augmented Generation (RAG) to understand the context of the PR by analyzing your entire indexed codebase (powered by Pinecone).
- Comprehensive Feedback: Each review includes:
- 📝 Walkthrough: File-by-file explanation of changes.
- 📊 Sequence Diagram: Visualizes the flow of changes using Mermaid.js.
- 🎯 Strengths & Issues: Highlights good practices and identifies potential bugs or code smells.
- 💡 Suggestions: Actionable improvements for your code.
- 🎨 Poem: A creative, short poem summarizing the PR changes!
- Seamless GitHub Integration: Posts the review directly as a comment on your pull request.
- Dashboard: View and manage all your repository reviews in one place.
- Subscription Model: Integrated with Polar.sh for managing usage tiers and billing.
- Framework: Next.js 16 (App Router)
- Database: PostgreSQL with Prisma ORM
- Authentication: Better Auth (GitHub OAuth)
- AI Models: Google Generative AI (
gemini-2.5-flash), Vercel AI SDK - Vector Database: Pinecone (for codebase RAG)
- Background Jobs: Inngest for reliable event-driven queue processing
- Payments & Subscriptions: Polar
- Styling: Tailwind CSS v4, Radix UI Primitives, shadcn/ui components
- Node.js 20+
- PostgreSQL database
- GitHub OAuth App (for authentication and webhooks)
- Pinecone API Key
- Google Gemini API Key
- Polar Account (for handling subscriptions)
-
Clone the repository
git clone https://github.com/your-username/reviewpilot.git cd reviewpilot -
Install dependencies
npm install # or yarn / pnpm / bun install -
Set up Environment Variables Create a
.envfile in the root directory and configure the required environment variables:# Database DATABASE_URL="postgresql://user:password@localhost:5432/reviewpilot" # Next Auth / Better Auth BETTER_AUTH_SECRET="your-auth-secret" BETTER_AUTH_URL="http://localhost:3000" # GitHub OAuth GITHUB_CLIENT_ID="your-github-client-id" GITHUB_CLIENT_SECRET="your-github-client-secret" # AI & Vector DB GOOGLE_GENERATIVE_AI_API_KEY="your-gemini-api-key" PINECONE_API_KEY="your-pinecone-api-key" # Inngest INNGEST_EVENT_KEY="local" INNGEST_SIGNING_KEY="local" # Polar Subscriptions POLAR_ACCESS_TOKEN="your-polar-access-token" POLAR_WEBHOOK_SECRET="your-polar-webhook-secret" POLAR_SUCCESS_URL="http://localhost:3000/dashboard/subscription?success=true"
-
Initialize Database
npx prisma generate npx prisma db push
-
Run the Development Server
npm run dev
-
Start Inngest Dev Server (in a separate terminal)
npx inngest-cli@latest dev
Open http://localhost:3000 with your browser to see the application.
- Connect Repository: Users authenticate via GitHub and connect a repository.
- Codebase Indexing: The
index-repoInngest function triggers, reading the repository's files and indexing them into Pinecone for semantic search. - PR Review Trigger: When a
pr.review.requestedevent occurs, thegenerate-reviewInngest function is triggered. - Context Retrieval: ReviewPilot fetches the PR diff and queries the Pinecone vector database using the PR title and description to fetch relevant codebase context.
- AI Generation: Gemini 2.5 Flash analyzes the diff and context to generate a comprehensive review.
- GitHub Comment: The generated review is posted back to the GitHub PR automatically.
This project is open-source and available under the MIT License.