|
|
@@ -46,36 +46,45 @@
|
|
|
|
|
|
## 首次初始化
|
|
|
|
|
|
-先准备 Docker Desktop、Python 3.12、uv、Node.js 22、pnpm 和本地 Milvus。项目只读取 `backend/.env`。
|
|
|
+先启动 Docker Desktop 中的 MySQL、Redis 以及本地 Milvus,并准备 Python 3.12、uv、Node.js 22 和 pnpm。
|
|
|
|
|
|
-数据库完整快照位于 `database/mysql.sql`。数据库初始化脚本会把该文件复制进 Docker 的 MySQL 容器并自动导入,不需要本机安装 MySQL Client。
|
|
|
+项目只读取 `backend/.env`。确认其中的 MySQL、Redis、Milvus、模型服务和 LangSmith 配置后,在项目根目录按顺序运行:
|
|
|
|
|
|
-先安装前后端依赖:
|
|
|
+Windows PowerShell:
|
|
|
|
|
|
-```bash
|
|
|
+```powershell
|
|
|
uv sync --project backend --locked
|
|
|
pnpm --dir frontend install --frozen-lockfile
|
|
|
-```
|
|
|
-
|
|
|
-初始化第三阶段 MySQL 数据,然后在本地 Milvus 启动后初始化知识库。
|
|
|
|
|
|
-Windows PowerShell:
|
|
|
-
|
|
|
-```powershell
|
|
|
.\scripts\init-databases.ps1
|
|
|
-powershell -ExecutionPolicy Bypass -File .\scripts\seed-knowledge.ps1
|
|
|
+.\scripts\seed-knowledge.ps1
|
|
|
```
|
|
|
|
|
|
macOS / Linux:
|
|
|
|
|
|
```bash
|
|
|
+uv sync --project backend --locked
|
|
|
+pnpm --dir frontend install --frozen-lockfile
|
|
|
+
|
|
|
./scripts/init-databases.sh
|
|
|
./scripts/seed-knowledge.sh
|
|
|
```
|
|
|
|
|
|
-默认 MySQL 容器名为 `zhibaotong-mysql`。如果实际容器名不同,Windows 使用 `.\scripts\init-databases.ps1 -ContainerName 容器名`,macOS/Linux 使用 `./scripts/init-databases.sh 容器名`。
|
|
|
+以上命令依次完成后端依赖安装、前端依赖安装、MySQL 数据导入和 Milvus 知识库初始化。
|
|
|
+
|
|
|
+MySQL 数据来自 `database/mysql.sql`,其中已经包含前两个阶段继承数据和第三阶段所需业务数据。`init-databases` 脚本会自动导入 `insurance_s3_core`、`insurance_s3_agent` 和 `insurance_s3_analytics`,因此首次初始化不需要再单独执行迁移、种子或阶段继承命令。
|
|
|
+
|
|
|
+脚本默认连接名为 `zhibaotong-mysql` 的 MySQL 容器。如果你的容器名称不同,只需将数据库初始化命令替换为:
|
|
|
+
|
|
|
+```powershell
|
|
|
+.\scripts\init-databases.ps1 -ContainerName 你的容器名
|
|
|
+```
|
|
|
+
|
|
|
+macOS / Linux:
|
|
|
|
|
|
-`database/mysql.sql` 只重建 `insurance_s3_core`、`insurance_s3_agent` 和 `insurance_s3_analytics`,并已包含前两个阶段继承后的业务数据,不再执行迁移、种子或阶段继承脚本。
|
|
|
+```bash
|
|
|
+./scripts/init-databases.sh 你的容器名
|
|
|
+```
|
|
|
|
|
|
## 启动
|
|
|
|