Skip to content

jonfriesen/codereview.dog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codereview.dog banner

AI-powered pull request reviews that don't suck.
Transforms GitHub PR diffs into scroll-based narrative documents with AI-generated explanations, interactive symbol references, and per-section verdicts.

Status: Archived Go 1.22+ React 19 Claude API SQLite


⚠️ This project is archived and no longer maintained. It was built as a demo/exploration of AI-powered code review UX. The code is available for reference and learning, but there are no plans for further development or support.


What is it?

codereview.dog rethinks the code review experience. Instead of the standard file-by-file diff view, it uses Claude to analyze a pull request and present it as a narrative document — grouping related changes into logical sections with AI-generated explanations woven between the code.

Paste any public GitHub PR URL and get back a structured review with:

  • 📚 Logical sections — Changes grouped by concept, not file
  • 🧠 AI annotations — Inline explanations between diff lines
  • 🔍 Interactive symbols — Hover over types/functions for definitions and docs
  • Per-section verdicts — Approve, revisit, or request changes on each section
  • 📊 Progress tracking — Visual progress through the review

Screenshots

Review Overview

AI-generated summary with logical section navigation, file badges, inline annotations, and concern callouts.

Review overview showing AI summary, section navigation, and annotated code

Symbol Hover & Annotations

Interactive symbol references with type definitions, package info, and jump-to-definition. AI concern annotations interleaved between diff lines.

Symbol hover popup and AI concern annotations in code review

Architecture

┌──────────────┐     ┌──────────────┐     ┌──────────────┐
│   React SPA  │────▶│   Go Server  │────▶│  GitHub API  │
│  (Vite/JSX)  │     │   (net/http) │     │              │
└──────────────┘     └──────┬───────┘     └──────────────┘
                            │
                     ┌──────┴───────┐     ┌──────────────┐
                     │   SQLite DB  │     │  Claude API  │
                     │   (cache)    │     │  (Anthropic) │
                     └──────────────┘     └──────────────┘
Layer Technology Notes
Frontend React 19 + Vite 5 Plain JSX, custom CSS, GitHub-dark theme
Backend Go 1.22+ net/http with standard library router
Database SQLite Pure Go via modernc.org/sqlite (no CGO)
AI Anthropic Claude Structured JSON output for analysis
Auth GitHub OAuth2 Web application flow with session cookies

How It Works

  1. Paste a PR URL — Any public GitHub pull request
  2. Fetch the diff — Server pulls the PR metadata and unified diff from GitHub's API
  3. AI analysis — Claude analyzes the diff and produces structured JSON:
    • Groups changes into logical sections
    • Writes narrative introductions for each section
    • Generates inline annotations between diff lines
    • Extracts symbol definitions for hover references
  4. Render the review — Frontend presents it as a scrollable narrative document
  5. Review — Mark each section as approved, needs-revisit, or request-change

Project Structure

server/             # Go backend
  main.go           # Entry point, routes, middleware
  internal/
    api/            # HTTP handlers (analyze, status, dashboard, submit)
    auth/           # GitHub OAuth + session management
    github/         # GitHub API client
    diff/           # Unified diff parser
    llm/            # Anthropic Claude client
    analysis/       # AI analysis orchestrator + prompts
    db/             # SQLite + migrations
  Makefile

web/                # React frontend
  src/
    pages/          # ReviewPage, LoginPage, DashboardPage
    components/     # DiffBlock, Annotation, SymbolHover, Verdict, etc.
    auth/           # Auth context + route guard
    lib/            # API client, utilities
  vite.config.js

mock/               # Standalone prototype (reference UI)
  src/
    PRReviewApp.jsx # All components + mock data (~2100 lines)

docs/               # Specs & screenshots

Running Locally

Prerequisites

Quick Start with Docker

git clone https://github.com/jonfriesen/codereview.dog.git
cd codereview.dog

# Create .env with your credentials
cat > .env << EOF
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
GITHUB_REDIRECT_URI=http://localhost:8000/auth/github/callback
LLM_API_KEY=your_anthropic_api_key
SESSION_SECRET=$(openssl rand -hex 32)
EOF

docker-compose up --build
# Open http://localhost:8000

Development

# Build everything (frontend + backend)
make

# Or run in dev mode
make dev

# Run tests
make test

Mock Prototype

The mock has a fully working UI with sample data — no backend or API keys needed:

cd mock && npm install && npm run dev
# Open http://localhost:8000

Environment Variables

Variable Required Default Description
PORT No 8000 Server listen port
APP_ENV No development development or production
GITHUB_CLIENT_ID Yes (prod) GitHub OAuth app client ID
GITHUB_CLIENT_SECRET Yes (prod) GitHub OAuth app client secret
GITHUB_REDIRECT_URI Yes (prod) OAuth callback URL
LLM_API_KEY Yes (prod) Anthropic API key
LLM_MODEL No claude-sonnet-4-20250514 Claude model to use
SESSION_SECRET Yes (prod) Cookie signing secret (≥32 chars)
DATABASE_PATH No ./codereview.db SQLite database path

In development mode, all "required" variables are optional and the app runs with limited functionality.

Key Design Decisions

  • Narrative over file-list — Reviews read like a document, not a file browser
  • AI annotations inline — Explanations appear between diff lines, not in a sidebar
  • Section-based verdicts — Review progress is per-concept, not per-file
  • No TypeScript — Plain JSX for simplicity; the codebase isn't large enough to need it
  • No CGO — Pure Go SQLite driver for easy cross-compilation and deployment
  • GitHub-dark aesthetic — Familiar to developers, easy on the eyes

License

MIT


Built by @jonfriesen on exe.dev as an exploration of AI-powered code review UX.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors