|
| 1 | +# CodeGraph - Knowledge Graph Visualization Tool |
| 2 | + |
| 3 | +### Visualize your repository with our graph for code analysis |
| 4 | + |
1 | 5 | [](https://app.falkordb.cloud)
|
2 | 6 | [](https://hub.docker.com/r/falkordb/falkordb/)
|
3 | 7 | [](https://discord.com/invite/6M4QwDXn2w)
|
4 | 8 | [](https://github.com/FalkorDB/code-graph/actions/workflows/nextjs.yml)
|
| 9 | +- |
| 10 | + |
| 11 | + |
5 | 12 |
|
6 |
| - |
| 13 | +**👉🏻[Live Demo](https://code-graph.falkordb.com/)** |
7 | 14 |
|
8 |
| -## Getting Started |
9 |
| -[Live Demo](https://code-graph.falkordb.com/) |
| 15 | +## Running Locally |
10 | 16 |
|
11 |
| -## Run locally |
12 |
| -This project is composed of three pieces: |
| 17 | +This project consists of three core components: |
13 | 18 |
|
14 |
| -1. FalkorDB Graph DB - this is where your graphs are stored and queried |
15 |
| -2. Code-Graph-Backend - backend logic |
16 |
| -3. Code-Graph-Frontend - website |
| 19 | +1. **FalkorDB Graph DB** – Stores and queries your graphs. |
| 20 | +2. **Code-Graph-Backend** – Handles backend logic. |
| 21 | +3. **Code-Graph-Frontend** – Provides the web interface. |
17 | 22 |
|
18 |
| -You'll need to start all three components: |
| 23 | +To set up the project, you’ll need to start all three components. |
19 | 24 |
|
20 |
| -### Run FalkorDB |
| 25 | +### 1. Start FalkorDB |
| 26 | + |
| 27 | +Run the following command to start FalkorDB using Docker: |
21 | 28 |
|
22 | 29 | ```bash
|
23 | 30 | docker run -p 6379:6379 -it --rm falkordb/falkordb
|
24 | 31 | ```
|
25 | 32 |
|
26 |
| -### Run Code-Graph-Backend |
| 33 | +### 2. Start the Backend |
27 | 34 |
|
28 |
| -#### Clone the Backend |
| 35 | +#### Clone the Backend Repository |
29 | 36 |
|
30 | 37 | ```bash
|
31 | 38 | git clone https://github.com/FalkorDB/code-graph-backend.git
|
| 39 | +cd code-graph-backend |
32 | 40 | ```
|
33 | 41 |
|
34 |
| -#### Setup environment variables |
| 42 | +#### Set Up Environment Variables |
35 | 43 |
|
36 |
| -`SECRET_TOKEN` - user defined token used to authorize the request |
| 44 | +Define the required environment variables: |
37 | 45 |
|
38 | 46 | ```bash
|
39 | 47 | export FALKORDB_HOST=localhost FALKORDB_PORT=6379 \
|
40 |
| - OPENAI_API_KEY=<YOUR OPENAI_API_KEY> SECRET_TOKEN=<YOUR_SECRECT_TOKEN> \ |
| 48 | + OPENAI_API_KEY=<YOUR_OPENAI_API_KEY> SECRET_TOKEN=<YOUR_SECRET_TOKEN> \ |
41 | 49 | FLASK_RUN_HOST=0.0.0.0 FLASK_RUN_PORT=5000
|
42 | 50 | ```
|
43 | 51 |
|
44 |
| -#### Install dependencies & run |
| 52 | +`SECRET_TOKEN` is a user-defined token used for request authorization. |
45 | 53 |
|
46 |
| -```bash |
47 |
| -cd code-graph-backend |
| 54 | +#### Install Dependencies & Start the Backend |
48 | 55 |
|
| 56 | +```bash |
49 | 57 | pip install --no-cache-dir -r requirements.txt
|
50 |
| - |
51 | 58 | flask --app api/index.py run --debug > flask.log 2>&1 &
|
52 |
| - |
53 | 59 | ```
|
54 | 60 |
|
55 |
| -### Run Code-Graph-Frontend |
| 61 | +### 3. Start the Frontend |
56 | 62 |
|
57 |
| -#### Clone the Frontend |
| 63 | +#### Clone the Frontend Repository |
58 | 64 |
|
59 | 65 | ```bash
|
60 | 66 | git clone https://github.com/FalkorDB/code-graph.git
|
| 67 | +cd code-graph |
61 | 68 | ```
|
62 | 69 |
|
63 |
| -#### Setup environment variables |
| 70 | +#### Set Up Environment Variables |
64 | 71 |
|
65 | 72 | ```bash
|
66 | 73 | export BACKEND_URL=http://${FLASK_RUN_HOST}:${FLASK_RUN_PORT} \
|
67 |
| - SECRET_TOKEN=<YOUR_SECRECT_TOKEN> OPENAI_API_KEY=<YOUR_OPENAI_API_KEY> |
| 74 | + SECRET_TOKEN=<YOUR_SECRET_TOKEN> OPENAI_API_KEY=<YOUR_OPENAI_API_KEY> |
68 | 75 | ```
|
69 | 76 |
|
70 |
| -#### Install dependencies & run |
| 77 | +#### Install Dependencies & Start the Frontend |
71 | 78 |
|
72 | 79 | ```bash
|
73 |
| -cd code-graph |
74 | 80 | npm install
|
75 | 81 | npm run dev
|
76 | 82 | ```
|
77 | 83 |
|
78 |
| -### Process a local repository |
| 84 | +### 4. Process a Local Repository |
| 85 | + |
| 86 | +Use the following `curl` command to analyze a local repository: |
| 87 | + |
79 | 88 | ```bash
|
80 |
| -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>" |
| 89 | +curl -X POST http://127.0.0.1:5000/analyze_folder \ |
| 90 | + -H "Content-Type: application/json" \ |
| 91 | + -H "Authorization: <YOUR_SECRET_TOKEN>" \ |
| 92 | + -d '{"path": "<PATH_TO_LOCAL_REPO>", "ignore": ["./.github", "./sbin", "./.git", "./deps", "./bin", "./build"]}' |
81 | 93 | ```
|
82 | 94 |
|
83 |
| -Note: At the moment code-graph can analyze both the C & Python source files. |
84 |
| -Support for additional languages e.g. JavaScript, Go, Java is planned to be added |
85 |
| -in the future. |
| 95 | +**Note:** Currently, Code-Graph supports analyzing C and Python source files. |
| 96 | +Support for additional languages (e.g., JavaScript, Go, Java) is planned. |
| 97 | + |
| 98 | +### 5. Access the Web Interface |
| 99 | + |
| 100 | +Once everything is running, open your browser and go to: |
| 101 | + |
| 102 | +[http://localhost:3000](http://localhost:3000) |
| 103 | + |
| 104 | +## Community |
| 105 | + |
| 106 | +Have questions or feedback? Reach out via: |
| 107 | + |
| 108 | +* [GitHub Issues](https://github.com/FalkorDB/GraphRAG-SDK/issues) |
| 109 | +* Join our [Discord](https://discord.com/invite/6M4QwDXn2w) |
| 110 | + |
| 111 | +⭐️ If you find this repository helpful, please consider giving it a star! |
86 | 112 |
|
87 |
| -Browse to [http://localhost:3000](http://localhost:3000) |
| 113 | +Knowledge Graph, Code Analysis, Code Visualization, Dead Code Analysis, Graph Database |
0 commit comments