Catches bugs, security issues, and bad patterns before merge β without slowing your CI.
Live demo Β· Install bot Β· Docs
Codexa is a GitHub App that auto-reviews every pull request with AI. It catches bugs, security issues, and bad patterns before merge, and posts findings as a single review comment with file, line, severity, and concrete fix suggestions β plus a status check that can block merges on critical issues.
- Frontend β Next.js 15 (App Router) + Tailwind + Framer Motion β Vercel
- Backend β FastAPI + httpx + structlog β Render (Docker)
- AI β Gemini 2.0 Flash (primary) β Groq Llama 3.3 70B (fallback) β both free
- DB / Auth β Supabase (Postgres + GitHub OAuth) β free
- CI/CD β GitHub Actions
Total monthly cost on default tier: $0.
ββββββββββββββββ PR opened ββββββββββββββββββ
β GitHub β ββββββββββββββββββΆ β FastAPI β
β (PR + App) β webhook (HMAC) β /webhooks/... β
ββββββββββββββββ βββββββββ¬βββββββββ
β² β background task
β comment posted βΌ
β ββββββββββββββββββ
β β AIRouter β
β β β Gemini β
β β β Groq (fb) β
β βββββββββ¬βββββββββ
β βΌ
β ββββββββββββββββββ
ββββββββββββββββββββββββββββββ render comment β
β + log Supabase β
ββββββββββββββββββ
The Next.js dashboard reads from /reviews and /reviews/stats to show activity.
codexa/
βββ backend/ # FastAPI service
β βββ app/
β β βββ main.py # FastAPI factory
β β βββ config.py # Pydantic settings
β β βββ core/ # logging, security (HMAC, JWT)
β β βββ routes/ # /webhooks/github, /reviews, /healthz
β β βββ services/
β β β βββ ai/ # gemini.py, groq.py, router.py, parser.py
β β β βββ github.py # diff fetch, comment post, token cache
β β β βββ reviewer.py # orchestrates a single review
β β βββ db/supabase.py # service-role client
β βββ requirements.txt
β βββ Dockerfile
βββ frontend/ # Next.js 15
β βββ app/
β β βββ page.tsx # landing
β β βββ login/ # GitHub OAuth via Supabase
β β βββ auth/callback/ # OAuth callback handler
β β βββ dashboard/ # overview, reviews, settings
β βββ components/
β β βββ landing/ # hero, features, how-it-works, pricing, cta
β β βββ ui/ # button, badge
β β βββ navbar.tsx
β βββ lib/supabase/ # client, server, middleware
β βββ middleware.ts # protects /dashboard
βββ supabase/migrations/001_init.sql
βββ .github/workflows/ # ci.yml, deploy.yml
βββ render.yaml # backend deploy descriptor
βββ docker-compose.yml # local backend
- Node 20+, Python 3.12+, Docker (optional)
- A free Supabase project, a Gemini API key, a Groq API key
- A GitHub App (instructions below)
git clone <repo> codexa && cd codexa
cp .env.example .env
cp backend/.env.example backend/.env
cp frontend/.env.local.example frontend/.env.localFill in the values in each .env* file.
Go to github.com β Settings β Developer settings β GitHub Apps β New GitHub App.
| Field | Value |
|---|---|
| Name | Codexa (must be unique on GitHub) |
| Homepage URL | http://localhost:3000 |
| Webhook URL | https://<your-tunnel>.ngrok.io/webhooks/github (use ngrok in dev) |
| Webhook secret | a long random string β paste into GITHUB_WEBHOOK_SECRET |
| Repository permissions | Pull requests: Read & write, Contents: Read, Metadata: Read |
| Subscribe to events | Pull request |
After creating: note the App ID, generate a private key (.pem), and install the app on
a test repo. Paste the .pem contents into GITHUB_APP_PRIVATE_KEY (newlines as \n).
In the Supabase SQL editor, run supabase/migrations/001_init.sql.
In Authentication β Providers β GitHub, enable GitHub OAuth and paste the OAuth client ID/secret
from your GitHub App. Add http://localhost:3000/auth/callback and your production URL to the
allowed redirect URLs.
- Gemini β https://aistudio.google.com/app/apikey (1,500 req/day free)
- Groq β https://console.groq.com/keys (free tier, very fast)
Two terminals:
# Backend
cd backend
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reload# Frontend
cd frontend
npm install
npm run devOpen http://localhost:3000.
ngrok http 8000
# Copy the https URL into your GitHub App's webhook URL
# Open a PR in a repo where the App is installed β Codexa comments within ~10s- Push the repo to GitHub.
- On Render, New + Blueprint β point to your repo. It picks up
render.yaml. - Set the environment variables from
backend/.envin the Render dashboard. - Update the GitHub App webhook URL to
https://<your-render-url>/webhooks/github.
- Import the repo on Vercel. Set the Root Directory to
frontend. - Add the env vars from
frontend/.env.local.example(pointNEXT_PUBLIC_BACKEND_URLat Render). - Deploy. Add the production domain to your Supabase OAuth allowed URLs.
Already provisioned β just keep the project on the free tier.
- GitHub fires a
pull_requestwebhook with actionopened,reopened,synchronize, orready_for_review. core/security.verify_webhook_signaturevalidates the HMAC SHA-256 againstGITHUB_WEBHOOK_SECRET.- We mint a short-lived installation access token (
core/security.create_app_jwtβ/installations/:id/access_tokens), cached for 50 min. - We fetch the unified diff via
Accept: application/vnd.github.v3.diff. services/ai/router.AIRoutertries Gemini first; if it raises, falls back to Groq.- The model returns strict JSON: a summary plus an array of findings.
- We render a Markdown comment and POST to
/repos/:owner/:repo/issues/:n/comments. - The result is logged to the
reviewstable.
Tunable bits:
services/ai/prompt.SYSTEM_PROMPTβ change tone, focus areas, severity rubricservices/ai/prompt.build_user_promptβ diff truncation threshold (default 60 KB)services/github.render_review_commentβ comment formattingroutes/webhooks._REVIEWABLE_ACTIONSβ which PR events trigger a review
| Component | Provider | Free tier |
|---|---|---|
| Frontend | Vercel | 100 GB bandwidth / month |
| Backend | Render (Docker) | 750 hours / month |
| Database | Supabase | 500 MB Postgres + 50k MAU |
| AI #1 | Google Gemini | 1,500 requests / day |
| AI #2 | Groq (Llama 3.3) | Generous free tier |
| CI | GitHub Actions | 2,000 min / month (private) |
If you hit Gemini's daily cap, every subsequent review automatically falls through to Groq.
MIT.