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 underapps/server/src/:
Infrastructure
Database
PostgreSQL is the primary data store, accessed through Drizzle ORM. The main schema is defined indb/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.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
/api prefix. Auth endpoints are mounted at /api/auth/*.
Module registration
Business module routes are registered explicitly inmodules/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:
| Middleware | Purpose |
|---|---|
| CORS | Cross-origin resource sharing headers |
| Request ID | Attaches a unique ID to each request |
| Trace | Distributed tracing support |
| Logger | Structured request/response logging |
| Secure Headers | Security-related HTTP headers |
| Body Limit | Guards against oversized request bodies |
| Timeout | Terminates requests that run too long |
| Rate Limit | Throttles excessive clients |
Production mode
In production, the server hosts the compiled frontend assets alongside the API. This means you only need to deployapps/server — it serves both /api/* and the static web dashboard from the same process.
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, webhookAI & configuration
ai-configs, ai-models, platform-configs, configProjects & rules
projects, rules, templates, ratings, feedbacksRunners
runnersSystem operations
health, monitoring, performance, logs, backup, systemsAnalytics & comms
statistics, trends, notifications, chat, chat-sessions