2025
CodeRevU — AI-Powered GitHub PR Review
An AI-powered GitHub pull request review platform that automatically generates structured, actionable code reviews using Retrieval-Augmented Generation (RAG) and Gemini AI.
Technology Stack
Next.js 16TypeScriptPostgreSQLPrismaGemini AIPineconeInngestGitHub WebhooksBetter AuthPolar.shTanStack Query
Overview
System Architecture
- •Next.js 16 App Router Platform: Coordinates client interactions, Server Actions, API routes, and real-time dashboard UI using shadcn/ui and TanStack Query.
- •Auth: Better Auth validates sessions and enables credential-less GitHub OAuth flow.
- •Webhooks: Secures incoming GitHub repository updates via HMAC-SHA256 signatures, routed to a dedicated PR event handler validated by Zod schemas.
- •Dashboard: Renders dynamic repo analytics, review histories, and active project settings.
- •Payments: Manages free/pro subscription tiers and limits using Polar.sh checkout and billing gates.
- •Inngest Background Workers: Drives reliable, durable asynchronous queue workflows with built-in retry mechanisms and fine-grained concurrency limiters.
- •indexRepo: Triggered on project registration to crawl repository files via Octokit, generate embeddings, and bulk upsert them into the vector store.
- •generateReview: Triggered on pull request updates to analyze diff files, pull context-aware matches from the vector database, and format structured code feedback.
- •Data Stores: PostgreSQL (interfaced via Prisma ORM) manages user configurations and repository states. Pinecone DB holds 768-dimensional vector embeddings for low-latency similarity queries.
- •AI/LLM Engine: Google Gemini 2.5 Flash acts as the core model for both compiling vector embeddings during ingestion and formulating targeted reviews under precise grounding prompts.
Key Challenges
- •Indexing large repositories without blocking GitHub webhook flows.
- •Designing a RAG pipeline that retrieves semantically relevant code instead of naive file matches.
- •Handling concurrent PR events safely across multiple repositories.
- •Preventing hallucinated feedback by grounding LLM responses in real code context.
Key Learnings
- •Pinecone-based vector search significantly improved contextual relevance over keyword-based approaches.
- •Asynchronous workflows with Inngest prevented API blocking and enabled safe concurrency.
- •Structured prompts reduced noisy or vague review output.
- •Webhook-driven architectures require idempotency and replay safety.
Uniqueness
- •PR-level RAG instead of generic repo chat.
- •Fully automated review generation on PR open/update.
- •Structured feedback designed for real engineering teams.
Impact
- •Eliminated repetitive manual review effort for common PR patterns.
- •Enabled faster review cycles with consistent feedback quality.