Vi

Visualize the entropy of a codebase with a 3D force-directed graph

Hacker News

Visualize the entropy of a codebase with a 3D force-directed graph

Hi HN! I'm Gabriel, the author of dep-tree ( https://github.com/gabotechs/dep-tree ), and I wanted to show off this tool and explain why it's being really useful at my current org for dealing with code complexity. I work at a startup where business evolves really fast, and requirements change frequently, so it's easy to end up with big piles of code stacked together without a clear structure, specially with tight deadlines. I made dep-tree [1] to help us maintain a clean code architecture and a logical separation of concerns between parts of the application, which is accomplished by: (1) Visualizing the source files and the dependencies between them using a 3D force-directed graph; and (2) Enforcing some dependency rules that allow/forbid dependencies between different parts of the application. The 3D force-directed graph visualization works like this: - It takes an entrypoint to the codebase, usually the main executable file or a library's entrypoint (index.js, main.py, etc...) - It recursively crawls import statements gathering other source files that are being depended upon - It creates a directed graph out of that, where nodes are source files and edges are the dependencies between them - It renders this graph in the browser using a 3D force-directed layout, where attraction/repulsion forces will be applied to each node depending on which other nodes it is connected to. With this, properly decoupled codebases will tend to form clusters of nodes, representing logical parts that live together and are clearly separated from other parts, and tightly coupled codebases will be rendered without clear clustering or without a clear structural pattern in the node placement. Some examples of this visualization for well-known codebases are: TypeScript: https://dep-tree-explorer.vercel.app/api?repo=https%3A%2F%2F... React: https://dep-tree-explorer.vercel.app/api?repo=https%3A%2F%2F... Svelte: https://dep-tree-explorer.vercel.app/api?repo=https%3A%2F%2F... Langchain: https://dep-tree-explorer.vercel.app/api?repo=https%3A%2F%2F... Numpy: https://dep-tree-explorer.vercel.app/api?repo=https%3A%2F%2F... Deno: https://dep-tree-explorer.vercel.app/api?repo=https%3A%2F%2F... The visualizations are cool, but it's just the first step. The dependency rules checking capabilities is what makes the tool actually useful in a daily basis and what keeps us using it every day in our CI pipelines for enforcing decoupling. More info about this feature is available in the repo: https://github.com/gabotechs/dep-tree?tab=readme-ov-file#che... . The code is fully open-source.

Share card

Actual performance

180points
59comments
Made the leaderboard

Launch Intel predictions

Analyze your own launch →
Indie HackersFits the IH revenue-focused audience · Strong signals: para · Missing: supports, reddit linkedin, podcasting
80%80% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Product HuntOn track for Day 1 leaderboard · Strong signals: visual, using, code · Missing: mac, agents, macos
70%70% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
Hacker NewsStrong engagement from HN community · Strong signals: pipe, io · Missing: https docs, excited, just released
52%52% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
TrustMRRLess likely to generate early MRR · Strong signals: visualize, para · Missing: mobile apps, ios, personal
49%49% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
29%29% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
12%12% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

Vi
Visualize the complexity of a Golang codebase with a 3D force graph41%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Visualize the complexity of a Golang codebase with a 3D force graph

Hacker News1
Tach
Tach77%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Untangle + visualize your codebase

Product Hunt+140Open Source
Vi
Visualize Lisp in 3D67%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Visualize Lisp in 3D

Hacker News7
Codalogy
Codalogy73%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Visualize Any Codebase Instantly

Product Hunt+121Productivity
Ne
Nebula Graph Studio 1.0 – Visualize graph data for you60%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Nebula Graph Studio 1.0 – Visualize graph data for you

Hacker News8
Co
CodeKnow – Turn any codebase into a knowledge graph56%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

CodeKnow – Turn any codebase into a knowledge graph

Hacker News3
Co
Codebase Knowledge Graph Builder63%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Codebase Knowledge Graph Builder

Hacker News4
Ma
Mathpix 3D Grapher – visualize 3D functions online53%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Mathpix 3D Grapher – visualize 3D functions online

Hacker News1
Ta
Tach – Visualize and untangle your Python codebase85%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Tach – Visualize and untangle your Python codebase

Hacker News263
Vi
Visualize Lisp in 3D in the browser70%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Visualize Lisp in 3D in the browser

Hacker News5