Code Atlas is a locally-hosted, privacy-first, AI-powered codebase architecture visualizer. It instantly parses local source directories into an interactive 3D/2D architecture map, automatically detects cross-language API connections, and lets you chat with local AI models (via Ollama) or cloud models (via Google Gemini) that understand the precise structural context of your codebase—running 100% offline on your own machine.
- 🕸️ Interactive Architecture Map: Built with D3.js, visualize files, packages, classes, and functions as a physics-simulated force-directed graph. Features pre-warmed simulation physics, subtle ghost call lines to eliminate visual clutter, and smart level-of-detail (LOD) label culling.
- 📂 Native OS Folder Picker: Select any directory on your computer using your operating system's native folder chooser dialog (Windows Explorer, macOS Finder, or Linux file picker) with one click on "📂 Browse...".
- 🔌 Cross-Language API Linkage: Automatically connects Frontend
fetch()/axioscalls (JS/TS/React) directly to Backend endpoints (Python FastAPI/Flask) with glowing cross-service dependency lines. - 🦙/☁️ Dual Local & Cloud AI Assistant:
- 100% Offline AI: Chat with local models (Llama 3.2, Qwen 2.5 Coder, DeepSeek R1, Phi-3) via native Ollama auto-detection.
- Cloud Fallback: Optional support for Google Gemini (2.5 Flash & Pro) when online.
- Context-Aware: The AI is fed the active node's source code, upstream callers, and downstream callees.
- 🔍 100% Offline Semantic Search: Search your codebase using plain English ("Where is the token expiration handled?") powered by a local, standalone Sentence-Transformers model (
all-MiniLM-L6-v2) and a local FAISS vector database with sub-10ms response times. - 🧭 Interactive Dependency Jump Navigator: Clickable
⬅ Called by [caller]andCalls [callee] ➔jump pills in the Code Panel to leap across relationships and follow execution flow on the map. - 🐙 Live Local Git Authorship: Instantly inspect the Original Author and Recent Heavy Modifier for any function or class, read directly from your local repository's
.gitcommit history. ⚠️ Cyclic Dependency Detection: Automatically detects circular imports (A ➔ B ➔ A) with a pulsing UI alert to help you refactor tight coupling.- 📋 Dynamic Code Inspector: Slide-out code panel with auto-detected syntax highlighting (Python, TypeScript, JavaScript, JSX, JSON) and one-click copy.
- 🎯 Responsive Navigation Deck: Floating
[+],[-],[🎯 Center]zoom controls and minimap that automatically slide out of the way when the Code Panel is opened.
Backend:
- Python 3.11+
- FastAPI (Async API, WebSocket progress streaming)
- Tree-sitter (Fault-tolerant AST parsing for Python, JS, TS, JSX, TSX)
- NetworkX (Graph modeling and Cycle detection)
- SQLite (Relational metadata storage with multi-row batching)
- FAISS & Sentence-Transformers (100% local, offline vector embeddings)
- Ollama & Google GenAI SDK (Dual local/cloud LLM inference engines)
Frontend:
- React 18 (Vite, React Router)
- D3.js (Force-directed physics, minimap, dynamic zoom deck, collision physics)
- React-Markdown & SyntaxHighlighter (Code rendering with Prism vscDarkPlus)
- Python 3.11 or higher (Python 3.11 or 3.12 recommended for pre-built FAISS/PyTorch wheels)
- Node.js v18 or higher
- Git
- (Optional, for offline AI) Ollama installed and running locally
git clone https://github.com/yourusername/code-atlas.git
cd code-atlas# Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Start the API server
python api.pyOpen a new terminal window:
cd frontend
npm install
npm run devNavigate to http://localhost:5173/ in your browser.
To run the AI software architect completely offline without sending code to the cloud:
- Download and install Ollama.
- Pull your preferred coding model in your terminal:
ollama run qwen2.5-coder # or ollama run llama3.2 - Code Atlas will automatically detect your installed Ollama models on startup (
http://localhost:11434) and list them in the Code Panel's model dropdown.
(Optional: If you prefer cloud models, visit Settings in the app to enter a free Google Gemini API Key).
- Parse a Local Codebase: Click Parse Local Codebase on the dashboard. Click "📂 Browse..." to select any project directory on your machine (or enter a local path).
- Watch the Engine Work: Code Atlas will aggressively prune ignored directories (like
node_modules,.venv, anddist), parse AST definitions via Tree-sitter, batch-commit to SQLite, build local FAISS embeddings, and link cross-language APIs. - Explore the Map:
- Scroll to zoom, click and drag to pan.
- Drag nodes to pin them to custom locations (layout state automatically saves).
- Hover over any node to highlight its connected call lines while ghosting unrelated nodes.
- Click empty canvas space to reset highlights and close side panels.
- Inspect & Navigate: Click any node to slide out the Code Panel. View syntax-highlighted source code, check local Git blame stats, or click the
⬅ Called byandCalls ➔jump pills to glide the camera to connected callers/callees. - Ask AI: Switch to the Ask AI tab to query your local Ollama or cloud Gemini model about that specific architectural block, downstream ripple effects, or potential bugs.
- Semantic Search: Type queries like "database connection pool" or "user authentication middleware" in the sidebar to search your codebase semantically with sub-10ms response times.
- Heuristic Type Inference (LSP-Lite): Improved tracking of class instantiations to resolve exact method calls across files without a full Language Server.
- GitHub Auto-Ingestion: Paste a GitHub URL to automatically clone (shallow), parse, and visualize a repository entirely from the UI.
- Expanded Language Support: Add
tree-sitter-java,tree-sitter-go, andtree-sitter-rust. - Live Watch Mode (
watchdog): Real-time auto-reload of the architecture graph as you save file edits in your IDE without re-parsing from scratch. - One-Command All-in-One CLI (
code-atlas .): Single terminal command to parse a folder, boot the backend, and open your browser automatically. - Export to SVG / Mermaid.js: One-click export of selected graph modules into Mermaid.js format for documentation and READMEs.
- Architecture Diff View: Inspect architecture and dependency changes between two Git branches or working trees.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
This project is licensed under the MIT License.
