This project consists of three core components:
- FalkorDB Graph DB – Stores and queries your graphs.
- Code-Graph-Backend – Handles backend logic.
- Code-Graph-Frontend – Provides the web interface.
To set up the project, you’ll need to start all three components.
Run the following command to start FalkorDB using Docker:
docker run -p 6379:6379 -it --rm falkordb/falkordbgit clone https://github.com/FalkorDB/code-graph-backend.git
cd code-graph-backendDefine the required environment variables:
export FALKORDB_HOST=localhost FALKORDB_PORT=6379 \
OPENAI_API_KEY=<YOUR_OPENAI_API_KEY> SECRET_TOKEN=<YOUR_SECRET_TOKEN> \
FLASK_RUN_HOST=0.0.0.0 FLASK_RUN_PORT=5000SECRET_TOKEN is a user-defined token used for request authorization.
pip install --no-cache-dir -r requirements.txt
flask --app api/index.py run --debug > flask.log 2>&1 &git clone https://github.com/FalkorDB/code-graph.git
cd code-graphexport BACKEND_URL=http://${FLASK_RUN_HOST}:${FLASK_RUN_PORT} \
SECRET_TOKEN=<YOUR_SECRET_TOKEN> OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>npm install
npm run devUse the following curl command to analyze a local repository:
curl -X POST http://127.0.0.1:5000/analyze_folder \
-H "Content-Type: application/json" \
-H "Authorization: <YOUR_SECRET_TOKEN>" \
-d '{"path": "<PATH_TO_LOCAL_REPO>", "ignore": ["./.github", "./sbin", "./.git", "./deps", "./bin", "./build"]}'Note: At the moment code-graph can analyze both the Java & Python source files. Support for additional languages e.g. C, JavaScript, Go is planned to be added in the future.
Once everything is running, open your browser and go to:
Have questions or feedback? Reach out via:
- GitHub Issues
- Join our Discord
⭐️ If you find this repository helpful, please consider giving it a star!
Knowledge Graph, Code Analysis, Code Visualization, Dead Code Analysis, Graph Database
