Opentrons Labworks Inc
Software for writing protocols and running them on the Opentrons Flex and Opentrons OT-2
家庭中药方与药材库存记录
Translation pending
HealthTypeScript · PLpgSQLGitHub @HaoLiangPaoOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
This is a repo for Chinese Medicine Related App
Taken from the repository README
Loading the full README.
Read the full README ↗记录李医生开的每一张药方、家里每一罐药材,逐步发展成「药方记录 → 医生开方计价 → 比价 → 中医知识库」的综合平台。
| 阶段 | 内容 | 状态 |
|---|---|---|
| MVP1 | 录药方(拍照识别)、管库存、记采购、煎药记录、按药统计 | ✅ 完成,测试覆盖 |
| MVP2 | 各家店比价、每副药成本、和诊所对比、药柜价值 | ✅ 完成,测试覆盖 |
| MVP3 | 药柜学堂(公开科普):学习路径、阴阳/五行等交互图、中药图鉴、经典选读(原计划的 MVP4,提前) | 🚧 原型:/learn |
| MVP4 | 医生开方:病人档案、首字母选药(炮制品归原药材)、克数/脚注/备注、实时成本(只给医生看)、一键复制微信消息、病历查询 | ✅ 第一版,测试覆盖 |
设计文档在 docs/design/:0001 MVP1 · 0002 煎药记录与测试体系 · 0003 MVP2 比价 · 0004 独立代码审查与修复 · 0005 学堂与动态图 · 0006 医生开方。
docs/design/ 设计文档(每个决定一份,编号递增)
supabase/
migrations/ 数据库 schema(按时间戳命名,只加不改)
seed.sql 常用药材 + 炮制品 + 别名
tests/ SQL 测试(*_test.sql,每个文件一个全新数据库)
local/bootstrap.sql 本地 Supabase-lite 的角色
scripts/
local-stack.sh 本地 Supabase-lite:Postgres + Auth + PostgREST + 存储网关(不需要 Docker)
test-all.sh 全部测试
test-db.sh SQL 测试
e2e.sh E2E 测试
web/ Next.js 16 应用
src/lib/*.test.ts 单元测试
e2e/ Playwright E2E(场景数据在 e2e/fixtures/)
需要:Linux x64、PostgreSQL 16+(sudo apt install postgresql)、Node 22.12 以上(建议用 nvm:nvm install 22 && nvm use,仓库里有 .nvmrc)。不要用 root 跑。
scripts/local-stack.sh up # 启动本地 Supabase-lite,会自动写好 web/.env.local
cd web && npm install
echo "OPENROUTER_API_KEY=sk-or-..." >> .env.local # 可选:拍照识别要用
npm run dev # http://localhost:3000
# 用完:scripts/local-stack.sh down(每次 up 都会清空数据)
cd web && npm install && npx playwright install chromium # 第一次
scripts/test-all.sh # 类型检查 → lint → 单元测试 → SQL 测试 → E2E
| 层 | 数量 | 单独跑 |
|---|---|---|
| 单元测试(Vitest) | 121 | cd web && npm test |
| SQL 测试 | 6 个文件,约 210 条断言 | scripts/test-db.sh |
| E2E(Playwright) | 45 | scripts/e2e.sh,只跑一组:scripts/e2e.sh --project=isolated |
E2E 的完整场景:10 张常用药方、5 家药行不同价格的采购、9 次煎药(多用、没放、处方外加药、缺货变负、撤销……)、称重校准、删除药方,最后和独立计算的账本逐味对账。详见 0002。失败时的截图和 trace 在 .local/test-results/,报告在 .local/playwright-report/。
scripts/bundle-sql.sh,它会把所有 migration 和 seed 合并成 .local/supabase-all.sql。在 SQL Editor → New query 里粘贴全部内容,点 Run(整个文件在一个事务里,失败会全部回滚)。只适用于全新项目;以后新增的 migration 单独执行那一个文件。web/.env.local 换成项目的 URL 和 publishable key(参考 web/.env.example)。合并到 main 后由 GitHub Actions 自动上线:测试 → supabase db push → vercel deploy --prod → 线上冒烟测试(cd web && npm run smoke)。需要在 GitHub 配的密钥见 0007。
手动部署:在仓库根目录运行 npx vercel deploy --prod(Vercel 项目的 Root Directory 是 web,.vercelignore 控制上传内容)。在 Vercel 里配环境变量:
| 变量 | 必填 | 说明 |
|---|---|---|
NEXT_PUBLIC_SUPABASE_URL | ✅ | Supabase → Project Settings → API |
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY | ✅ | 同上(publishable / anon key,不是 service_role) |
OPENROUTER_API_KEY | 拍照识别要用 | 设成 Sensitive |
OPENROUTER_MODELS | 可选 | 逗号分隔,按顺序尝试;默认 nvidia/nemotron-3.5-super-vl:free,deepseek/deepseek-v4.1-flash(免费模型优先,失败再用 DeepSeek)。免费模型的服务商可能记录输入,诊所正式用前建议只留付费模型,见 0001 §4 |
PARSE_DAILY_LIMIT | 可选 | 每人每天识别次数上限 |