code-graph  by FalkorDB

Code analysis and knowledge graph generation

Created 2 years ago
252 stars

Top 99.6% on SourcePulse

GitHubView on GitHub
Project Summary

A code-graph demo utilizing FalkorDB and the GraphRAG-SDK, this project provides a system for analyzing and visualizing code repositories as queryable graphs. It targets developers and researchers aiming to gain deeper insights into code structure, dependencies, and relationships programmatically. The primary benefit is enabling a structured, graph-based approach to code understanding.

How It Works

The architecture consists of three core components: FalkorDB, a graph database for storing and querying code graph data; a Python Flask-based backend responsible for code analysis and API operations; and a Node.js/npm frontend for user interaction and visualization. The backend processes local repositories using the GraphRAG-SDK, parsing source files to build a graph representation, which is then persisted in FalkorDB. The frontend interacts with the backend API to retrieve and display this graph data.

Quick Start & Requirements

  • Installation: Requires cloning and running three separate services: FalkorDB (via Docker), the backend (Python/Flask), and the frontend (Node.js/npm).
  • Prerequisites: Docker, Python, Node.js, npm, an OpenAI API key, and a user-defined SECRET_TOKEN.
  • Setup: Involves cloning repositories (code-graph-backend, code-graph), setting multiple environment variables (e.g., FALKORDB_HOST, OPENAI_API_KEY, SECRET_TOKEN), installing dependencies (pip, npm), and running each service.
  • Links:
    • Backend Repo: https://github.com/FalkorDB/code-graph-backend.git
    • Frontend Repo: https://github.com/FalkorDB/code-graph.git
    • FalkorDB Docker: docker run -p 6379:6379 -it --rm falkordb/falkordb
    • Frontend Access: http://localhost:3000

Highlighted Details

  • Supports analysis of Java and Python source files.
  • Provides an /analyze_folder API endpoint for processing local repositories, with configurable ignore paths.
  • Leverages FalkorDB for efficient graph storage and querying of code structures.

Maintenance & Community

No specific information regarding maintainers, community channels (e.g., Discord, Slack), or a public roadmap is present in the provided README snippet.

Licensing & Compatibility

The README snippet does not specify the project's license, making its terms of use and compatibility for commercial or closed-source projects unclear.

Limitations & Caveats

Current language support is limited to Java and Python, with C, JavaScript, and Go planned for future additions. The system requires an OpenAI API key, introducing a dependency on an external service and potential associated costs. The multi-component setup and extensive environment variable configuration may present a moderate barrier to initial deployment.

Health Check
Last Commit

3 days ago

Responsiveness

Inactive

Pull Requests (30d)
6
Issues (30d)
1
Star History
10 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.