Skip to content

Commit 13d27c1

Browse files
committed
Merge remote-tracking branch 'origin/staging' into add-create-repo
2 parents 0f9143a + f593090 commit 13d27c1

31 files changed

+2893
-2042
lines changed

README.md

Lines changed: 58 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,113 @@
1+
# CodeGraph - Knowledge Graph Visualization Tool
2+
3+
### Visualize your repository with our graph for code analysis
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)
9+
-
10+
11+
![Alt Text](https://res.cloudinary.com/dhd0k02an/image/upload/v1739719361/FalkorDB_-_Github_-_readme_jr6scy.gif)
512

6-
![image](https://github.com/FalkorDB/code-graph/assets/753206/60f535ed-cf29-44b2-9005-721f11614803)
13+
**👉🏻[Live Demo](https://code-graph.falkordb.com/)**
714

8-
## Getting Started
9-
[Live Demo](https://code-graph.falkordb.com/)
15+
## Running Locally
1016

11-
## Run locally
12-
This project is composed of three pieces:
17+
This project consists of three core components:
1318

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
19+
1. **FalkorDB Graph DB** – Stores and queries your graphs.
20+
2. **Code-Graph-Backend** – Handles backend logic.
21+
3. **Code-Graph-Frontend** – Provides the web interface.
1722

18-
You'll need to start all three components:
23+
To set up the project, you’ll need to start all three components.
1924

20-
### Run FalkorDB
25+
### 1. Start FalkorDB
26+
27+
Run the following command to start FalkorDB using Docker:
2128

2229
```bash
2330
docker run -p 6379:6379 -it --rm falkordb/falkordb
2431
```
2532

26-
### Run Code-Graph-Backend
33+
### 2. Start the Backend
2734

28-
#### Clone the Backend
35+
#### Clone the Backend Repository
2936

3037
```bash
3138
git clone https://github.com/FalkorDB/code-graph-backend.git
39+
cd code-graph-backend
3240
```
3341

34-
#### Setup environment variables
42+
#### Set Up Environment Variables
3543

36-
`SECRET_TOKEN` - user defined token used to authorize the request
44+
Define the required environment variables:
3745

3846
```bash
3947
export FALKORDB_HOST=localhost FALKORDB_PORT=6379 \
40-
OPENAI_API_KEY=<YOUR OPENAI_API_KEY> SECRET_TOKEN=<YOUR_SECRECT_TOKEN> \
48+
OPENAI_API_KEY=<YOUR_OPENAI_API_KEY> SECRET_TOKEN=<YOUR_SECRET_TOKEN> \
4149
FLASK_RUN_HOST=0.0.0.0 FLASK_RUN_PORT=5000
4250
```
4351

44-
#### Install dependencies & run
52+
`SECRET_TOKEN` is a user-defined token used for request authorization.
4553

46-
```bash
47-
cd code-graph-backend
54+
#### Install Dependencies & Start the Backend
4855

56+
```bash
4957
pip install --no-cache-dir -r requirements.txt
50-
5158
flask --app api/index.py run --debug > flask.log 2>&1 &
52-
5359
```
5460

55-
### Run Code-Graph-Frontend
61+
### 3. Start the Frontend
5662

57-
#### Clone the Frontend
63+
#### Clone the Frontend Repository
5864

5965
```bash
6066
git clone https://github.com/FalkorDB/code-graph.git
67+
cd code-graph
6168
```
6269

63-
#### Setup environment variables
70+
#### Set Up Environment Variables
6471

6572
```bash
6673
export BACKEND_URL=http://${FLASK_RUN_HOST}:${FLASK_RUN_PORT} \
67-
SECRET_TOKEN=<YOUR_SECRECT_TOKEN> OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>
74+
SECRET_TOKEN=<YOUR_SECRET_TOKEN> OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>
6875
```
6976

70-
#### Install dependencies & run
77+
#### Install Dependencies & Start the Frontend
7178

7279
```bash
73-
cd code-graph
7480
npm install
7581
npm run dev
7682
```
7783

78-
### Process a local repository
84+
### 4. Process a Local Repository
85+
86+
Use the following `curl` command to analyze a local repository:
87+
7988
```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>"
89+
curl -X POST http://127.0.0.1:5000/analyze_folder \
90+
-H "Content-Type: application/json" \
91+
-H "Authorization: <YOUR_SECRET_TOKEN>" \
92+
-d '{"path": "<PATH_TO_LOCAL_REPO>", "ignore": ["./.github", "./sbin", "./.git", "./deps", "./bin", "./build"]}'
8193
```
8294

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.
95+
**Note:** Currently, Code-Graph supports analyzing C and Python source files.
96+
Support for additional languages (e.g., JavaScript, Go, Java) is planned.
97+
98+
### 5. Access the Web Interface
99+
100+
Once everything is running, open your browser and go to:
101+
102+
[http://localhost:3000](http://localhost:3000)
103+
104+
## Community
105+
106+
Have questions or feedback? Reach out via:
107+
108+
* [GitHub Issues](https://github.com/FalkorDB/GraphRAG-SDK/issues)
109+
* Join our [Discord](https://discord.com/invite/6M4QwDXn2w)
110+
111+
⭐️ If you find this repository helpful, please consider giving it a star!
86112

87-
Browse to [http://localhost:3000](http://localhost:3000)
113+
Knowledge Graph, Code Analysis, Code Visualization, Dead Code Analysis, Graph Database

app/components/Input.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { toast } from "@/components/ui/use-toast"
22
import { getCategoryColorName, getCategoryColorValue, Graph } from "./model"
33
import { useEffect, useRef, useState } from "react"
4-
import { PathNode } from "../page"
4+
import { PathNode } from "@/lib/utils"
55
import { cn } from "@/lib/utils"
66
import { prepareArg } from "../utils"
77

@@ -131,7 +131,7 @@ export default function Input({ onValueChange, handleSubmit, graph, icon, node,
131131

132132
return (
133133
<div
134-
className={cn("w-[20dvw] relative pointer-events-none rounded-md gap-4", parentClassName)}
134+
className={cn("w-full md:w-[20dvw] relative pointer-events-none rounded-md gap-4", parentClassName)}
135135
data-name='search-bar'
136136
>
137137
<input
@@ -142,6 +142,7 @@ export default function Input({ onValueChange, handleSubmit, graph, icon, node,
142142
}}
143143
onKeyDown={handleKeyDown}
144144
className={cn("w-full border p-2 rounded-md pointer-events-auto", className)}
145+
placeholder="Search for nodes in the graph"
145146
value={node?.name || ""}
146147
onChange={(e) => {
147148
const newVal = e.target.value
@@ -166,7 +167,7 @@ export default function Input({ onValueChange, handleSubmit, graph, icon, node,
166167
open &&
167168
<div
168169
ref={containerRef}
169-
className="z-10 w-full bg-white absolute flex flex-col pointer-events-auto border rounded-md max-h-[50dvh] overflow-y-auto overflow-x-hidden p-2 gap-2"
170+
className="z-10 w-full bg-white absolute flex flex-col pointer-events-auto border rounded-md md:max-h-[50dvh] h-[25dvh] overflow-y-auto overflow-x-hidden p-2 gap-2"
170171
data-name='search-bar-list'
171172
style={{
172173
top: inputHeight + 16

0 commit comments

Comments
 (0)