Connect a repository.
Query the system.
A short guide to the four flows that make up RepoDoc - indexing, querying, documentation, and sharing. Every section is self-contained and points back at the API where relevant.
Three steps to a queryable repo
- 1Sign in
Authenticate with GitHub or email. Sessions are managed by Clerk; there is no separate API key to provision.
- 2Create a project
Paste a GitHub URL. RepoDoc walks the file tree and summarizes then embeds each source file in a background job. The import graph is derived from the stored source on demand, the first time you open the architecture view.
- 3Ask anything
Once indexing finishes, the chat surface is live. Every answer cites the files used to ground it.
What happens when you connect a repo
Indexing runs as a background job and emits progress through the dashboard. It typically takes 5-15 minutes depending on repository size. The worker time-boxes each run, writes a resume cursor, and requeues itself, so a large repo indexes across several short invocations rather than one long one.
- Files are streamed from the GitHub tarball of the default branch's head commit, pinned when indexing starts. Lockfiles, the .git, .github, node_modules and .next directories, binary files and files over 512 KB are skipped, and a repository is capped at 200 MB of text.
- Each new or changed file is summarized with Gemini 2.5 Flash-Lite, then embedded with gemini-embedding-001 (768 dimensions).
- Vectors are written to PostgreSQL with the pgvector extension. A single database holds metadata, embeddings, and conversation history.
Chat over an indexed repo
Chat is a grounded conversation that returns an answer plus the source files it was built from. Vector retrieval runs inside that endpoint - the question is embedded, matched against file summaries by cosine similarity, and the top 5 files are passed into the answer prompt. There is no separate retrieval-only endpoint.
POST /api/queryNatural-language Q&A with the source files listed alongside the answer. Accepts a conversation history for follow-ups.
POST /api/searchFinds repositories on GitHub by keyword, language, and topic - for picking something to index. It does not search your indexed files.
Generate, then refine
Both documentation and README generation run against the indexed codebase. The output is editable through follow-up questions - "add a troubleshooting section" or "update the API examples" modify the document in place rather than starting over.
- A project holds one current document. Each follow-up edit is stored with the content it produced, so earlier revisions stay reachable through the QnA history.
- Markdown rendering uses remark-gfm, with syntax highlighting wired through react-syntax-highlighter.
The stack
Next.js (App Router) on the server, React on the client, Tailwind for styling, Clerk for auth.
PostgreSQL + pgvector, accessed through Prisma. One database for metadata, vectors, and history.
All generation goes through OpenRouter, picked per task: Gemini 2.5 Flash for chat, docs and document edits, Gemini 2.5 Flash-Lite for file summaries, Gemini 2.5 Pro for README. There is no cross-provider failover.
Vector similarity search over file-level summaries. The matching files are passed into the answer prompt for grounding and listed with the answer.
Stuck? The repository is public and contributions are welcome.