Files
opencatd-open/frontend/README.md
T
Sakurasan ac0a6808ec refactor: frontend TS migration + Tailwind4/daisyUI5 unify + BUILDPLATFORM docker build
- migrate frontend to TypeScript (vue-tsc strict in build), upgrade all deps to latest (Vite 8, Tailwind 4, daisyUI 5, Pinia 4, vue-router 5)
- restructure frontend dirs (api/components/common/layouts/styles/types/views)
- drop Element Plus, add daisyUI TagInput; main CSS 490KB->163KB, entry JS 618KB->1.3KB
- rewrite Dockerfile(.cn): frontend/backend stages pinned to $BUILDPLATFORM, CGO_ENABLED=0 cross-compile, no QEMU in multi-arch builds; add .dockerignore
- local dev: Vite /api proxy + make dev targets; go:embed all:dist with .gitkeep so backend runs without prior frontend build
- fix latent bugs: Keys.vue users ref, Settings.vue undefined userStore, Login.vue Ref-as-error display, res.error misuse
- add REFACTOR_PLAN.md (phased refactor log)
2026-08-29 23:27:31 +08:00

38 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# opencatd-open frontend
Vue 3 + TypeScript + Vite + Tailwind CSS 4 / daisyUI 5。
## 本地开发
前端通过 Vite dev server 开发(支持热更新),`/api` 请求代理到本地 Go 后端,无需每次重新构建嵌入:
```bash
# 方式一:一条命令并行启动前后端(后端 8080,前端 5173)
make dev
# 方式二:分开跑
make dev-backend # go run ./cmd/openteam,PORT=8080
make dev-frontend # cd frontend && pnpm dev
```
浏览器访问 http://localhost:5173 (localhost 属浏览器安全上下文,clipboard / Passkey 可直接用)。
环境变量:
| 变量 | 说明 | 默认 |
| --- | --- | --- |
| `VITE_DEV_API_TARGET` | dev 代理的后端地址 | `http://localhost:8080` |
| `VITE_DEV_HTTPS` | 设为 `true` 时启用自签名 HTTPS dev server | 关闭 |
## 构建与嵌入
`make web` 构建前端并把产物移入 `cmd/openteam/dist`(Go 通过 `//go:embed all:dist` 嵌入);`make build` 编译二进制。`dist` 目录仅含 `.gitkeep` 占位时后端也能正常编译,因此克隆后可直接 `make dev-backend` 起后端联调。
## 其他常用命令
```bash
pnpm dev # 仅前端 dev server
pnpm typecheck # vue-tsc 类型检查
pnpm build # 类型检查 + 生产构建
```