code-graph

code-graph

A code-graph demo using GraphRAG-SDK and FalkorDB

Stars: 65

Visit
 screenshot

Code-graph is a tool composed of FalkorDB Graph DB, Code-Graph-Backend, and Code-Graph-Frontend. It allows users to store and query graphs, manage backend logic, and interact with the website. Users can run the components locally by setting up environment variables and installing dependencies. The tool supports analyzing C & Python source files with plans to add support for more languages in the future. It provides a local repository analysis feature and a live demo accessible through a web browser.

README:

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

For Tasks:

Click tags to check more tools for each tasks

For Jobs:

Alternative AI tools for code-graph

Similar Open Source Tools

For similar tasks

For similar jobs