An AI-Powered Code Review Bot for your Pull Requests
Lamp is a GitHub App that automatically reviews Pull Requests and posts AI-generated feedback. Built with Next.js Hono, it listens for webhook events, fetches changed files, and generates comments on open PRs—helping teams quickly review and refine their code.
Install page: https://github.com/apps/lampbot
-
Install the App
Head over to the Lamp PR Bot App Page.- Click Install to grant Lamp access to your desired repositories.
-
Open a Pull Request
- Once installed, open (or update) a PR in any repo where Lamp is installed.
- Lamp automatically listens for the
pull_requestevent.
-
Receive AI-Generated Feedback
- The bot reviews the PR’s changed files and posts a comment with AI-based suggestions.
- Login with github at lampbot.io to build custom prompts and manage repositories.
-
Fork the Repository:
Fork the project repo to your personal github -
Configure Environment Variables:
-
Copy the example file to create your local .env:
cp .env.example .env -
Update the values in your .env file
- (Ignore the NEONDATABASE_URL and all GITHUB* env values for now)
- Generate a JWT_SECRET:
openssl rand -base64 32 - Get a GROQ_API_KEY: https://console.groq.com/login
-
-
Set Up Vercel Hosting:
- Log in to Vercel.
- Select your forked repository to host the project
-
Go to your Vercel Project Page -> Storage
- Click Create Database and select Neon
- Choose your closest region and free plan
- Hit Connect and copy your database url
- Set the NEON_DATABASE_URL in your .env
-
Apply the schema
-
run the following command:
psql "<your_db_string>" < ./lib/db/schema.sql
-
If you update or create a new table to output the new sql schema run pg_dump --schema-only --no-owner --no-privileges "DATABASE_URL" > lib/db/schema.sql
To test webhook functionality, create and configure a GitHub App as follows:
-
Create the GitHub App:
- Go to GitHub → Settings → Developer settings → GitHub Apps.
- Click on New GitHub App.
-
Fill Out Basic Information:
- Homepage URL: Use your hosted URL from Vercel (e.g.,
https://your-app.vercel.app). - Webhook URL: Set this to your webhook endpoint (e.g.,
https://your-app.vercel.app/api/webhook).
- Homepage URL: Use your hosted URL from Vercel (e.g.,
-
Set App Permissions: Under the Permissions & Webhooks section, configure the following permissions:
- Commit Status: Read and Write
- Contents: Read-only
- Pull Requests: Read and Write
-
Subscribe to Events: In the same section, subscribe to:
- Pull Request events
- *Push events
-
Save and Install the App:
- Save your changes.
- Install the GitHub App on the target repositories where you plan to test the webhook functionality.
-
Add the following values from your app to your .env
- GITHUB_APP_ID
- GITHUB_APP_PRIVATE_KEY (convert this to base64:
echo -n '<my_key>' | openssl base64)
-
Navigate to GitHub Developer Settings:
- Log in to your GitHub account.
- Go to Settings -> Developer Settings -> OAuth Apps.
-
Register a New OAuth Application:
- Fill in the required details:
- Homepage URL: (
https://your-app.vercel.app) - Authorization Callback URL: (
https://your-app.vercel.app/api/auth/callback)
- Homepage URL: (
- Fill in the required details:
-
Retrieve Your Client Credentials:
- After the app is created, GitHub will provide you with a Client ID.
- Click on Generate a new client secret to create your Client Secret.
-
Add the values to your .env and vercel environmental variables
GITHUB_CLIENT_ID=your_github_client_idGITHUB_CLIENT_SECRET=your_github_client_secretGITHUB_CALLBACK_URL=https://your-app.vercel.app/api/auth/callback(Use the dev server for your .env's local callback url:
http://localhost:3000/api/auth/github/callback)