Skip to content

paraspatankar/codebunny

CodeBunny Logo

🐰 CodeBunny

AI-Powered Code Reviews for GitHub Pull Requests

Features β€’ Tech Stack β€’ Getting Started β€’ Environment β€’ Contributing


✨ Features

  • πŸ€– AI-Powered Reviews - Automatically generate intelligent code reviews for your pull requests using Google's Gemini AI
  • πŸ”— GitHub Integration - Seamlessly connect your repositories with one-click OAuth authentication
  • πŸ“Š Dashboard Analytics - Track your coding activity, commits, PRs, and AI reviews with beautiful visualizations
  • 🎯 RAG-Enhanced Context - Retrieval-Augmented Generation using Pinecone for codebase-aware reviews
  • ⚑ Real-time Processing - Background job processing with Inngest for non-blocking review generation
  • πŸ“ˆ Contribution Graphs - Visualize your coding frequency over time
  • πŸŒ™ Modern UI - Beautiful, responsive interface built with Shadcn/UI and TailwindCSS

πŸ› οΈ Tech Stack

Category Technology
Framework Next.js 16 (App Router)
Language TypeScript
Styling TailwindCSS 4 + Shadcn/UI
Database PostgreSQL + Prisma ORM
Authentication Better Auth (GitHub OAuth)
AI Google Gemini via AI SDK
Vector Store Pinecone
Background Jobs Inngest
Data Fetching TanStack Query
Package Manager Bun

πŸ“‹ Prerequisites

Before you begin, ensure you have the following installed:

You'll also need accounts for:

πŸš€ Getting Started

1. Clone the Repository

git clone https://github.com/yourusername/codebunny.git
cd codebunny

2. Install Dependencies

bun install
# or
npm install

3. Set Up Environment Variables

Copy the example environment file and fill in your values:

cp .env.example .env

See Environment Variables for detailed configuration.

4. Set Up the Database

# Generate Prisma client
bun prisma generate

# Run migrations
bun prisma migrate dev

5. Start the Development Server

bun run dev

6. Start Inngest Dev Server (in a separate terminal)

npx inngest-cli@latest dev

7. (Optional) Expose Local Server for Webhooks

For GitHub webhooks during development, use ngrok:

ngrok http 3000

Open http://localhost:3000 to see the application.

βš™οΈ Environment Variables

Create a .env file in the root directory with the following variables:

# Database
DATABASE_URL="postgresql://user:password@localhost:5432/codebunny"

# Better Auth
BETTER_AUTH_SECRET="your-secret-key-here"
BETTER_AUTH_URL="http://localhost:3000"

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

# Application URL (use ngrok URL for webhooks during development)
NEXT_PUBLIC_APP_BASE_URL="http://localhost:3000"

# Google AI (Gemini)
GOOGLE_GENERATIVE_AI_API_KEY="your-gemini-api-key"

# Pinecone (Vector Store)
PINECONE_DB="your-pinecone-db-name"
PINECONE_DB_API_KEY="your-pinecone-api-key"

Getting API Keys

Service How to Get
GitHub OAuth Create OAuth App β†’ Set callback URL to http://localhost:3000/api/auth/callback/github
Google Gemini Google AI Studio β†’ Create API key
Pinecone Pinecone Console β†’ Create account β†’ Get API key and database name

πŸ“ Project Structure

codebunny/
β”œβ”€β”€ app/                    # Next.js App Router pages
β”‚   β”œβ”€β”€ (auth)/            # Authentication routes
β”‚   β”œβ”€β”€ api/               # API routes & webhooks
β”‚   └── dashboard/         # Dashboard pages
β”œβ”€β”€ components/            # Reusable UI components
β”‚   └── ui/               # Shadcn/UI components
β”œβ”€β”€ hooks/                 # Custom React hooks
β”œβ”€β”€ inngest/              # Inngest background functions
β”‚   └── function/         # Review generation logic
β”œβ”€β”€ lib/                   # Utility functions & configs
β”œβ”€β”€ module/               # Feature modules
β”‚   β”œβ”€β”€ ai/              # AI review logic
β”‚   β”œβ”€β”€ auth/            # Authentication utilities
β”‚   β”œβ”€β”€ dashboard/       # Dashboard actions
β”‚   β”œβ”€β”€ github/          # GitHub API integration
β”‚   β”œβ”€β”€ repository/      # Repository management
β”‚   β”œβ”€β”€ review/          # Review management
β”‚   └── settings/        # User settings
β”œβ”€β”€ prisma/               # Database schema & migrations
└── public/               # Static assets

πŸ”„ How It Works

  1. Connect Repository - User authenticates with GitHub and connects their repositories
  2. Webhook Setup - CodeBunny registers a webhook on the connected repository
  3. PR Event - When a pull request is opened or updated, GitHub sends a webhook
  4. AI Processing - Inngest picks up the event and:
    • Fetches the PR diff from GitHub
    • Retrieves relevant context from Pinecone (RAG)
    • Generates a comprehensive review using Gemini AI
  5. Post Review - The AI review is posted as a comment on the PR
  6. Dashboard - User can view all reviews and analytics in the dashboard

🀝 Contributing

Contributions are welcome! Please read our Contributing Guide and Code of Conduct before submitting a pull request.

πŸ”’ Security

For security concerns, please review our Security Policy.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with ❀️ by Paras Patankar

About

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •