How aryan22n/novamerge works
NovaMerge is a GitHub-integrated AI pull-request reviewer. A GitHub PR webhook records the pending review and dispatches background work; the review function processes diff chunks, retrieves optional repository context, generates an AI review, posts it to the PR, and updates status. Users authenticate with GitHub, connect the GitHub App, sync repositories, and inspect review history and detail in the dashboard. The graph includes documented but unsampled webhook and integration behavior; uncertain implementation links are omitted.
Main entry points: review-pr-function.ts Review job · db.ts Application database · repo-sync.ts Repository indexing · webhook-handler.ts Webhook handling
Components 29
Identity and GitHub
- GitHub sign-in
features/auth/components/github-sign-in-form.tsx - Auth actions
features/auth/actions/index.ts - Auth service
lib/auth.ts - App installation
features/github/server/installation.ts - PR webhook
app/api/github/webhook/route.ts - Webhook handling
features/github/server/webhook-handler.ts
Dashboard and review history
- Overview dashboard
features/overview/server/get-overview.ts - Repository listing API
app/api/github/repos/route.ts - Repository query
features/github/lib/repos-query.ts - Repository list UI
features/dashboard/components/repo-list.tsx - PR history
features/pull-requests/server/get-pull-requests.ts - PR detail
app/(protected)/dashboard/pull-requests/[id]/page.tsx
Repository indexing
- Sync controls
features/repo-sync/components/sync-repo-button.tsx - Sync action
features/repo-sync/actions/repo-sync.ts - Sync job
features/repo-sync/server/repo-sync-function.ts - Repository indexing
features/repo-sync/server/repo-sync.ts
AI review processing
- Review job
features/reviews/server/review-pr-function.ts - Diff chunking
features/reviews/utils/chunk-code.ts - PR file retrieval
features/reviews/server/pr-files.ts - Review vector search
features/reviews/server/vector.ts - AI review generation
features/reviews/server/generate-review.ts - PR comment posting
features/reviews/server/post-pr-comment.ts
Persistence and jobs
- Application database
lib/db.ts - Inngest client
features/inngest/client.ts - Job registration
app/api/inngest/route.ts
Other components
- User
- GitHub
- OpenRouter AI
features/ai/index.ts - Pinecone
features/pinecone/client.ts
Connections 39
- User → GitHub sign-in: starts sign-in
- GitHub sign-in → Auth actions: submits to
features/auth/actions/index.ts - Auth actions → Auth service: authenticates with
features/auth/actions/index.ts - Auth service → Application database: stores sessions
lib/auth.ts - GitHub → App installation: returns install callback
- App installation → Application database: stores installation
features/github/server/installation.ts - GitHub → PR webhook: sends PR event
- PR webhook → Webhook handling: delegates handling
- Webhook handling → Application database: saves PR
features/github/server/webhook-handler.ts - Webhook handling → Inngest client: dispatches review event
features/github/server/webhook-handler.ts - User → Overview dashboard: views dashboard
- Overview dashboard → Application database: reads activity
features/overview/server/get-overview.ts - User → Repository query: browses repositories
- Repository query → Repository listing API: fetches pages
features/github/lib/repos-query.ts - Repository listing API → App installation: gets installation
app/api/github/repos/route.ts - Repository listing API → Application database: reads sync status
app/api/github/repos/route.ts - Repository query → Repository list UI: provides pages
features/dashboard/components/repo-list.tsx - User → PR history: browses reviews
- PR history → Application database: reads PR records
features/pull-requests/server/get-pull-requests.ts - User → PR detail: opens review detail
app/(protected)/dashboard/pull-requests/[id]/page.tsx - PR detail → Application database: loads review
- User → Sync controls: requests code sync
- Sync controls → Sync action: invokes sync
- Sync action → Inngest client: dispatches sync
- Job registration → Sync job: registers job
app/api/inngest/route.ts - Sync job → Repository indexing: runs indexing
- Repository indexing → Application database: records sync state
features/repo-sync/server/repo-sync.ts - Repository indexing → Pinecone: upserts code vectors
features/repo-sync/server/repo-sync.ts - Job registration → Review job: registers job
app/api/inngest/route.ts - Review job → Application database: updates review status
features/reviews/server/review-pr-function.ts - Review job → PR file retrieval: retrieves changed files
features/reviews/server/review-pr-function.ts - Review job → Diff chunking: chunks diffs
features/reviews/server/review-pr-function.ts - Review job → Review vector search: saves and searches vectors
features/reviews/server/review-pr-function.ts - Review job → Repository indexing: builds repo namespace
features/reviews/server/review-pr-function.ts - Review job → AI review generation: requests review
features/reviews/server/review-pr-function.ts - AI review generation → OpenRouter AI: generates review
features/reviews/server/generate-review.ts - Review job → PR comment posting: posts review
features/reviews/server/review-pr-function.ts - PR comment posting → GitHub: comments on PR
- Review vector search → Pinecone: searches vectors