Inspiration

What it does

About the Project

Inspiration

Commercial code review tools charge $15–50 per developer per month — pricing that puts them out of reach for open-source maintainers, indie developers, and small teams. Meanwhile, static linters catch syntax issues but miss architectural problems, and generic AI tools give one-size-fits-all feedback that drowns developers in false positives. We wanted to build something different: a code review assistant that actually learns what your team cares about and gets smarter over time — for free.

What It Does

CodeReview AI plugs into GitHub and GitLab via webhooks. When a PR or merge request is opened, it fetches the diff, runs it through DigitalOcean Gradient AI Serverless Inference, and posts structured findings as inline comments. An analytics dashboard tracks review metrics, findings, and team patterns.

The key differentiator is pattern learning. When a developer accepts a finding, the system extracts the underlying coding convention (style, architecture, naming). After $n \geq 3$ accepted findings per repository, the AI incorporates those patterns into future reviews — reducing false positive rate $F_p$ while increasing relevance:

$$R_{\text{relevance}} \propto \frac{\text{accepted findings}}{\text{total findings}} \quad \text{as } n_{\text{accepts}} \to \infty$$

How We Built It

The project is a pnpm monorepo with three services:

  • Webhook Service (Node.js/Express + Prisma) — receives GitHub/GitLab webhooks, manages reviews and findings, serves the dashboard API, and handles pattern extraction via accept/reject feedback
  • Inference Service (Python/Flask + Gradient SDK) — calls DigitalOcean Gradient AI (gradient SDK) for structured code analysis (/analyze), markdown reviews (/review), and pattern extraction (/extract-patterns)
  • Dashboard (React/Vite) — real-time analytics UI showing review history, findings, and learned team patterns

Infrastructure runs on DigitalOcean App Platform with a managed PostgreSQL database. The webhook and dashboard services are containerized (multi-stage Docker builds), and the inference service runs as a Python buildpack. All AI calls go through Gradient Serverless Inference — no other AI providers are used.

Challenges

  • pnpm in production containers — DigitalOcean's Node.js buildpack expects package-lock.json or yarn.lock. Since we use pnpm workspaces, we had to switch to Dockerfile-based builds. pnpm's symlink-based node_modules doesn't survive naive COPY commands between Docker stages, so we had to carefully structure the runtime stage with a fresh pnpm install rather than copying node_modules from the builder.

  • Prisma cross-platform binaries — Building on Alpine (linux-musl) and running on Debian (linux-gnu) produces incompatible Prisma query engine binaries. We solved this by using Alpine only for the builder stage, then doing a clean install + prisma generate in a Debian-based runtime stage to get the correct OpenSSL 3 binaries.

  • Monorepo workspace dependencies — The webhook service depends on @codereview-ai/db via workspace:*. Getting this to resolve correctly across Docker build contexts, App Platform's source_dir scoping, and pnpm's workspace protocol required careful orchestration of what gets copied and when.

What We Learned

  • Pattern learning is a powerful feedback loop — even a simple accept/reject mechanism creates a virtuous cycle where the AI gets more useful over time
  • Deploying pnpm monorepos to container platforms requires more Docker plumbing than single-package projects, but the developer experience tradeoff is worth it
  • DigitalOcean Gradient AI's serverless inference removes the operational burden of hosting models, letting us focus on the product layer

Built With

Share this project:

Updates