I'm excited to share a project I've been working on called Code Lantern. It's a self-hosted tool designed to help you visually explore and understand codebases.
Whenever I jump into a new codebase (or return to one of my own after a few months), I often find myself spending hours just tracing function calls, mapping out dependencies, and trying to build a mental model of how everything fits together. I wanted a way to instantly generate a high-level architectural view, but I didn't want to upload my code to a third-party server to get it.
So, I built Code Lantern. You run it via Docker, point it at any local project folder, and it generates:
Interactive Dependency Graphs: Visual maps of how files and functions connect, powered by Cytoscape.js. Architecture Maps: Tree diagrams breaking down your file and function structures. Complexity Heatmaps: It uses AST to calculate cyclomatic complexity scores, helping you spot technical debt at a glance. AI Deep Dives (Optional): If you click on any function, it can generate a description of what it does, its inputs/outputs, and call relationships. How it works under the hood: The backend is built with FastAPI and uses Tree-sitter for accurate AST parsing (supporting Python, JS/TS, Java, C++, and Rust). It extracts functions, classes, imports, and resolves call relationships locally. The frontend is built in React.
Privacy and Setup: Privacy was my main priority. The tool runs locally in Docker and mounts your project folder strictly as read-only. Your code never leaves your machine.
The core analysis, graphs, and heatmaps work completely offline without any API keys. If you want to use the AI "Deep Dive" descriptions, you can just plug in your own API key in the .env file (it supports Groq, OpenAI, Anthropic, Gemini, OpenRouter, or Cohere). The API calls are optimized and will take least amount of tokens possible.
It’s open source under the MIT license. You can spin it up with a single ./run.sh script.
I'd love for you to try it out on one of your projects and let me know what you think, or what features would make navigating new codebases easier for you. Happy to answer any questions and hear your feedback!