|
| 1 | +# CodeGraph |
| 2 | + |
| 3 | +CodeGraph lets you drop in a GitHub repository URL and explore the codebase visually. It parses every function in the repo, figures out what calls what, and draws that as an interactive graph. You can also ask plain English questions about the code and get answers back. |
| 4 | + |
| 5 | +It was built because reading an unfamiliar codebase is slow. You either grep around hoping to find the right file, or you spend an hour tracing function calls manually. CodeGraph does that tracing for you and gives you something you can actually look at. |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | +## What it does |
| 10 | + |
| 11 | +When you submit a repo URL, the system clones it, walks through every source file, and extracts all the functions it finds. It then builds a graph where each node is a function and each edge is a call relationship. On top of that it generates vector embeddings for every function so you can search semantically. |
| 12 | + |
| 13 | +The dashboard has three panels. The left panel is a file explorer. Click a file and you see all the functions in it. The center panel is the graph. You can view the full graph across the whole repo, or switch to file view to see just the functions in the file you selected along with anything they call into from other files. Click any node and a small panel appears showing which file it lives in, what line it starts on, and what it depends on. The right panel is a chat interface where you can ask things like "where is authentication handled" or "what happens after a user logs in" and get a real answer with the relevant functions highlighted. |
| 14 | + |
| 15 | +## Languages supported |
| 16 | + |
| 17 | +Python, JavaScript, TypeScript, Go, Rust, Java, C, C++, Kotlin. |
| 18 | + |
| 19 | +## Running it |
| 20 | + |
| 21 | +You need Docker and Docker Compose. That is the only requirement. |
| 22 | + |
| 23 | +Copy `backend/.env.local` to `backend/.env` and fill in your Gemini API key. You can get one free at https://aistudio.google.com/app/apikey. Everything else in the file can stay as is. |
| 24 | + |
| 25 | +Then run: |
| 26 | + |
| 27 | +``` |
| 28 | +docker compose up --build |
| 29 | +``` |
| 30 | + |
| 31 | + |
| 32 | +The first time you submit a repo it will clone it, parse it, build the graph, and generate embeddings. Small repos take under a minute. Larger ones with hundreds of functions take a few minutes, mostly because of the embedding step which calls the Gemini API in parallel. |
| 33 | + |
| 34 | +## Re-analyzing a repo |
| 35 | + |
| 36 | +If the repo has been updated and you want to pull the latest changes, click the re-analyze button in the sidebar. It will go through the full pipeline again from scratch. |
| 37 | + |
| 38 | +## Switching between repos |
| 39 | + |
| 40 | +The dropdown in the top right of the chat panel shows all repos you have analyzed. Click one to switch to it. You can also paste a new URL directly into that dropdown without going back to the landing page. |
| 41 | + |
| 42 | +## Stack |
| 43 | + |
| 44 | +The backend is Django with Celery for async processing. PostgreSQL with the pgvector extension stores both the relational data and the vector embeddings. Redis is the task broker. The frontend is React with TypeScript. Everything runs in Docker. |
0 commit comments