Back

PR Reviewer

Designed an event-driven backend for automated PR analysis using step workflows, semantic retrieval, and vector-based code insights.

TypeScript
Node.js
Inngest
Pinecone
betterAuth
LiveGitHub

AI Reviewer

AI Reviewer is a Next.js application that connects a GitHub App to your repositories and uses AI to review pull requests automatically. It combines authentication, repository syncing, background jobs, and billing workflows in a single product experience.

What it does

Tech stack

Prerequisites

Before running the app locally, make sure you have:

Local development

  1. Install dependencies
npm install
  1. Create a local environment file
cp .env.example .env.local

If there is no .env.example in the repository, create .env.local manually with the variables below.

  1. Set up the database
npx prisma generate
npx prisma migrate dev
  1. Start the app
npm run dev

The app will be available at http://localhost:3000.

Required environment variables

Add the following values to your environment:

DATABASE_URL=postgresql://username:password@localhost:5432/chaicode

GITHUB_CLIENT_ID=your_github_oauth_app_client_id
GITHUB_CLIENT_SECRET=your_github_oauth_app_client_secret
GITHUB_APP_ID=your_github_app_id
GITHUB_APP_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n..."
GITHUB_APP_WEBHOOK_SECRET=your_github_webhook_secret
NEXT_PUBLIC_GITHUB_PUBLIC_LINK=https://github.com/settings/apps/your-app-name

OPENROUTER_API_KEY=your_openrouter_key

PINECONE_API_KEY=your_pinecone_api_key
PINECONE_INDEX=your_pinecone_index_name

RAZORPAY_KEY_ID=your_razorpay_key_id
RAZORPAY_KEY_SECRET=your_razorpay_key_secret
RAZORPAY_PLAN_ID=your_razorpay_plan_id
RAZORPAY_WEBHOOK_SECRET=your_razorpay_webhook_secret

Background jobs and webhooks

This project uses Inngest for asynchronous work such as PR review processing and repository syncing. Start it alongside the app:

npx inngest dev

For GitHub webhooks, your local app needs a public URL. A common setup is:

ngrok http 3000

Then configure your GitHub App webhook URL to point at the public tunnel and the /api/github/webhook route.

Useful commands

npm run dev
npm run build
npm run lint
npx prisma studio

Project structure highlights

Notes