Skip to content

Commit 85189ad

Browse files
authored
Update README.md
Updated readme
1 parent a4b6e33 commit 85189ad

File tree

1 file changed

+114
-41
lines changed

1 file changed

+114
-41
lines changed

README.md

Lines changed: 114 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,160 @@
1+
<div align="center">
2+
3+
# Code Graph
4+
15
[![Try Free](https://img.shields.io/badge/Try%20Free-FalkorDB%20Cloud-FF8101?labelColor=FDE900&link=https://app.falkordb.cloud)](https://app.falkordb.cloud)
26
[![Dockerhub](https://img.shields.io/docker/pulls/falkordb/falkordb?label=Docker)](https://hub.docker.com/r/falkordb/falkordb/)
37
[![Discord](https://img.shields.io/discord/1146782921294884966?style=flat-square)](https://discord.com/invite/6M4QwDXn2w)
48
[![Workflow](https://github.com/FalkorDB/code-graph/actions/workflows/nextjs.yml/badge.svg?branch=main)](https://github.com/FalkorDB/code-graph/actions/workflows/nextjs.yml)
59

6-
![image](https://github.com/FalkorDB/code-graph/assets/753206/60f535ed-cf29-44b2-9005-721f11614803)
10+
**Visualize codebases as knowledge graphs to analyze dependencies, detect bottlenecks, and optimize projects.**
11+
12+
![FalkorDB Code Graph](https://github.com/user-attachments/assets/725e8ac0-8a64-474d-b2af-2de49b37293e)
13+
14+
</div>
15+
16+
## Quick Start
17+
18+
Try the [**Live Demo**](https://code-graph.falkordb.com/) to see Code Graph in action!
719

8-
## Getting Started
9-
[Live Demo](https://code-graph.falkordb.com/)
20+
## Prerequisites
1021

11-
## Run locally
12-
This project is composed of three pieces:
22+
Before running locally, ensure you have:
23+
- Docker installed
24+
- Python 3.8+ with pip
25+
- Node.js 16+ with npm
26+
- OpenAI API key ([get one here](https://platform.openai.com/api-keys))
1327

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
28+
## Running Locally
1729

18-
You'll need to start all three components:
30+
Code Graph consists of three components that work together:
1931

20-
### Run FalkorDB
32+
| Component | Purpose | Port |
33+
|-----------|---------|------|
34+
| **FalkorDB** | Graph database for storing and querying code relationships | 6379 |
35+
| **Backend** | API server handling analysis logic | 5000 |
36+
| **Frontend** | Web interface for visualization | 3000 |
37+
38+
### Step 1: Start FalkorDB
2139

2240
```bash
2341
docker run -p 6379:6379 -it --rm falkordb/falkordb
2442
```
2543

26-
### Run Code-Graph-Backend
27-
28-
#### Clone the Backend
44+
### Step 2: Setup Backend
2945

46+
#### Clone and configure
3047
```bash
3148
git clone https://github.com/FalkorDB/code-graph-backend.git
49+
cd code-graph-backend
3250
```
3351

34-
#### Setup environment variables
35-
36-
`SECRET_TOKEN` - user defined token used to authorize the request
37-
52+
#### Set environment variables
3853
```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
54+
export FALKORDB_HOST=localhost
55+
export FALKORDB_PORT=6379
56+
export OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>
57+
export SECRET_TOKEN=<YOUR_SECRET_TOKEN>
58+
export FLASK_RUN_HOST=0.0.0.0
59+
export FLASK_RUN_PORT=5000
4260
```
4361

44-
#### Install dependencies & run
62+
> **Tip**: Create a `.env` file with these variables for easier management
4563
64+
#### Install and run
4665
```bash
47-
cd code-graph-backend
48-
4966
pip install --no-cache-dir -r requirements.txt
50-
5167
flask --app api/index.py run --debug > flask.log 2>&1 &
52-
5368
```
5469

55-
### Run Code-Graph-Frontend
56-
57-
#### Clone the Frontend
70+
### Step 3: Setup Frontend
5871

72+
#### Clone and configure
5973
```bash
6074
git clone https://github.com/FalkorDB/code-graph.git
75+
cd code-graph
6176
```
6277

63-
#### Setup environment variables
64-
78+
#### Set environment variables
6579
```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>
80+
export BACKEND_URL=http://localhost:5000
81+
export SECRET_TOKEN=<YOUR_SECRET_TOKEN>
82+
export OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>
6883
```
6984

70-
#### Install dependencies & run
71-
85+
#### Install and run
7286
```bash
73-
cd code-graph
7487
npm install
7588
npm run dev
7689
```
7790

78-
### Process a local repository
91+
### Step 4: Analyze Your Code
92+
93+
Once all services are running, analyze a local repository:
94+
7995
```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>"
96+
curl -X POST http://127.0.0.1:5000/analyze_folder \
97+
-H "Content-Type: application/json" \
98+
-H "Authorization: <YOUR_SECRET_TOKEN>" \
99+
-d '{
100+
"path": "/path/to/your/repo",
101+
"ignore": [
102+
"./.github",
103+
"./.git",
104+
"./node_modules",
105+
"./build",
106+
"./dist"
107+
]
108+
}'
81109
```
82110

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.
111+
Then visit [http://localhost:3000](http://localhost:3000) to view your code graph!
112+
113+
## Configuration
114+
115+
### Environment Variables
116+
117+
| Variable | Description | Required | Default |
118+
|----------|-------------|----------|---------|
119+
| `OPENAI_API_KEY` | Your OpenAI API key for code analysis | Yes | - |
120+
| `SECRET_TOKEN` | Authorization token for API requests | Yes | - |
121+
| `FALKORDB_HOST` | FalkorDB server hostname | No | localhost |
122+
| `FALKORDB_PORT` | FalkorDB server port | No | 6379 |
123+
| `FLASK_RUN_HOST` | Backend server host | No | 0.0.0.0 |
124+
| `FLASK_RUN_PORT` | Backend server port | No | 5000 |
125+
126+
### Supported Languages
127+
128+
Currently supported:
129+
- **C/C++**
130+
- **Python**
131+
132+
Coming soon:
133+
- **JavaScript/TypeScript**
134+
- **Go**
135+
- **Java**
136+
- **Rust**
137+
## Contributing
138+
139+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
140+
141+
## License
142+
143+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
144+
145+
## Support
146+
147+
- **Email**: [email protected]
148+
- **Discord**: [Join our community](https://discord.gg/falkordb)
149+
- **Issues**: [GitHub Issues](https://github.com/FalkorDB/code-graph/issues)
150+
- **Docs**: [Documentation](https://docs.falkordb.com)
151+
152+
---
153+
154+
<div align="center">
155+
Made with ❤️ by the FalkorDB team
156+
</div>
157+
158+
### Consider ⭐️ to show your support!
86159

87-
Browse to [http://localhost:3000](http://localhost:3000)
160+
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

0 commit comments

Comments
 (0)