Skip to content

FalkorDB/code-graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a4b6e33 · Jan 24, 2025
Jan 24, 2025
Dec 30, 2024
Nov 12, 2024
Dec 29, 2024
Dec 15, 2024
Nov 5, 2024
Dec 26, 2024
Jan 3, 2024
Nov 6, 2024
Jan 24, 2025
Jan 4, 2024
Jan 9, 2025
Jan 3, 2024
Jan 3, 2024
Jan 24, 2025
Jan 24, 2025
Dec 9, 2024
Jan 3, 2024
Dec 22, 2024
Jan 3, 2024
Aug 11, 2024
Jul 22, 2024

Repository files navigation

Try Free Dockerhub Discord Workflow

image

Getting Started

Live Demo

Run locally

This project is composed of three pieces:

  1. FalkorDB Graph DB - this is where your graphs are stored and queried
  2. Code-Graph-Backend - backend logic
  3. Code-Graph-Frontend - website

You'll need to start all three components:

Run FalkorDB

docker run -p 6379:6379 -it --rm falkordb/falkordb

Run Code-Graph-Backend

Clone the Backend

git clone https://github.com/FalkorDB/code-graph-backend.git

Setup environment variables

SECRET_TOKEN - user defined token used to authorize the request

export FALKORDB_HOST=localhost FALKORDB_PORT=6379 \
    OPENAI_API_KEY=<YOUR OPENAI_API_KEY> SECRET_TOKEN=<YOUR_SECRECT_TOKEN> \
    FLASK_RUN_HOST=0.0.0.0 FLASK_RUN_PORT=5000

Install dependencies & run

cd code-graph-backend

pip install --no-cache-dir -r requirements.txt

flask --app api/index.py run --debug > flask.log 2>&1 &

Run Code-Graph-Frontend

Clone the Frontend

git clone https://github.com/FalkorDB/code-graph.git

Setup environment variables

export BACKEND_URL=http://${FLASK_RUN_HOST}:${FLASK_RUN_PORT} \
    SECRET_TOKEN=<YOUR_SECRECT_TOKEN> OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>

Install dependencies & run

cd code-graph
npm install
npm run dev

Process a local repository

curl -X POST http://127.0.0.1:5000/analyze_folder -H "Content-Type: application/json" -d '{"path": "<PATH_TO_LOCAL_REPO>", "ignore": ["./.github", "./sbin", "./.git","./deps", "./bin", "./build"]}' -H "Authorization: <YOUR_SECRECT_TOKEN>"

Note: At the moment code-graph can analyze both the C & Python source files. Support for additional languages e.g. JavaScript, Go, Java is planned to be added in the future.

Browse to http://localhost:3000