Skip to content

Commit f419fe6

Browse files
authored
Merge pull request #348 from FalkorDB/setup-instructions
updated readme with setup instructions
2 parents 63ba49e + 1912e2e commit f419fe6

File tree

1 file changed

+58
-6
lines changed

1 file changed

+58
-6
lines changed

Diff for: README.md

+58-6
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,80 @@
88
## Getting Started
99
[Live Demo](https://code-graph.falkordb.com/)
1010

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+
1120
### Run FalkorDB
1221

1322
```bash
1423
docker run -p 6379:6379 -it --rm falkordb/falkordb
1524
```
1625

17-
### Install node packages
26+
### Run Code-Graph-Backend
27+
28+
#### Clone the Backend
1829

1930
```bash
20-
npm install
31+
git clone https://github.com/FalkorDB/code-graph-backend.git
2132
```
2233

23-
### Set your OpenAI key
34+
#### Setup environment variables
35+
36+
`SECRET_TOKEN` - user defined token used to authorize the request
2437

38+
```bash
39+
export FALKORDB_HOST=localhost FALKORDB_PORT=6379 \
40+
OPENAI_API_KEY=<YOUR OPENAI_API_KEY> SECRET_TOKEN=<YOUR_SECRECT_TOKEN> \
41+
FLASK_RUN_HOST=0.0.0.0 FLASK_RUN_PORT=5000
2542
```
26-
export OPENAI_API_KEY=YOUR_OPENAI_API_KEY
43+
44+
#### Install dependencies & run
45+
46+
```bash
47+
cd code-graph-backend
48+
49+
pip install --no-cache-dir -r requirements.txt
50+
51+
flask --app api/index.py run --debug > flask.log 2>&1 &
52+
2753
```
2854

29-
### Run the development server
55+
### Run Code-Graph-Frontend
56+
57+
#### Clone the Frontend
3058

3159
```bash
60+
git clone https://github.com/FalkorDB/code-graph.git
61+
```
62+
63+
#### Setup environment variables
64+
65+
```bash
66+
export BACKEND_URL=http://${FLASK_RUN_HOST}:${FLASK_RUN_PORT} \
67+
SECRET_TOKEN=<YOUR_SECRECT_TOKEN> OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>
68+
```
69+
70+
#### Install dependencies & run
71+
72+
```bash
73+
cd code-graph
74+
npm install
3275
npm run dev
3376
```
3477

35-
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
78+
### Process a local repository
79+
```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>"
81+
```
82+
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.
86+
87+
Browse to [http://localhost:3000](http://localhost:3000)

0 commit comments

Comments
 (0)