-
Notifications
You must be signed in to change notification settings - Fork 40
updated readme with setup instructions #348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -8,28 +8,80 @@ | |||||||||||||
## Getting Started | ||||||||||||||
[Live Demo](https://code-graph.falkordb.com/) | ||||||||||||||
|
||||||||||||||
## 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 | ||||||||||||||
|
||||||||||||||
```bash | ||||||||||||||
docker run -p 6379:6379 -it --rm falkordb/falkordb | ||||||||||||||
``` | ||||||||||||||
|
||||||||||||||
### Install node packages | ||||||||||||||
### Run Code-Graph-Backend | ||||||||||||||
|
||||||||||||||
#### Clone the Backend | ||||||||||||||
|
||||||||||||||
```bash | ||||||||||||||
npm install | ||||||||||||||
git clone https://github.com/FalkorDB/code-graph-backend.git | ||||||||||||||
``` | ||||||||||||||
|
||||||||||||||
### Set your OpenAI key | ||||||||||||||
#### Setup environment variables | ||||||||||||||
|
||||||||||||||
`SECRET_TOKEN` - user defined token used to authorize the request | ||||||||||||||
|
||||||||||||||
```bash | ||||||||||||||
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 | ||||||||||||||
``` | ||||||||||||||
export OPENAI_API_KEY=YOUR_OPENAI_API_KEY | ||||||||||||||
|
||||||||||||||
#### Install dependencies & run | ||||||||||||||
|
||||||||||||||
```bash | ||||||||||||||
cd code-graph-backend | ||||||||||||||
|
||||||||||||||
pip install --no-cache-dir -r requirements.txt | ||||||||||||||
|
||||||||||||||
flask --app api/index.py run --debug > flask.log 2>&1 & | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Improve process management and security configuration. The current Flask configuration has several concerns:
Consider this safer approach: -flask --app api/index.py run --debug > flask.log 2>&1 &
+# For development
+flask --app api/index.py run --debug
+
+# For production
+flask --app api/index.py run Also, consider adding instructions for proper process management tools like 📝 Committable suggestion
Suggested change
|
||||||||||||||
|
||||||||||||||
``` | ||||||||||||||
|
||||||||||||||
### Run the development server | ||||||||||||||
### Run Code-Graph-Frontend | ||||||||||||||
|
||||||||||||||
#### Clone the Frontend | ||||||||||||||
|
||||||||||||||
```bash | ||||||||||||||
git clone https://github.com/FalkorDB/code-graph.git | ||||||||||||||
``` | ||||||||||||||
|
||||||||||||||
#### Setup environment variables | ||||||||||||||
|
||||||||||||||
```bash | ||||||||||||||
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 | ||||||||||||||
|
||||||||||||||
```bash | ||||||||||||||
cd code-graph | ||||||||||||||
npm install | ||||||||||||||
npm run dev | ||||||||||||||
``` | ||||||||||||||
|
||||||||||||||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. | ||||||||||||||
### Process a local repository | ||||||||||||||
```bash | ||||||||||||||
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](http://localhost:3000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@swilly22 why not
poetry install
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've specifically created to ease up on the user. we felt like users are more comfortable running
pip install