The Problem
Developers who want to reproduce a public GitHub project from scratch need a concise, human‑readable description that captures the repository’s intent, key files, and usage pattern. Crafting such a prompt manually is time‑consuming and error‑prone, especially for larger projects.
What This Does
gitreverse is a Next.js 16 web app that turns any public GitHub repo into a single synthetic prompt suitable for LLM‑driven code generation tools (Cursor, Claude, Codex, etc.). The home page (app/page.tsx) presents a URL input; when a user submits owner/repo, the app fetches:
- repository metadata via the GitHub API (
lib/github-client.ts) - a shallow file‑tree (
lib/file-tree-formatter.ts) - the README (
lib/parse-github-repo.ts)
These pieces are assembled and sent to a configurable LLM endpoint (see env.example for provider keys). The response is displayed as a short, conversational prompt. Shareable URLs (/[owner]/[repo], /[owner]/[repo]/deep, etc.) route directly to the same flow, enabling easy link sharing.
Key files:
app/api/reverse-prompt/route.ts– API route that orchestrates data collection and LLM call.lib/custom-reverse-rate-limit.ts– rate‑limiting middleware for the API.components/reverse-prompt-home.tsx– UI for input, result display, and copy‑to‑clipboard.contexts/AuthContext.tsx– optional Supabase‑backed auth for the/librarypage.
How It Is Wired
Next.js’ App Router treats every app/**/*.tsx file as a route entry point. The primary request path for a reverse operation is /api/reverse-prompt, handled by app/api/reverse-prompt/route.ts. Execution flow:
- HTTP request → Next.js server invokes the route handler.
- Handler calls
lib/github-client.ts→fetchRepoInfo(GitHub API). - Calls
lib/file-tree-formatter.ts→formatTree(depth‑1 file list). - Calls
lib/parse-github-repo.ts→extractReadme(raw README). - Packages the three payloads into a prompt and posts to the selected LLM using the provider‑specific env vars (
XAI_API_KEY,OPENAI_API_KEY, etc.). - Returns the LLM’s response JSON, which
components/reverse-prompt-home.tsxrenders.
Static analysis detected zero import edges among the 43 TypeScript/TSX modules, meaning the import graph is not captured by the current pipeline. Consequently, the wiring map consists of isolated route files that each directly import the needed helpers; there are no observed circular dependencies or shared internal modules. The widest blast radius belongs to app/api/reverse-prompt/route.ts, as it touches the GitHub client, file‑tree formatter, README parser, and external LLM services.
How To Use It
# Clone the repo
git clone https://github.com/moses-y/gitreverse.git
cd gitreverse
# Install dependencies (pnpm lockfile present)
pnpm install
# Copy env template and add at least one LLM key
cp .env.example .env.local
# edit .env.local → set XAI_API_KEY, OPENAI_API_KEY, etc.
# Start dev server
pnpm dev # runs Next.js on http://localhost:3000
To run a production build:
pnpm build
pnpm start
No test runner, CI config, or Dockerfile is provided.
Real‑World Use
A development team can embed gitreverse in an internal documentation portal. When a new open‑source dependency is added, a team member pastes its owner/repo into the UI; the generated prompt is stored and later fed to an LLM to scaffold a wrapper library, saving hours of manual reading.
Code Health & Issues
- HIGH – Duplicated code – Repeated 6‑line blocks across 13 page components (
app/[owner]/[repo]/*.tsx). - HIGH – Oversized file –
components/reverse-prompt-home.tsx(1,387 lines) makes local changes high‑risk. - MED – Empty catch block –
app/layout.tsxsilently swallows errors. - MED – Deep nesting – Nesting depth 6 in
components/auth/AuthModal.tsx,components/navbar.tsx, and the oversized home component. - MED – High branching density – Decision‑heavy logic in
lib/custom-reverse-rate-limit.tsandlib/stripe-checkout-navigate.ts. - MED – Missing test suite – No
*.test.*files detected. - MED – No CI/CD pipeline – No
.github/workflowsor other CI config. - MED – No LICENSE – Repository lacks explicit usage rights.
All findings are derived from deterministic static analysis; no additional speculative issues are reported.
The Bottom Line
gitreverse delivers a functional, low‑friction UI for generating LLM prompts from public GitHub repos, but the codebase suffers from significant duplication, an oversized core component, and minimal test/CI coverage. It is suitable for prototyping or internal tooling where rapid prompt creation outweighs long‑term maintainability concerns. Teams requiring a stable, well‑tested service should address the highlighted health issues before production use.