feat: add Vite configuration for Tiku.PlatformAdmin.Web and update documentation

- Introduced Vite configuration files (vite.config.js, vite.config.ts, vite.config.d.ts) for the React frontend.
- Configured server proxy settings for API endpoints.
- Added Vitest configuration files (vitest.config.js, vitest.config.ts, vitest.config.d.ts) for testing.
- Updated architecture overview to reflect the separation of the platform admin frontend into its own React project.
- Modified quickstart documentation to guide users on starting the platform admin frontend.
This commit is contained in:
2026-07-30 14:54:53 +08:00
parent 8eaad9a358
commit 30fd159041
62 changed files with 63463 additions and 3760 deletions

View File

@@ -0,0 +1,25 @@
# Tiku 平台管理前端
独立部署的 React + TypeScript 平台管理端。业务接口契约只从 `Tiku.Api` 实时 OpenAPI 文档生成,不依赖旧静态前端的接口适配代码。
## 本地开发
首次使用先安装前端依赖:
```bash
npm install
```
之后从仓库根目录运行 `dotnet run --project Tiku.Api`ASP.NET Core 的开发代理会自动启动本工程的 Vite 服务。访问 <http://localhost:5173>。开发服务器默认代理 `/api``http://localhost:5090`;需要修改目标时设置 `VITE_DEV_API_TARGET`
也可以在本目录单独执行 `npm run dev`便于只调试前端。Production 环境不会由 API 启动 Node 进程,前端仍应独立构建和部署。
## 接口契约
```bash
OPENAPI_URL=http://localhost:5090/openapi/v1.json npm run generate:api
```
生成结果包括完整 OpenAPI TypeScript 类型,以及全部 `/api/platform-admin/**``/api/backoffice/platform/**` 接口的页面操作元数据。`npm test` 会验证每个后端平台接口都已归入且只归入一个页面组。
生产部署通过 `VITE_API_BASE_URL` 指定 API 地址;同域反向代理时可以留空。