An AI-powered GitHub pull request review bot — similar in spirit to CodeRabbit. On every PR
open/update, it reads the diff, resolves where changed functions/exports are used elsewhere in
the diff, and posts a single AI-generated review summary. Contributors can @mention the bot
in a reply to ask follow-up questions about the review.
Status: under active implementation. See
PROGRESS.mdfor exactly what's built, tested, and still outstanding, service by service.
Three independently deployable services:
| Service | Path | Stack | Responsibility |
|---|---|---|---|
| web | apps/web |
Next.js | User dashboard — connect repos, view review history |
| api | apps/api |
Node/Express | Source of truth — auth, GitHub webhooks, orchestration, persistence |
| ai-service | apps/ai-service |
Python/FastAPI | Stateless AI compute — review generation, agent harness |
Full reasoning for every major decision lives in docs/architecture/ as ADRs — read those
before changing anything structural. Quick map:
docs/PRD.md— what we're building, why, and the resolved product decisionsdocs/architecture/00-system-overview.md— how the three services fit together, request lifecycledocs/architecture/data-model.md— entities, theReviewJobstate machine, the conversational-reply data modeldocs/architecture/ADR-*.md— one decision per file, with trade-offs- Every
apps/*folder (and its subfolders) has its ownREADME.mdexplaining exactly what belongs there — read the nearest one before adding a file to a folder you haven't touched yet
- Docker + Docker Compose — everything runs containerized, nothing needs to be installed on the host beyond Docker itself
- A GitHub App registered for local development (App ID, private key, webhook secret) — see Setting up the GitHub App below
- An OpenAI API key
- A tunnel to localhost for GitHub webhook delivery — smee.io or
ngrok both work; GitHub can't reach
localhost:4000directly
git clone <this-repo>
cd archadi-pr-review
# 1. Copy env templates and fill them in (see "Environment variables" below)
cp .env.example .env
cp apps/api/.env.example apps/api/.env
cp apps/ai-service/.env.example apps/ai-service/.env
# 2. Start everything — Postgres, api, ai-service, web, and the Inngest Dev Server
make dev
# 3. In a second terminal, once Postgres is healthy, run migrations + seed data
make db-migrate
make db-seedThat's it — make dev brings up the full stack with hot reload on all three services.
| Service | URL |
|---|---|
| web (dashboard) | http://localhost:3000 |
| api | http://localhost:4000 |
| api health check | http://localhost:4000/health |
| ai-service | http://localhost:8000 |
| ai-service health check | http://localhost:8000/health |
| Inngest Dev Server (job/event inspector) | http://localhost:8288 |
| Postgres | localhost:5432 |
Stop everything with make down. Tail logs with make logs.
Three env files, each copied from a .env.example next to it:
.env(repo root) — shared Postgres credentials + local port overrides, consumed bydocker-compose.local.ymlapps/api/.env— database URL, JWT secret, GitHub App credentials, ai-service client config (timeouts, circuit-breaker thresholds), Inngest keysapps/ai-service/.env— OpenAI API key/model, and every guardrail threshold (diff token cap, max findings, max conversation history, max reply length, max request body size)
Every var is documented inline in its .env.example file — nothing is undocumented.
The bot authenticates as a GitHub App, not a personal OAuth token (see ADR-007 for why). To set one up for local development:
- GitHub → Settings → Developer settings → GitHub Apps → New GitHub App
- Webhook URL: point it at your tunnel (e.g. the
smee.ioURL), which forwards tohttp://localhost:4000/webhooks/github - Webhook secret: generate one, put it in
apps/api/.envasGITHUB_WEBHOOK_SECRET - Permissions: Pull requests (Read & write), Issues (Read & write), Metadata (Read-only)
- Subscribe to events: Pull request, Issue comment
- After creating the App, note the App ID (
GITHUB_APP_ID) and generate a private key (GITHUB_APP_PRIVATE_KEY— the PEM contents; if stored as a single-line env var, literal\nsequences are handled automatically, seeapps/api/src/integrations/github/app-auth.js) - Install the App on a test repository
Full step-by-step troubleshooting (webhook not arriving, jobs stuck, etc.) is in
docs/runbooks/local-development.md.
make dev # start the full local stack (hot reload, all ports exposed)
make prod # start the prod-configured stack (api/web ports exposed directly, no bind mounts)
make down # stop the local stack
make logs # tail logs from all local services
make db-migrate # run pending Sequelize migrations (apps/api)
make db-seed # load local demo fixturesarchadi-pr-review/
├── docs/ # PRD, ADRs, data model, runbooks
├── apps/
│ ├── web/ # Next.js frontend — not yet implemented, see PROGRESS.md
│ ├── api/ # Node/Express backend — auth, webhooks, orchestration
│ │ └── src/
│ │ ├── routes|controllers|services|repositories|models/ # layered architecture
│ │ ├── db/{migrations,seeders}/
│ │ ├── integrations/{github,ai-service-client}/
│ │ ├── jobs/ # Inngest functions (the review pipeline)
│ │ └── constants|middlewares|config|utils/
│ └── ai-service/ # Python FastAPI — review generation, agent harness
│ └── app/
│ ├── api|core|agents|services|schemas|utils/
├── infra/
│ ├── docker/{local,prod}/
├── docker-compose.local.yml
├── docker-compose.prod.yml
└── Makefile
This repo is being built incrementally, service by service. PROGRESS.md
is the single source of truth for what's done, what's stubbed, and what's next — read it
before assuming a piece of functionality exists.