Overview
Graphify scans source code repositories, extracts classes, functions, and imports using tree-sitter, builds a dependency graph, detects communities via the Louvain algorithm, and renders an interactive HTML visualization with vis.js. Supports JavaScript, TypeScript, Python, Java, C, and C++ with CLI commands for search, shortest path, and node explanation.
Features
- AST-based extraction using tree-sitter for 6 languages
- Graph construction with import/usage edges between nodes
- Louvain community detection with cohesion scoring
- Interactive HTML visualization with vis.js (search, filter, community colors)
- Natural language query engine with BFS/DFS traversal
- CLI commands: build, query, path, explain, export
Challenges
Building a robust multi-language AST extractor without native dependencies, and making community detection work at scale in pure TypeScript.
Solutions
Used tree-sitter WASM packages for cross-platform extraction, graphlib for graph operations, and a custom port of the Louvain algorithm with cohesion scoring for meaningful cluster boundaries.
