ArnoChen
commited on
Commit
·
5ff9ee8
1
Parent(s):
dc3571b
update readme
Browse filesconfigure output directory
- lightrag/api/lightrag_server.py +3 -3
- lightrag_webui/README.md +40 -6
- lightrag_webui/bun.lock +1 -1
- lightrag_webui/package.json +1 -1
- lightrag_webui/vite.config.ts +4 -1
lightrag/api/lightrag_server.py
CHANGED
@@ -1463,12 +1463,12 @@ def create_app(args):
|
|
1463 |
},
|
1464 |
}
|
1465 |
|
1466 |
-
# Webui mount
|
1467 |
-
webui_dir = Path(__file__).parent / "
|
1468 |
app.mount(
|
1469 |
"/graph-viewer",
|
1470 |
StaticFiles(directory=webui_dir, html=True),
|
1471 |
-
name="
|
1472 |
)
|
1473 |
|
1474 |
# Serve the static files
|
|
|
1463 |
},
|
1464 |
}
|
1465 |
|
1466 |
+
# Webui mount webui/index.html
|
1467 |
+
webui_dir = Path(__file__).parent / "webui"
|
1468 |
app.mount(
|
1469 |
"/graph-viewer",
|
1470 |
StaticFiles(directory=webui_dir, html=True),
|
1471 |
+
name="webui",
|
1472 |
)
|
1473 |
|
1474 |
# Serve the static files
|
lightrag_webui/README.md
CHANGED
@@ -1,12 +1,46 @@
|
|
1 |
-
#
|
2 |
|
3 |
-
|
4 |
|
|
|
5 |
|
6 |
-
|
7 |
|
8 |
-
|
9 |
|
10 |
-
|
11 |
|
12 |
-
`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# LightRAG WebUI
|
2 |
|
3 |
+
LightRAG WebUI is a React-based web interface for interacting with the LightRAG system. It provides a user-friendly interface for querying, managing, and exploring LightRAG's functionalities.
|
4 |
|
5 |
+
## Installation
|
6 |
|
7 |
+
1. **Install Bun:**
|
8 |
|
9 |
+
If you haven't already installed Bun, follow the official documentation: [https://bun.sh/docs/installation](https://bun.sh/docs/installation)
|
10 |
|
11 |
+
2. **Install Dependencies:**
|
12 |
|
13 |
+
In the `lightrag_webui` directory, run the following command to install project dependencies:
|
14 |
+
|
15 |
+
```bash
|
16 |
+
bun install --frozen-lockfile
|
17 |
+
```
|
18 |
+
|
19 |
+
3. **Build the Project:**
|
20 |
+
|
21 |
+
Run the following command to build the project:
|
22 |
+
|
23 |
+
```bash
|
24 |
+
bun run build
|
25 |
+
```
|
26 |
+
|
27 |
+
This command will bundle the project and output the built files to the `lightrag/api/webui` directory.
|
28 |
+
|
29 |
+
## Development
|
30 |
+
|
31 |
+
- **Start the Development Server:**
|
32 |
+
|
33 |
+
If you want to run the WebUI in development mode, use the following command:
|
34 |
+
|
35 |
+
```bash
|
36 |
+
bun run dev
|
37 |
+
```
|
38 |
+
|
39 |
+
## Script Commands
|
40 |
+
|
41 |
+
The following are some commonly used script commands defined in `package.json`:
|
42 |
+
|
43 |
+
- `bun install`: Installs project dependencies.
|
44 |
+
- `bun run dev`: Starts the development server.
|
45 |
+
- `bun run build`: Builds the project.
|
46 |
+
- `bun run lint`: Runs the linter.
|
lightrag_webui/bun.lock
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
"lockfileVersion": 1,
|
3 |
"workspaces": {
|
4 |
"": {
|
5 |
-
"name": "lightrag-
|
6 |
"dependencies": {
|
7 |
"@faker-js/faker": "^9.4.0",
|
8 |
"@radix-ui/react-checkbox": "^1.1.4",
|
|
|
2 |
"lockfileVersion": 1,
|
3 |
"workspaces": {
|
4 |
"": {
|
5 |
+
"name": "lightrag-webui",
|
6 |
"dependencies": {
|
7 |
"@faker-js/faker": "^9.4.0",
|
8 |
"@radix-ui/react-checkbox": "^1.1.4",
|
lightrag_webui/package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
{
|
2 |
-
"name": "lightrag-
|
3 |
"private": true,
|
4 |
"version": "0.0.0",
|
5 |
"type": "module",
|
|
|
1 |
{
|
2 |
+
"name": "lightrag-webui",
|
3 |
"private": true,
|
4 |
"version": "0.0.0",
|
5 |
"type": "module",
|
lightrag_webui/vite.config.ts
CHANGED
@@ -12,5 +12,8 @@ export default defineConfig({
|
|
12 |
'@': path.resolve(__dirname, './src')
|
13 |
}
|
14 |
},
|
15 |
-
base: './'
|
|
|
|
|
|
|
16 |
})
|
|
|
12 |
'@': path.resolve(__dirname, './src')
|
13 |
}
|
14 |
},
|
15 |
+
base: './',
|
16 |
+
build: {
|
17 |
+
outDir: path.resolve(__dirname, '../lightrag/api/webui')
|
18 |
+
}
|
19 |
})
|