CodeMapper
Code Mapper, written in GO + Javascript, let's the user visualize any GO codebase like nodes
Install / Use
/learn @chinmay-sawant/CodeMapperREADME
For the future updates use the below repository instead of CodeMapper
- https://github.com/chinmay-sawant/gomindmapper
CodeMapper 🗺️
Overview
CodeMapper is a tool designed to analyze large Go codebases and visualize function dependencies in an interactive graph.
It helps you understand how functions and methods are connected across your project, making onboarding and refactoring much easier! 🚀
UI Inspiration:
The interactive graph UI is inspired by the intuitive workflow editor of n8n.io, making it easy to explore and understand complex code relationships visually.
Problem Statement ❓
Analyzing over 40+ repositories for a recent project was extremely time-consuming and challenging, especially given the tight deadlines and complex interdependencies between packages. Manual tracing of function calls and dependencies quickly became unmanageable. To address this, I built CodeMapper to automate the analysis and visualization process, making it much faster and easier to understand large Go codebases.
Features ✨
- Automatic Go code analysis 🧑💻
- Dependency mapping between functions and methods 🔗
- Interactive visualization in your browser 🌐
- Easy to use: just point to your repo and run!
How It Works ⚙️
-
Scan your Go project:
CodeMapper parses your codebase, finds all function/method definitions and their call sites. -
Generates a dependency map:
Outputs a JSON file mapping all relationships. -
Visualizes the map:
Launches a web server with a beautiful, interactive graph UI.
Installation 🛠️
Backend (Go)
-
Install Go (if not already):
Download Go -
Clone the repository and install dependencies:
git clone https://github.com/chinmay-sawant/CodeMapper.git cd CodeMapper go mod tidy
Frontend (Visualizer)
-
Install Node.js (if not already):
Download Node.js -
Install frontend dependencies:
cd CodeMapper npm install
Quick Start 🚦
# 1. Build and run CodeMapper on your Go project
go run main.go -path "./ollama" -gopath "C:\Users\acer\go\pkg\mod" -analyze-deps "bitbucket.org/ggwp1,bitbucket.org/ggwp2" -out "full-codemap.json" -serve ":8080"
# 2. Open your browser and visit
http://localhost:8080
Command Line Arguments Documentation
This application accepts the following command line arguments:
-path: Specifies the path to the project directory to analyze (e.g.,./revel).-gopath: Sets the Go module cache directory (e.g.,C:\Users\acer\go\pkg\mod).-analyze-deps: Comma-separated list of dependencies to analyze (e.g.,bitbucket.org/ggwp1,bitbucket.org/ggwp2).-out: Output file name for the generated code map (e.g.,full-codemap.json).-serve: Starts a web server on the specified address to serve the results (e.g.,:8080).
Project Structure 🏗️
main.go- Analyzer and web servervisualizer/- React-based frontend for visualizationcodemap.json- Generated dependency map
Screenshot 🖼️
Sample Screenshot

Full Screenshot

Visual Backtracking

Path View

Front Tracking to Find References

Made with ❤️ in India
License 📄
MIT
