|
8 | 8 | ## Getting Started |
9 | 9 | [Live Demo](https://code-graph.falkordb.com/) |
10 | 10 |
|
| 11 | +## Run locally |
| 12 | +This project is composed of three pieces: |
| 13 | + |
| 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 |
| 17 | + |
| 18 | +You'll need to start all three components: |
| 19 | + |
11 | 20 | ### Run FalkorDB |
12 | 21 |
|
13 | 22 | ```bash |
14 | 23 | docker run -p 6379:6379 -it --rm falkordb/falkordb |
15 | 24 | ``` |
16 | 25 |
|
17 | | -### Install node packages |
| 26 | +### Run Code-Graph-Backend |
| 27 | + |
| 28 | +#### Clone the Backend |
18 | 29 |
|
19 | 30 | ```bash |
20 | | -npm install |
| 31 | +git clone https://github.com/FalkorDB/code-graph-backend.git |
21 | 32 | ``` |
22 | 33 |
|
23 | | -### Set your OpenAI key |
| 34 | +#### Setup environment variables |
24 | 35 |
|
| 36 | +```bash |
| 37 | +export FALKORDB_HOST=falkordb FALKORDB_PORT=6379 \ |
| 38 | + OPENAI_API_KEY=<YOUR OPENAI_API_KEY> SECRET_TOKEN=Vespa \ |
| 39 | + FLASK_RUN_HOST=0.0.0.0 FLASK_RUN_PORT=5000 |
25 | 40 | ``` |
26 | | -export OPENAI_API_KEY=YOUR_OPENAI_API_KEY |
| 41 | + |
| 42 | +#### Install dependencies & run |
| 43 | + |
| 44 | +```bash |
| 45 | +cd code-graph-backend |
| 46 | + |
| 47 | +pip install --no-cache-dir -r requirements.txt |
| 48 | + |
| 49 | +flask --app api/index.py run --debug |
27 | 50 | ``` |
28 | 51 |
|
29 | | -### Run the development server |
| 52 | +### Run Code-Graph-Frontend |
| 53 | + |
| 54 | +#### Clone the Frontend |
30 | 55 |
|
31 | 56 | ```bash |
| 57 | +git clone https://github.com/FalkorDB/code-graph.git |
| 58 | +``` |
| 59 | + |
| 60 | +#### Setup environment variables |
| 61 | + |
| 62 | +```bash |
| 63 | +export BACKEND_URL=http://localhost:5000 SECRET_TOKEN=Vespa OPENAI_API_KEY=<YOUR_OPENAI_API_KEY> |
| 64 | +``` |
| 65 | + |
| 66 | +#### Install dependencies & run |
| 67 | + |
| 68 | +```bash |
| 69 | +cd code-graph |
| 70 | +npm install |
32 | 71 | npm run dev |
33 | 72 | ``` |
34 | 73 |
|
35 | | -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. |
| 74 | +### Process a local repository |
| 75 | +```bash |
| 76 | +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: Vespa" |
| 77 | +``` |
| 78 | + |
| 79 | +Note: At the moment code-graph can analyze both the C & Python source files. |
| 80 | +Support for additional languages e.g. JavaScript, Go, Java is planned to be added |
| 81 | +in the future. |
| 82 | + |
| 83 | +Browse to [http://localhost:3000](http://localhost:3000) |
0 commit comments