This project consists of two main components:
- AI Agent Backend: A Python/FastAPI service that listens for Gitea webhooks, analyzes pull requests using Google's Gemini models, and posts review comments.
- Product Website: A premium, Linear-style landing page built with Next.js to showcase the bot's features.
/(Root): Contains the Python backend code (receiver.py,agent_runner.py, etc.)./prreviewbot: Contains the Next.js website source code.
The backend implements a webhook receiver that listens for Gitea pull request events (opened, synchronize), fetches the PR diff, uses a Google ADK agent (powered by Gemini) to analyze the code changes (specifically targeting Flutter/Dart), and posts the review comments back to the Gitea pull request.
- Receives Gitea webhooks for pull request events.
- Verifies webhook signatures for security.
- Fetches PR diff content from the Gitea API.
- Invokes a Google ADK agent with a specialized prompt for Flutter/Dart code review.
- Posts the AI-generated review as a comment on the Gitea PR.
- Built with FastAPI for the web server.
- Designed for deployment on Google Cloud Run.
The following environment variables are required:
GITEA_URL: The base URL of your Gitea instance.GITEA_API_TOKEN: A Gitea API token with permissions to read repositories and post comments.GITEA_WEBHOOK_SECRET: The secret key configured for your Gitea webhook.GOOGLE_APPLICATION_CREDENTIALS: Path to your Google Cloud service account key file (if running locally).
-
Install Dependencies:
pip install -r requirements.txt
-
Run the Server:
uvicorn receiver:app --host 0.0.0.0 --port 8080 --reload
-
Expose to Internet (for Webhooks): Use
ngrokto expose your local server:ngrok http 8080
Use the generated URL in your Gitea Webhook settings.
Refer to the Dockerfile and standard gcloud run deploy commands to deploy this service. Ensure secrets are mounted correctly as described in the code.
The project includes a modern, high-performance landing page built with Next.js 15 and Tailwind CSS.
- Linear-style Design: Dark mode, glassmorphism, and subtle glow effects.
- Responsive: Fully optimized for mobile and desktop.
- Bento Grid Layout: Showcase features in a modern grid.
- Tech Stack: Next.js 15, React 19, Tailwind CSS v4, Lucide Icons.
-
Navigate to the website directory:
cd prreviewbot -
Install Dependencies:
npm install # or bun install -
Run Development Server:
npm run dev # or bun run dev -
Open in Browser: Navigate to http://localhost:3000.
- Go to your Gitea repository settings -> Webhooks.
- Click "Add Webhook" -> Gitea.
- Target URL: Enter the URL of your deployed Python service (e.g.,
https://your-cloud-run-url/webhook). - Secret: Enter the configured
GITEA_WEBHOOK_SECRET. - Trigger On: Pull Request (Opened, Synchronized).
© 2025 PRReviewBot. All rights reserved.