Skip to content

Repository files navigation

GitHub PR Reviewer

An AI-powered code review system that automatically analyzes GitHub pull requests and provides comprehensive feedback on code quality, security, and best practices.

✨ Features

  • 🔐 GitHub OAuth Integration - Secure authentication with your GitHub account
  • 🤖 AI-Powered Analysis - DeepSeek (via OpenRouter) powered code review with intelligent suggestions
  • 🔒 Security Scanning - Automated detection of security vulnerabilities
  • 📊 Code Quality Metrics - Complexity analysis and code smell detection
  • 📈 Analytics Dashboard - Insights and trends from your code reviews
  • 📄 Export Reports - Download analysis results in Markdown or JSON format
  • 🎨 Modern UI - Clean, responsive interface built with Next.js and Tailwind CSS

🚀 Tech Stack

  • Frontend: Next.js 14, TypeScript, Tailwind CSS, shadcn/ui
  • Backend: Next.js API Routes, PostgreSQL, Prisma ORM
  • Authentication: NextAuth.js with GitHub OAuth
  • AI: DeepSeek Chat Model via OpenRouter API
  • GitHub Integration: Octokit REST API
  • Charts: Recharts
  • Deployment: Vercel + Railway/Neon Database

🛠️ Setup & Installation

Prerequisites

  • Node.js 18+ and npm
  • PostgreSQL database
  • GitHub OAuth App
  • OpenRouter API key (for DeepSeek model access)

1. Clone the repository

git clone https://github.com/yourusername/github-pr-reviewer.git
cd github-pr-reviewer

2. Install dependencies

npm install

3. Set up environment variables

Create a .env.local file in the root directory:

# Database
DATABASE_URL="postgresql://username:password@localhost:5432/pr_reviewer"

# NextAuth.js
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-secret-key"

# GitHub OAuth
GITHUB_CLIENT_ID="your-github-client-id"
GITHUB_CLIENT_SECRET="your-github-client-secret"

# OpenRouter API
OPENROUTER_API_KEY="your-openrouter-api-key"

4. Set up the database

# Generate Prisma client
npx prisma generate

# Push the database schema
npx prisma db push

# (Optional) Seed the database
npx prisma db seed

5. Run the development server

npm run dev

Open http://localhost:3000 with your browser to see the result.

📦 Deployment

Vercel Deployment

  1. Push your code to GitHub
  2. Connect your repository to Vercel
  3. Set the environment variables in Vercel dashboard
  4. Deploy - Vercel will automatically run prisma generate during build

Environment Variables for Production

Make sure to set all the required environment variables in your Vercel dashboard:

  • DATABASE_URL
  • NEXTAUTH_URL
  • NEXTAUTH_SECRET
  • GITHUB_CLIENT_ID
  • GITHUB_CLIENT_SECRET
  • OPENROUTER_API_KEY

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages