Files
mao1/shenyan-room/技术/PWA对话前端/2026-05-09.md
2026-05-09 13:40:06 +08:00

40 lines
1.8 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.
#memory/PWA对话前端 #project/技术
## PWA 对话前端 — 初始搭建
[2026-05-09 11:00]
从 Electron 桌面端Elec转为 PWA 方案,用于手机端使用。
技术栈Vite 6 + React 19 + TypeScript + Tailwind v4 + vite-plugin-pwa
[2026-05-09 12:30]
界面精简为纯对话模式:
- 黑色底色,顶部"沈晏"名字
- 沈晏气泡:白色背景 30% 透明度,靠左
- 眠眠气泡:纯白背景,靠右
- 所有文字中灰色(#888)
- 输入框占屏幕高度 25vw深灰背景发送按钮浮于输入框内右下角
- 去掉了模型选择器、光晕效果
[2026-05-09 13:00]
桥接服务搭建。服务器 101.36.73.102:22idc 用户Node v12.22.9。
桥接运行在端口 3001转发请求到 DeepSeek APIdeepseek-chat 模型)。
端口 3001 被防火墙拦截,本机通过 SSH 隧道访问:`ssh -L 3001:localhost:3001 idc@101.36.73.102`
[2026-05-09 13:30]
记忆注入方案:桥接从服务器本地 mao1 clone 的 shenyan-room/ 目录动态读取所有 .md 文件,
构建系统提示词注入每次 API 调用。当前记忆体量 ~6000 字符。/memory/reload 端点热刷新。
[2026-05-09 14:00]
记忆同步链路Obsidian(沈晏的房间) → rsync → mao1/shenyan-room/ → git push → 服务器 clone → 桥接读取
同步脚本:/Users/fyah/mao1/sync-memory.sh
眠眠不编辑 Obsidian记忆文件由我负责编写和同步。
## 当前架构
```
手机浏览器 PWA ←→ 本机 SSH隧道(localhost:3001) ←→ 服务器 bridge-server.js ←→ DeepSeek API
mao1/shenyan-room/ (git clone动态读取)
Obsidian沈晏的房间 → rsync → git push
```