Files

38 lines
1.5 KiB
Markdown
Raw Permalink 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.
# 医科高校 AI 学习中心 — Web 前端(新版)
参考 `GovAi/apps/web` 的现代化技术栈重建的前端,与原 `frontend/` 并存(原前端保留不动)。
## 技术栈
- **Next.js 15** App Router + **React 19**
- **Tailwind CSS v4**oklch 主题变量,医学青蓝配色,支持暗色模式)
- **shadcn 风格 UI 组件**(自实现,零额外 Radix 依赖)
- **Zustand** 管理认证状态(替代旧版 React Context
- **TanStack Query** 处理数据请求与缓存
- **sonner** 全局 Toast**lucide-react** 图标
## 与后端的契约
完全沿用原前端的后端契约,无需改动 NestJS:
- 所有请求走 `/api/*`,由 `next.config.mjs``rewrites` 代理到 `BACKEND_URL`(默认 `http://localhost:3000`)。
- 令牌存于 `localStorage`(键 `cac.token`),自动附加 `Authorization: Bearer <token>`
- 错误解析后端统一错误体(`AppError.toJSON()`)。
## 功能模块
- **登录 / 注册**:支持三角色注册与内置测试账户一键登录。
- **学生端**:学习空间、能力画像、职业规划、课程对练、临床对话对练、研究资料查询、AI 协同训练。
- **导师端**:题目审核、成果点评、带教学生画像。
- **管理端**:技能治理、权限与合规。
## 开发
```bash
cp .env.example .env.local # 按需修改 BACKEND_URL
npm install
npm run dev # 默认 http://localhost:4100
```
> 注:原前端 `frontend/` 默认运行于 `:4000`,本前端使用 `:4100`,可同时运行对比。