← All projects

2026 · Code comprehension tool

CodeAtlas

Paste C source code, get an interactive Mermaid flowchart for every function, rendered on a Figma-like canvas with zoom, pan, and SVG or PNG export.

Released 2026

Why I built this

Reading unfamiliar C is slow, and most diagram tools either need a heavy IDE or hand-drawing. I wanted to paste a file and immediately see the control flow per function. Building both an AST engine and an LLM engine forced a clean separation: the deterministic path proves correctness and runs without a model, while the LLM path adds richer narration when a backend is available.

2 Diagram engines (AST + LLM)
4 Dockerized services
Local Default LLM via Ollama

Architecture

Two diagram engines

  • AST mode · ast-grep parses C and emits Mermaid directly, deterministic, no model needed
  • LLM mode · each function sent through LiteLLM with few-shot prompts for richer diagrams
  • Provider agnostic · Ollama, GitHub Models, OpenAI, or Anthropic, switched by config
  • Persistence · aiosqlite stores parsed functions and generated diagrams

Frontend canvas

React 19 and TypeScript with Tailwind and Mermaid 11, built with Vite and served by Nginx, which also proxies the API and the WebSocket back to the FastAPI backend. The canvas supports zoom, pan, and SVG or PNG export per function.

Tech stack

Technologies used

core

FastAPI (Python 3.11)ast-grep-pyLiteLLMaiosqliteUvicorn

infra

Docker Compose (4 services)Nginx (SPA + API/WS proxy)Ollama (local LLM)

tools

React 19TypeScriptTailwind CSS 4Mermaid 11Vite

Key highlights

Proof points

  1. 01

    Two interchangeable diagram engines from one backend: a deterministic ast-grep AST path that needs no model, and an LLM path for richer diagrams.

  2. 02

    LLM calls go through LiteLLM, so the same code runs against local Ollama, GitHub Models, OpenAI, or Anthropic, selected by configuration.

  3. 03

    React 19 and TypeScript canvas renders Mermaid per function with zoom, pan, and SVG or PNG export.

  4. 04

    Ships as a four-service Docker Compose stack and defaults to local Ollama, so it runs free and offline out of the box.

Focus areas

FastAPIast-grepLiteLLMReactTypeScriptMermaidWebSocketDocker