aura-web/README.md

60 lines
1.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# aura-web
Aura Agent Platform 前端项目React + Vite + TypeScript
> 由 `rh-agent-platform/web/` 拆分独立而来。后端代码现位于平级项目 `aura-server`。
## 本地开发
```bash
npm install
npm run dev # http://localhost:5173
```
默认 `/api` 代理到 `http://localhost:4001`(即 aura-server 的 Go 服务)。
如需切换:
```bash
VITE_API_TARGET=http://localhost:4000 npm run dev
```
## 构建
```bash
npm run build # 产物输出至 dist/
npm run preview # 本地预览
```
## 发布
1、本地执行
```bash
npm run build
```
2、本地执行上传 dist 到服务器):
```bash
rsync -avz --delete dist/ root@156.230.62.22:/var/www/aura-web/
```
## Docker
```bash
cp .env.example .env
docker compose up -d --build
# 浏览器访问 http://localhost:8080
```
## 目录结构
```
src/
├── components/ 公共组件
├── pages/ 路由页面
├── store/ Zustand 状态
├── api.ts REST/SSE 客户端
└── main.tsx 入口
```