723c4fc5c9bdae771768193161fe55272a2bf2b8
Batch1 — 解析器 (pubmed_query_parser.py) - P0-1: 未知字段标签降级为 WORD token 而非 ParseError - P2-1: 增加未消费 token 检查 - P2-2: PRISMA 字段标签正则 [\w:+] → [\w:]+ - P2-3: Unicode NFKC 规格化输入 - P2-4: re.ASCII 防止 Unicode 数字匹配 - P2-9: 移除重复 dataclass 字段 Batch2 — 搜索引擎 (search_engine.py) - P1-1: 批量 PMID 查询替代 N+1 循环 - P1-2: isdigit() → isdecimal() - P1-5: 移除 precision_mode 参数 - P2-5: 移除死代码 - P2-6: 统一 _CHINESE_RE 正则 Batch3 — ATM 引擎 (query_expansion.py) - P0-4: name_zh ILIKE 中文回退 + _find_mesh_tags 中文降级 - P1-3: name_en ILIKE 加 LIMIT 100 Batch4 — API 层 (features.py) - P1-5: 移除 precision_mode 请求字段 - P1-11: 增加 logging - P2-8: NLM_SUBSET_LABELS f-string 安全注释 - P2-12: split 校验器近似性注释 Batch5 — SearchView.vue - P0-5a/b/c: 日期修复(UTC 方法、互斥逻辑、restoreFromQuery 合并) - P2-10: 筛选模态关闭时重搜 - P3-1: 搜索框 aria-label Batch6 — HomeView.vue - P1-10: URL date → date_from/date_to - P2-11: clearSearch 清空 feedItems 并重加载 Batch7 — LiteratureCard.vue - P1-6: 字段标签正则 [\w-]+ → [\w:-]+ - P1-7: terms 切片限制 20 项防 ReDoS 后修复: - query_expansion.py _find_partial_mesh_tags UnboundLocalError(单非中文词未初始化 tag_ids) - HomeView.vue handleAdvancedSearch precision_mode 残留引用
SciLit Oncology — 肿瘤科文献管理平台
快速启动
# 1. 启动所有服务
docker compose up -d
# 2. 初始化数据库(首次)
docker compose exec backend alembic upgrade head
# 3. 访问
# 前端: http://localhost:5173
# 后端 API: http://localhost:8000/docs
# MinIO 控制台: http://localhost:9001 (minioadmin/minioadmin)
项目结构
backend/
├── app/
│ ├── main.py # FastAPI 入口
│ ├── config.py # 配置
│ ├── db.py # 数据库连接
│ ├── core/ # 核心:安全、权限、多租户中间件
│ ├── models/ # SQLAlchemy 模型 (32 张表)
│ ├── schemas/ # Pydantic 请求/响应
│ ├── api/v1/ # REST API 端点
│ └── tasks/ # ARQ 异步任务 (PubMed 管道)
├── alembic/ # 数据库迁移
└── config/specialties/ # 科室配置 (oncology.yaml)
frontend/
├── src/
│ ├── views/public/ # 公开页面 (无需登录)
│ ├── views/auth/ # 登录/注册
│ ├── views/app/ # 已登录应用页面
│ ├── stores/ # Pinia 状态管理
│ ├── api/ # Axios 封装
│ └── router/ # Vue Router
docs/ # 完整设计文档 (9 份)
技术栈
- 后端: FastAPI + SQLAlchemy 2.0 (async) + PostgreSQL 16 + Redis + Elasticsearch
- 前端: Vue 3 + Naive UI + Pinia + Vite
- 任务队列: ARQ
- 文件存储: MinIO / S3
- 多租户: PostgreSQL RLS + ContextVar 双层隔离
文档
详细的产品规划、数据库设计、标签体系、数据管道、UI 设计见 docs/ 目录。
Languages
Python
69.4%
Vue
26.2%
TypeScript
2.8%
Shell
1.1%
PLpgSQL
0.2%
Other
0.2%