code-graph/
├── api/ # Python backend (Flask)
│ ├── index.py # Main Flask app with API routes
│ ├── graph.py # Graph operations (FalkorDB)
│ ├── llm.py # LLM integration for chat
│ ├── project.py # Project management
│ ├── info.py # Repository info
│ ├── prompts.py # LLM prompts
│ ├── auto_complete.py # Auto-completion
│ ├── analyzers/ # Source code analyzers (Python, Java, C, C#)
│ ├── entities/ # Entity models
│ ├── git_utils/ # Git operations
│ └── code_coverage/ # Code coverage utilities
├── app/ # React frontend (Vite)
│ ├── src/ # Frontend source code
│ │ ├── App.tsx # Main application component
│ │ ├── main.tsx # Entry point
│ │ ├── components/ # React components
│ │ └── lib/ # Utility functions
│ ├── public/ # Static assets
│ ├── package.json # Frontend dependencies
│ ├── vite.config.ts # Vite configuration
│ └── tsconfig.json # TypeScript configuration
├── tests/ # Backend tests
├── e2e/ # End-to-end tests (Playwright)
├── Dockerfile # Unified Docker build
├── docker-compose.yml # Docker Compose setup
├── Makefile # Development commands
├── start.sh # Container startup script
├── pyproject.toml # Python project configuration
└── .env.template # Environment variables template
- Python 3.12+
- Node.js 20+
- FalkorDB instance (local or cloud)
Option A: Free cloud instance at app.falkordb.cloud
Option B: Run locally with Docker:
docker run -p 6379:6379 -it --rm falkordb/falkordbCopy the template and configure:
cp .env.template .envEdit .env with your values:
FALKORDB_HOST=localhost
FALKORDB_PORT=6379
OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>
SECRET_TOKEN=<YOUR_SECRET_TOKEN># Install backend dependencies
pip install -e ".[test]"
# Install frontend dependencies
npm install --prefix ./appOr using Make:
make install# Build the frontend
npm --prefix ./app run build
# Start the backend (serves both API and frontend)
flask --app api/index.py run --debugThe application will be available at http://localhost:5000.
For frontend development with hot-reload:
# Terminal 1: Start the Python backend
flask --app api/index.py run --debug --port 5000
# Terminal 2: Start the Vite dev server (proxies API calls to backend)
cd app && npm run devThe Vite dev server runs on http://localhost:3000 and proxies API requests to the Flask backend on port 5000.
make install # Install all dependencies
make build-dev # Build frontend (development)
make build-prod # Build frontend (production)
make run-dev # Build + start dev server
make run-prod # Build + start production server
make test # Run backend tests
make lint # Run frontend linting
make clean # Clean build artifactsdocker-compose upThis starts both FalkorDB and the CodeGraph application.
docker build -t code-graph .
docker run -p 5000:5000 \
-e FALKORDB_HOST=host.docker.internal \
-e FALKORDB_PORT=6379 \
-e OPENAI_API_KEY=<YOUR_KEY> \
-e SECRET_TOKEN=<YOUR_TOKEN> \
code-graphcurl -X POST http://127.0.0.1:5000/analyze_folder \
-H "Content-Type: application/json" \
-H "Authorization: <YOUR_SECRET_TOKEN>" \
-d '{"path": "<FULL_PATH_TO_FOLDER>", "ignore": [".github", ".git"]}'curl -X POST http://127.0.0.1:5000/analyze_repo \
-H "Content-Type: application/json" \
-H "Authorization: <YOUR_SECRET_TOKEN>" \
-d '{"repo_url": "https://github.com/user/repo"}'- Python
- Java
- C
- C#
Support for additional languages is planned.
| Method | Endpoint | Description |
|---|---|---|
| GET | /list_repos |
List all available repositories |
| GET | /graph_entities?repo=<name> |
Get graph entities for a repository |
| POST | /get_neighbors |
Get neighbors of specified nodes |
| POST | /auto_complete |
Auto-complete entity names |
| POST | /repo_info |
Get repository information |
| POST | /find_paths |
Find paths between two nodes |
| POST | /chat |
Chat with the code graph using natural language |
| POST | /analyze_folder |
Analyze a local source folder |
| POST | /analyze_repo |
Analyze a GitHub repository |
| POST | /list_commits |
List commits of a repository |
| POST | /switch_commit |
Switch to a specific commit |
Have questions or feedback? Reach out via:
- GitHub Issues
- Join our Discord
If you find this repository helpful, please consider giving it a star!
Knowledge Graph, Code Analysis, Code Visualization, Dead Code Analysis, Graph Database
