Skip to main content
AI Review is a monorepo platform made up of three runtime units that work together to deliver automated code review:

server

Hono API service. Handles webhooks, review orchestration, configuration, notifications, monitoring, and static asset hosting.

web

React 19 admin dashboard. Provides login, project config, review history, runner management, trend analysis, and system settings.

runner

Isolated executor. Polls the server for tasks and executes code reviews inside a Docker container.

Request flow

Server directory layout

The server source lives under apps/server/src/:

Infrastructure

Database

PostgreSQL is the primary data store, accessed through Drizzle ORM. The main schema is defined in db/schemas/index.ts and covers projects, reviews, files, comments, rules, templates, ratings, feedback, runners, notifications, and chat sessions. Required environment variable: DATABASE_URL.

Queue

Asynchronous work (review tasks, runner task dispatch) uses BullMQ backed by Redis.
BullMQ requires a running Redis instance. The queue is not an optional in-memory fallback — REDIS_URL must be set.

Auth

Better Auth provides two authentication modes:
  • Session auth — browser cookie, used by the web dashboard
  • API key auth — used by runners and API consumers
All API routes are served under the /api prefix. Auth endpoints are mounted at /api/auth/*.

Module registration

Business module routes are registered explicitly in modules/modules.generated.ts. Unlike auto-discovery frameworks, each module must be added to the moduleRoutes array manually:
Adding a new module requires updating modules.generated.ts. The file is labelled “generated” for historical reasons but is currently maintained by hand.

Middleware stack

Every request to /api passes through this ordered middleware chain:

Production mode

In production, the server hosts the compiled frontend assets alongside the API. This means you only need to deploy apps/server — it serves both /api/* and the static web dashboard from the same process.
During Docker builds, apps/web/dist is copied into apps/server/dist/public.

Business modules

The following modules are registered in the current codebase:

Review pipeline

reviews, review-details, rounds, webhook

AI & configuration

ai-configs, ai-models, platform-configs, config

Projects & rules

projects, rules, templates, ratings, feedbacks

Runners

runners

System operations

health, monitoring, performance, logs, backup, systems

Analytics & comms

statistics, trends, notifications, chat, chat-sessions