-
Notifications
You must be signed in to change notification settings - Fork 40
Update README.md #472
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
Open
danshalev7
wants to merge
4
commits into
main
Choose a base branch
from
danshalev7-patch-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Update README.md #472
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,164 @@ | ||
<div align="center"> | ||
|
||
# Code Graph | ||
|
||
[](https://app.falkordb.cloud) | ||
[](https://hub.docker.com/r/falkordb/falkordb/) | ||
[](https://discord.com/invite/6M4QwDXn2w) | ||
[](https://github.com/FalkorDB/code-graph/actions/workflows/nextjs.yml) | ||
|
||
 | ||
**Visualize codebases as knowledge graphs to analyze dependencies, detect bottlenecks, and optimize projects.** | ||
|
||
 | ||
|
||
</div> | ||
|
||
## Quick Start | ||
|
||
Try the [**Live Demo**](https://code-graph.falkordb.com/) to see Code Graph in action! | ||
|
||
## Getting Started | ||
[Live Demo](https://code-graph.falkordb.com/) | ||
## Prerequisites | ||
|
||
## Run locally | ||
This project is composed of three pieces: | ||
Before running locally, ensure you have: | ||
- Docker installed | ||
- Python 3.8+ with pip | ||
- Node.js 16+ with npm | ||
- OpenAI API key ([get one here](https://platform.openai.com/api-keys)) | ||
|
||
1. FalkorDB Graph DB - this is where your graphs are stored and queried | ||
2. Code-Graph-Backend - backend logic | ||
3. Code-Graph-Frontend - website | ||
## Running Locally | ||
|
||
You'll need to start all three components: | ||
Code Graph consists of three components that work together: | ||
|
||
### Run FalkorDB | ||
| Component | Purpose | Port | | ||
|-----------|---------|------| | ||
| **FalkorDB** | Graph database for storing and querying code relationships | 6379 | | ||
| **Backend** | API server handling analysis logic | 5000 | | ||
| **Frontend** | Web interface for visualization | 3000 | | ||
|
||
### Step 1: Start FalkorDB | ||
|
||
```bash | ||
docker run -p 6379:6379 -it --rm falkordb/falkordb | ||
``` | ||
|
||
### Run Code-Graph-Backend | ||
|
||
#### Clone the Backend | ||
### Step 2: Setup Backend | ||
|
||
#### Clone and configure | ||
```bash | ||
git clone https://github.com/FalkorDB/code-graph-backend.git | ||
cd code-graph-backend | ||
``` | ||
|
||
#### Setup environment variables | ||
|
||
`SECRET_TOKEN` - user defined token used to authorize the request | ||
|
||
#### Set environment variables | ||
```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 FALKORDB_HOST=localhost | ||
export FALKORDB_PORT=6379 | ||
export OPENAI_API_KEY=<YOUR_OPENAI_API_KEY> | ||
export SECRET_TOKEN=<YOUR_SECRET_TOKEN> | ||
export FLASK_RUN_HOST=0.0.0.0 | ||
export FLASK_RUN_PORT=5000 | ||
``` | ||
|
||
#### Install dependencies & run | ||
> **Tip**: Create a `.env` file with these variables for easier management | ||
#### Install and 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 & | ||
|
||
``` | ||
|
||
### Run Code-Graph-Frontend | ||
|
||
#### Clone the Frontend | ||
### Step 3: Setup Frontend | ||
|
||
#### Clone and configure | ||
```bash | ||
git clone https://github.com/FalkorDB/code-graph.git | ||
cd code-graph | ||
``` | ||
|
||
#### Setup environment variables | ||
|
||
#### Set 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> | ||
export BACKEND_URL=http://localhost:5000 | ||
export SECRET_TOKEN=<YOUR_SECRET_TOKEN> | ||
export OPENAI_API_KEY=<YOUR_OPENAI_API_KEY> | ||
``` | ||
|
||
#### Install dependencies & run | ||
|
||
#### Install and run | ||
```bash | ||
cd code-graph | ||
npm install | ||
npm run dev | ||
``` | ||
|
||
### Process a local repository | ||
### Step 4: Analyze Your Code | ||
|
||
Once all services are running, analyze 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>" | ||
curl -X POST http://127.0.0.1:5000/analyze_folder \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: <YOUR_SECRET_TOKEN>" \ | ||
-d '{ | ||
"path": "/path/to/your/repo", | ||
"ignore": [ | ||
"./.github", | ||
"./.git", | ||
"./node_modules", | ||
"./build", | ||
"./dist" | ||
] | ||
}' | ||
``` | ||
|
||
Then visit [http://localhost:3000](http://localhost:3000) to view your code graph! | ||
|
||
## Configuration | ||
|
||
### Environment Variables | ||
|
||
| Variable | Description | Required | Default | | ||
|----------|-------------|----------|---------| | ||
| `OPENAI_API_KEY` | Your OpenAI API key for code analysis | Yes | - | | ||
| `SECRET_TOKEN` | Authorization token for API requests | Yes | - | | ||
| `FALKORDB_HOST` | FalkorDB server hostname | No | localhost | | ||
| `FALKORDB_PORT` | FalkorDB server port | No | 6379 | | ||
| `FLASK_RUN_HOST` | Backend server host | No | 0.0.0.0 | | ||
| `FLASK_RUN_PORT` | Backend server port | No | 5000 | | ||
|
||
### Supported Languages | ||
|
||
Currently supported: | ||
- **C/C++** | ||
- **Python** | ||
|
||
Coming soon: | ||
- **JavaScript/TypeScript** | ||
- **Go** | ||
- **Java** | ||
- **Rust** | ||
## Contributing | ||
|
||
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details. | ||
|
||
## License | ||
|
||
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. | ||
|
||
## Support | ||
|
||
- **Email**: support@falkordb.com | ||
- **Discord**: [Join our community](https://discord.gg/falkordb) | ||
- **Issues**: [GitHub Issues](https://github.com/FalkorDB/code-graph/issues) | ||
- **Docs**: [Documentation](https://docs.falkordb.com) | ||
|
||
--- | ||
|
||
<div align="center"> | ||
Made with ❤️ by the FalkorDB team | ||
</div> | ||
|
||
### Consider ⭐️ to show your support! | ||
|
||
Note: At the moment code-graph can analyze both the Java & Python source files. | ||
Support for additional languages e.g. C, JavaScript, Go is planned to be added | ||
in the future. | ||
|
||
Browse to [http://localhost:3000](http://localhost:3000) | ||
code graph, code visualization, codebase analysis, dependency graph, software architecture, code dependencies, graph database, FalkorDB, code analysis tool, source code visualization, project dependencies, code structure analysis, software development tools, code mapping, dependency tracking, code relationships, software visualization, code exploration, development workflow, code insights, static code analysis, code comprehension, software engineering tools, code quality analysis, project structure visualization |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.