Folder Structure
Understanding the organization of the codebase is key to effective contribution.
Root Directory
Section titled “Root Directory”Directoryai-code-review/ The main Next.js application.
- …
DirectoryAI-Code-Review/ This documentation site (Astro Starlight).
- …
- prompt.md Master documentation prompt.
- codebase-prompt.md Codebase indexing prompt.
Application Architecture (ai-code-review/)
Section titled “Application Architecture (ai-code-review/)”Directoryapp/
Directory(auth)/login/ Authentication pages.
- …
Directoryapi/
Directoryauth/ Better Auth endpoints.
- …
Directoryinngest/ Inngest serve handler.
- …
Directorywebhooks/github/ GitHub Webhook receiver.
- …
Directorydashboard/ Core user interface.
- …
Directorycomponents/
Directoryui/ Shadcn UI components.
- …
Directorylanding/ Landing page sections.
- …
Directoryproviders/ Context providers (Theme, Query).
- …
Directoryinngest/
- client.ts Inngest client configuration.
Directoryfunctions/
- index.ts Repository indexing engine.
- review.ts PR analysis & review engine.
Directorylib/
- ast-chunker.ts Tree-sitter parsing logic.
- embedding.ts Gemini embedding integration.
- db.ts Prisma client.
- tree-sitter.ts WASM grammar loader.
Directorymodules/
Directoryai/ Vector retrieval & prompt logic.
- …
Directorygithub/ GitHub API wrappers.
- …
Directoryprisma/
- schema.prisma Database & Vector schema.
Key File Descriptions
Section titled “Key File Descriptions”| Path | Purpose || :--- | :--- || `ai-code-review/prisma/schema.prisma` | Defines the data model and the `vector` type for pgvector. || `ai-code-review/inngest/functions/review.ts` | The core RAG pipeline for generating AI reviews. || `ai-code-review/lib/ast-chunker.ts` | Uses Tree-sitter to split code into logical chunks. || `ai-code-review/app/api/webhooks/github/route.ts` | The entry point for all GitHub events. |