Visualize codebases as knowledge graphs to analyze dependencies, detect bottlenecks, and optimize projects.
Try the Live Demo to see Code Graph in action!
Before running locally, ensure you have:
- Docker installed
- Python 3.8+ with pip
- Node.js 16+ with npm
- OpenAI API key (get one here)
Code Graph consists of three components that work together:
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 |
docker run -p 6379:6379 -it --rm falkordb/falkordb
git clone https://github.com/FalkorDB/code-graph-backend.git cd code-graph-backend
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
Tip: Create a
.env
file with these variables for easier management
pip install --no-cache-dir -r requirements.txt flask --app api/index.py run --debug > flask.log 2>&1 &
git clone https://github.com/FalkorDB/code-graph.git cd code-graph
export BACKEND_URL=http://localhost:5000 export SECRET_TOKEN=<YOUR_SECRET_TOKEN> export OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>
npm install npm run dev
Once all services are running, analyze a local repository:
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 to view your code graph!
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 |
Currently supported:
- C/C++
- Python
Coming soon:
- JavaScript/TypeScript
- Go
- Java
- Rust
We welcome contributions! Please see our Contributing Guide for details.
This project is licensed under the MIT License - see the LICENSE file for details.
- Email: support@falkordb.com
- Discord: Join our community
- Issues: GitHub Issues
- Docs: Documentation
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