diff --git a/lightrag/api/lightrag_server.py b/lightrag/api/lightrag_server.py index a531d7f0..1fdf5915 100644 --- a/lightrag/api/lightrag_server.py +++ b/lightrag/api/lightrag_server.py @@ -1463,12 +1463,12 @@ def create_app(args): }, } - # Webui mount graph_viewer_webui/dist/index.html - webui_dir = Path(__file__).parent / "graph_viewer_webui" / "dist" + # Webui mount webui/index.html + webui_dir = Path(__file__).parent / "webui" app.mount( "/graph-viewer", StaticFiles(directory=webui_dir, html=True), - name="webui_static", + name="webui", ) # Serve the static files diff --git a/lightrag_webui/README.md b/lightrag_webui/README.md index db40b665..0a0ac346 100644 --- a/lightrag_webui/README.md +++ b/lightrag_webui/README.md @@ -1,12 +1,46 @@ -# LightRag Graph Viewer WebUI +# LightRAG WebUI -## Install [Bun](https://bun.sh/docs/installation) +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. +## Installation -## Install Dependencies +1. **Install Bun:** -`bun install --frozen-lockfile` + If you haven't already installed Bun, follow the official documentation: [https://bun.sh/docs/installation](https://bun.sh/docs/installation) -## Build +2. **Install Dependencies:** -`bun run build` + In the `lightrag_webui` directory, run the following command to install project dependencies: + + ```bash + bun install --frozen-lockfile + ``` + +3. **Build the Project:** + + Run the following command to build the project: + + ```bash + bun run build + ``` + + This command will bundle the project and output the built files to the `lightrag/api/webui` directory. + +## Development + +- **Start the Development Server:** + + If you want to run the WebUI in development mode, use the following command: + + ```bash + bun run dev + ``` + +## Script Commands + +The following are some commonly used script commands defined in `package.json`: + +- `bun install`: Installs project dependencies. +- `bun run dev`: Starts the development server. +- `bun run build`: Builds the project. +- `bun run lint`: Runs the linter. diff --git a/lightrag_webui/bun.lock b/lightrag_webui/bun.lock index fc3d9df1..8f26b118 100644 --- a/lightrag_webui/bun.lock +++ b/lightrag_webui/bun.lock @@ -2,7 +2,7 @@ "lockfileVersion": 1, "workspaces": { "": { - "name": "lightrag-graph-vierer-webui", + "name": "lightrag-webui", "dependencies": { "@faker-js/faker": "^9.4.0", "@radix-ui/react-checkbox": "^1.1.4", diff --git a/lightrag_webui/package.json b/lightrag_webui/package.json index b35ee961..f9fa65f4 100644 --- a/lightrag_webui/package.json +++ b/lightrag_webui/package.json @@ -1,5 +1,5 @@ { - "name": "lightrag-graph-vierer-webui", + "name": "lightrag-webui", "private": true, "version": "0.0.0", "type": "module", diff --git a/lightrag_webui/vite.config.ts b/lightrag_webui/vite.config.ts index 9467f258..16f51db2 100644 --- a/lightrag_webui/vite.config.ts +++ b/lightrag_webui/vite.config.ts @@ -12,5 +12,8 @@ export default defineConfig({ '@': path.resolve(__dirname, './src') } }, - base: './' + base: './', + build: { + outDir: path.resolve(__dirname, '../lightrag/api/webui') + } })