diff --git a/SPEC.md b/SPEC.md index c76c512..858b046 100644 --- a/SPEC.md +++ b/SPEC.md @@ -11,9 +11,17 @@ - **后端**: Node.js + Express - **数据库**: SQLite (轻量级,无需额外安装) -- **前端**: 原生 HTML/CSS/JavaScript (保持简单) +- **前端**: Next.js 14 (React) - **认证**: JWT Token -- **端口**: 3500 + +## 2.1 端口配置 + +| 服务 | 端口 | 启动命令 | +|------|------|----------| +| 前端 (Next.js) | 3500 | `cd frontend && npm run dev` | +| 后端 (Express API) | 3501 | `node server.js` | + +> **注意**: 前端通过 Next.js 开发服务器的 API 代理访问后端,代理配置在 `frontend/next.config.js` 中 ## 3. UI/UX 规范 @@ -180,4 +188,18 @@ CREATE TABLE records ( 4. ✅ 可以新增收入/支出记录 5. ✅ 可以编辑和删除记录 6. ✅ 移动端界面正常显示和操作 -7. ✅ 通过 ip:3500 访问 +7. ✅ 通过 http://localhost:3500 访问前端 + +## 8. 快速启动 + +```bash +# 启动后端 (端口 3501) +cd /opt/accountbook +node server.js + +# 启动前端 (端口 3500) +cd /opt/accountbook/frontend +npm run dev +``` + +访问 http://你的IP:3500 diff --git a/frontend/components/AppShell.js b/frontend/components/AppShell.js index b7b876e..a129d56 100644 --- a/frontend/components/AppShell.js +++ b/frontend/components/AppShell.js @@ -33,7 +33,7 @@ export default function AppShell({ title, subtitle, actions, headerContent, chil return (
-
+
{headerNode ?
{headerNode}
: