Skip to content

feat: Phase 1 complete — full OpenBunny implementation#1

Open
RichardBray wants to merge 8 commits intomainfrom
feature/initial-implementation
Open

feat: Phase 1 complete — full OpenBunny implementation#1
RichardBray wants to merge 8 commits intomainfrom
feature/initial-implementation

Conversation

@RichardBray
Copy link
Copy Markdown
Member

Summary

  • Phases 1–7 of the phased build plan implemented end-to-end
  • Full monorepo scaffold with Bun workspaces, Prisma, TypeScript strict mode
  • Complete API server (Hono), worker pipeline (BullMQ), and React + Vite UI
  • Docker Compose stack ready for self-hosting

What's included

  • Phase 1 — Monorepo foundation: package.json, tsconfig.json, Prisma schema, Playwright scaffold
  • Phase 2 — Core packages: config.ts, db.ts, github.ts, crypto.ts (AES-256-GCM, TDD)
  • Phase 3 — AI gateway: ai.ts supporting OpenAI, Anthropic, Google, openai-compatible, Ollama
  • Phase 4 — API server: Hono + Better Auth, setup wizard routes, repos/settings APIs, webhook handler (Gap 2 resolved: webhook secret loaded from DB)
  • Phase 5 — Worker pipeline: ESLint/Ruff/ShellCheck linters, Semgrep/Gitleaks/Trivy security, context retrieval, diff parser, AI review generator, @openbunny chat commands
  • Phase 6 — Web dashboard: React SPA with setup wizard (3 steps), repos page, settings page, dashboard; 4 Playwright E2E specs
  • Phase 7 — Docker Compose (5 services), Dockerfiles, nginx, .env.example, README, FSL-1.0 license

Test Plan

  • bun test ./src — 2/2 unit tests pass (crypto round-trip + random IV)
  • tsc --noEmit — TypeScript clean across all packages
  • docker-compose up -d and visit http://localhost:3001 to run setup wizard
  • Open a PR on an enabled repo and verify AI review is posted
  • Run bun run test:e2e against a live stack

🤖 Generated with Claude Code

Richard Oliver Bray and others added 8 commits March 10, 2026 21:28
- package.json with Bun workspaces, scripts for api/worker/ui/test
- tsconfig.json with strict mode, bundler resolution, path aliases
- .gitignore for node_modules, dist, env files, Playwright output
- prisma/schema.prisma with AppConfig, Repository, Review models
- src/api/routes, src/worker, src/lib (linters/security/context) dirs
- apps/e2e: Playwright config, base fixture, seed script

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- src/lib/config.ts: Zod config schema with env + file loading
- src/lib/db.ts: Prisma client singleton
- src/lib/github.ts: Octokit wrapper, verifyWebhookSignature, getInstallationOctokit
- src/lib/crypto.ts: AES-256-GCM encrypt/decrypt (TDD, 2/2 tests pass)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- src/lib/ai.ts: createAIModel() supporting openai, anthropic, google,
  openai-compatible, and ollama providers
- Exports OPENAI_REVIEW_MODELS and OPENAI_LIGHT_MODELS presets for UI
- Fix Playwright config workers type with exactOptionalPropertyTypes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- src/api/env.ts: Zod env validation
- src/api/auth.ts: Better Auth with Prisma adapter (email+password)
- src/api/routes/health.ts: GET /api/health
- src/api/routes/webhook.ts: GitHub webhook handler, PR → BullMQ queue,
  installation event handler
- src/api/routes/setup.ts: /api/setup/status, /api/setup/admin,
  /api/github/manifest, /api/github/manifest-callback,
  /api/github/install-callback
- src/api/routes/repos.ts: GET/PATCH /api/repos, POST /api/repos/auto-enroll
- src/api/routes/settings.ts: GET/PATCH /api/settings with masked key response
- src/api/index.ts: server entrypoint — Gap 2 resolved (webhook secret
  loaded from app_config DB at startup, not env var)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…mmands

- src/lib/linters/: ESLint, Ruff, ShellCheck runners (subprocess, JSON output)
- src/lib/security/: Semgrep, Gitleaks, Trivy wrappers
- src/lib/context/: grep-based caller/callee/test context retrieval
- src/lib/diff.ts: unified diff parser, path filter, trivial change detection
- src/lib/review.ts: AI prompt builder, generateReview(), postReview()
- src/lib/commands.ts: @openbunny chat command parser and handler
- src/worker/env.ts: worker env validation
- src/worker/index.ts: BullMQ workers for review and comment jobs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- apps/ui: Vite + React SPA with dark GitHub-style theme
  - SetupWizard: 3-step flow (admin account → GitHub App → repos)
  - ReposPage: table with enable/disable toggles
  - SettingsPage: API key (masked) + model dropdowns
  - DashboardPage: recent reviews table with status colours
  - App.tsx: auto-redirect to /setup if setupComplete: false
- apps/e2e/tests: Playwright specs for all 4 flows (mocked API)
  - setup-wizard.spec.ts, repos.spec.ts, settings.spec.ts, dashboard.spec.ts
- bun test scoped to src/ to avoid picking up Playwright specs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- docker-compose.yml: 5 services (postgres, redis, api, worker, ui)
  with healthchecks and dependency ordering
- Dockerfile.api: Bun image, Prisma generate + migrate, starts API
- Dockerfile.worker: Bun image with git/node for static analysis tools
- Dockerfile.ui: Vite build → nginx with SPA fallback + /api proxy
- nginx.conf: reverse proxy /api to api service, SPA fallback
- .env.example: documented env vars with generation instructions
- .dockerignore: exclude node_modules, dist, .env, docs from image
- LICENSE: FSL-1.0-Apache-2.0
- README.md: setup wizard quick-start, architecture diagram, env table

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant