Skip to content

AnitSarkar123/AI_PR_REVIEWER

Repository files navigation

AI-powered GitHub code review platform that automatically reviews pull requests, provides actionable feedback, tracks repository activity, and helps developers maintain code quality.


✨ Features

πŸ€– AI Code Reviews

  • Automatic pull request analysis
  • AI-generated review comments
  • Review history tracking
  • PR quality insights

πŸ“¦ Repository Management

  • Connect GitHub repositories
  • Search and manage repositories
  • Repository activity tracking
  • GitHub integration

πŸ“Š Dashboard & Analytics

  • Contribution heatmap
  • Commit statistics
  • Pull request metrics
  • Monthly activity reports

πŸ” Authentication

  • Secure GitHub authentication
  • Session management
  • Protected routes

πŸ’³ Subscription System

  • Free and Pro plans
  • Usage limits
  • Subscription management
  • Billing integration

⚑ Background Processing

  • Automated repository indexing
  • Asynchronous review generation
  • Webhook handling
  • Event-driven workflows

πŸ—οΈ Tech Stack

Frontend

  • Next.js 16
  • React 19
  • TypeScript
  • Tailwind CSS v4
  • shadcn/ui
  • TanStack Query
  • Recharts

Backend

  • Next.js Server Actions
  • Prisma ORM
  • PostgreSQL
  • Better Auth

AI & Integrations

  • Google AI SDK
  • OpenAI Compatible SDK
  • GitHub API
  • Pinecone Vector Database

Infrastructure

  • Inngest
  • Polar Payments
  • GitHub Webhooks

πŸ“‚ Project Structure

Repository
└──ai_pr_reviewer/
    β”œβ”€β”€ README.md
    β”œβ”€β”€ components.json
    β”œβ”€β”€ css.d.ts
    β”œβ”€β”€ eslint.config.mjs
    β”œβ”€β”€ next.config.ts
    β”œβ”€β”€ package.json
    β”œβ”€β”€ postcss.config.mjs
    β”œβ”€β”€ prisma.config.ts
    β”œβ”€β”€ tsconfig.json
    β”œβ”€β”€ app/
    β”‚   β”œβ”€β”€ globals.css
    β”‚   β”œβ”€β”€ layout.tsx
    β”‚   β”œβ”€β”€ page.tsx
    β”‚   β”œβ”€β”€ (auth)/
    β”‚   β”‚   └── login/
    β”‚   β”‚       └── page.tsx
    β”‚   β”œβ”€β”€ api/
    β”‚   β”‚   β”œβ”€β”€ auth/
    β”‚   β”‚   β”‚   └── [...all]/
    β”‚   β”‚   β”‚       └── route.ts
    β”‚   β”‚   β”œβ”€β”€ inngest/
    β”‚   β”‚   β”‚   └── route.ts
    β”‚   β”‚   └── webhooks/
    β”‚   β”‚       └── github/
    β”‚   β”‚           └── route.ts
    β”‚   └── dashboard/
    β”‚       β”œβ”€β”€ layout.tsx
    β”‚       β”œβ”€β”€ page.tsx
    β”‚       β”œβ”€β”€ repository/
    β”‚       β”‚   └── page.tsx
    β”‚       β”œβ”€β”€ reviews/
    β”‚       β”‚   └── page.tsx
    β”‚       β”œβ”€β”€ settings/
    β”‚       β”‚   └── page.tsx
    β”‚       └── subscriptions/
    β”‚           └── page.tsx
    β”œβ”€β”€ components/
    β”‚   β”œβ”€β”€ app-sidebar.tsx
    β”‚   β”œβ”€β”€ providers/
    β”‚   β”‚   β”œβ”€β”€ query-provider.tsx
    β”‚   β”‚   β”œβ”€β”€ theme-provider.tsx
    β”‚   β”‚   └── toaster-provider.tsx
    β”‚   └── ui/
    β”œβ”€β”€ hooks/
    β”‚   └── use-mobile.ts
    β”œβ”€β”€ inngest/
    β”‚   β”œβ”€β”€ client.ts
    β”‚   └── functions/
    β”‚       β”œβ”€β”€ index.ts
    β”‚       └── review.ts
    β”œβ”€β”€ lib/
    β”‚   β”œβ”€β”€ auth-client.ts
    β”‚   β”œβ”€β”€ auth.ts
    β”‚   β”œβ”€β”€ db.ts
    β”‚   β”œβ”€β”€ pinecone.ts
    β”‚   β”œβ”€β”€ utils.ts
    β”‚   └── generated/
    β”‚       └── prisma/
    β”‚           β”œβ”€β”€ browser.ts
    β”‚           β”œβ”€β”€ client.ts
    β”‚           β”œβ”€β”€ commonInputTypes.ts
    β”‚           β”œβ”€β”€ enums.ts
    β”‚           β”œβ”€β”€ models.ts
    β”‚           β”œβ”€β”€ internal/
    β”‚           β”‚   β”œβ”€β”€ class.ts
    β”‚           β”‚   β”œβ”€β”€ prismaNamespace.ts
    β”‚           β”‚   └── prismaNamespaceBrowser.ts
    β”‚           └── models/
    β”‚               β”œβ”€β”€ UserUsage.ts
    β”‚               └── Verification.ts
    β”œβ”€β”€ module/
    β”‚   β”œβ”€β”€ ai/
    β”‚   β”‚   β”œβ”€β”€ actions/
    β”‚   β”‚   β”‚   └── index.ts
    β”‚   β”‚   └── lib/
    β”‚   β”‚       └── rag.ts
    β”‚   β”œβ”€β”€ auth/
    β”‚   β”‚   β”œβ”€β”€ components/
    β”‚   β”‚   β”‚   β”œβ”€β”€ login-ui.tsx
    β”‚   β”‚   β”‚   └── logout.tsx
    β”‚   β”‚   └── utils/
    β”‚   β”‚       └── auth-utils.ts
    β”‚   β”œβ”€β”€ dashboard/
    β”‚   β”‚   β”œβ”€β”€ actions/
    β”‚   β”‚   β”‚   └── index.ts
    β”‚   β”‚   └── components/
    β”‚   β”‚       └── contribution-graph.tsx
    β”‚   β”œβ”€β”€ github/
    β”‚   β”‚   └── lib/
    β”‚   β”‚       └── github.ts
    β”‚   β”œβ”€β”€ payment/
    β”‚   β”‚   β”œβ”€β”€ actions/
    β”‚   β”‚   β”‚   └── index.ts
    β”‚   β”‚   β”œβ”€β”€ config/
    β”‚   β”‚   β”‚   └── polar.ts
    β”‚   β”‚   └── lib/
    β”‚   β”‚       └── subscription.ts
    β”‚   β”œβ”€β”€ repository/
    β”‚   β”‚   β”œβ”€β”€ actions/
    β”‚   β”‚   β”‚   └── index.ts
    β”‚   β”‚   β”œβ”€β”€ components/
    β”‚   β”‚   β”‚   └── repository-skeleton.tsx
    β”‚   β”‚   └── hooks/
    β”‚   β”‚       β”œβ”€β”€ use-connect-repository.ts
    β”‚   β”‚       └── use-repositories.ts
    β”‚   β”œβ”€β”€ review/
    β”‚   β”‚   └── actions/
    β”‚   β”‚       └── index.ts
    β”‚   └── settings/
    β”‚       β”œβ”€β”€ actions/
    β”‚       β”‚   └── index.ts
    β”‚       └── components/
    β”‚           β”œβ”€β”€ profile-form.tsx
    β”‚           └── repository-list.tsx
    β”œβ”€β”€ prisma/
    β”‚   β”œβ”€β”€ schema.prisma
    β”‚   └── migrations/
    β”‚       β”œβ”€β”€ migration_lock.toml
    β”‚       β”œβ”€β”€ 20260329133431_test/
    β”‚       β”‚   └── migration.sql
    β”‚       β”œβ”€β”€ 20260329135849_authentication/
    β”‚       β”‚   └── migration.sql
    β”‚       β”œβ”€β”€ 20260402162416_repository_model_added/
    β”‚       β”‚   └── migration.sql
    β”‚       β”œβ”€β”€ 20260413093751_added_review_and_userusage/
    β”‚       β”‚   └── migration.sql
    β”‚       β”œβ”€β”€ 20260417153032_update/
    β”‚       β”‚   └── migration.sql
    β”‚       └── 20260426154209_added_polar_ids/
    β”‚           └── migration.sql
    └── .github/
        β”œβ”€β”€ ISSUE_TEMPLATE/
        β”‚   β”œβ”€β”€ bug_report.md
        β”‚   β”œβ”€β”€ documentation.md
        β”‚   └── feature_request.md
        └── PULL_REQUEST_TEMPLATE/
            └── PULL_REQUEST_TEMPLATE.


πŸš€ Getting Started

Prerequisites

  • Node.js 20+
  • PostgreSQL
  • GitHub OAuth App
  • Pinecone Account
  • AI Provider API Key

Installation

git clone https://github.com/your-username/AI_PR_REVIEWER.git
cd AI_PR_REVIEWER
npm install

Environment Variables

Create a .env file:

DATABASE_URL=
NEXT_PUBLIC_APP_URL=
NEXT_PUBLIC_APP_BASE_URL=

# GitHub Auth & API
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=

# AI Review Engine (OpenAI Compatible)
OPENAI_COMPATIBLE_API_KEY=
OPENAI_COMPATIBLE_BASE_URL=
OPENAI_COMPATIBLE_MODEL=

# Vector Database
PINECONE_DB_API_KEY=

# Authentication (Better-Auth)
BETTER_AUTH_SECRET=
BETTER_AUTH_URL=

# Payments (Polar.sh)
POLAR_ACCESS_TOKEN=
POLAR_WEBHOOK_SECRET=
POLAR_SUCCESS_URL=

Start Development Server

npm run dev

Open:

http://localhost:3000

πŸ”„ Workflow

  1. Sign in with GitHub.

  2. Connect repositories.

  3. Configure GitHub webhook.

  4. Open or update a Pull Request.

  5. CodeHorse automatically:

    • Receives webhook events
    • Fetches PR changes
    • Generates AI review
    • Stores review results
  6. View reviews from the dashboard.


πŸ“Έ Screenshots

Add screenshots here: image image


πŸ›£οΈ Roadmap

  • Inline review comments
  • Multi-model AI support
  • Team workspaces
  • Review quality scoring
  • Slack integration
  • GitLab support
  • Bitbucket support

🀝 Contributing

Contributions are welcome.

fork β†’ branch β†’ commit β†’ pull request

Please open an issue before submitting major changes.


⭐ Support

If you find this project useful:

  • Star the repository
  • Report bugs
  • Suggest features
  • Share feedback

Built with ❀️ using Next.js, Prisma, GitHub APIs, and AI.

Releases

No releases published

Packages

 
 
 

Contributors

Languages