CPG Explorer IDE Interactive tool for visualizing Code Property Graphs (CPG). This project allows you to explore the call graphs of Go projects and view source code in a unified interface.
How to Run The project is fully containerized using Docker.
Ensure CPG Database is ready:
Place your cpg.db file inside the ./backend directory.
Start the application: Open your terminal in the project root and run:
docker compose up --build Open in Browser:
Frontend: http://localhost:5173 (Interactive UI)
Backend API: http://localhost:8000/docs (API Documentation)
Tech Stack Backend: FastAPI (Python 3.11). Chosen for its high-performance asynchronous capabilities, making it ideal for querying the 600MB+ SQLite database.
Frontend: React + Vite + React Flow. React Flow was selected to provide a professional, interactive graph canvas where users can manipulate nodes and explore connections.
Containerization: Docker & Docker Compose. Ensures the environment is identical for everyone and simplifies the setup to a single command.
Implementation Details Call Graph Visualization: The tool focuses on function-to-function call relationships.
Performance Optimization: Implements a 1-hop neighborhood strategy. Instead of loading the entire massive graph into the browser, the API fetches only the immediate callers and callees of the selected function.
Robust ID Handling: Custom logic was implemented to handle complex Go identifiers (containing ::, @, and file paths) through proper URL parameter encoding.
Integrated Source Viewer: The UI features a side-by-side view where selecting a node in the graph instantly pulls the corresponding source code from the database.
Project Structure /backend - FastAPI server, SQLite interaction logic, and Dockerfile.
/frontend - React application, graph rendering logic, and Dockerfile.
docker-compose.yml - Orchestrates the startup of both services.