Files
PastpaperMaster/backend/BATCH_IMPORT_GUIDE.md
Zhao 83c16109f0 docs: simplify handoff guide
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 23:20:57 +09:00

54 lines
1.5 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.
# 批量导入试卷 — 交接文档
## 凭据
所有 API key 在项目根目录 `.env` 文件中。
费用监控:
- **DeepSeek**(会花钱): https://platform.deepseek.com → Usage
- **Gemini**(免费额度): https://aistudio.google.com → API keys
- **Supabase**: 找 soda 要登录
- **Gitea**: https://git.deepknow.site — 用户名 `soda`,密码 `Jermaine0805`
## 试卷来源
PeterGao 爬虫: `pastpaper-scraper/` 目录,详见 `pastpaper-scraper/README.md`
需要 HKUST 学生 ITSC 账号配合下载,找 soda 协调。
## 批量导入
脚本: `backend/batch_import.py`
```bash
cd backend/
source .venv/bin/activate
# 试运行
python batch_import.py /path/to/papers/ --batch --dry-run
# 正式导入
python batch_import.py /path/to/papers/ --batch
```
目录结构: `课程代码/year_term_examtype.pdf`,答案文件加 `_answer` 后缀自动匹配。
## 服务器
- SSH: `ssh -i ~/.ssh/id_ed25519 root@129.226.210.66`
- 后端: `/opt/pastpaper/`,容器 `pastpaper-backend-1`
- 前端: `/opt/1panel/www/pastpaper/`
## 相关文件
| 文件 | 说明 |
|------|------|
| `.env` | 所有 API 凭据 |
| `backend/batch_import.py` | 批量导入脚本 |
| `backend/app/services/paper_processor.py` | 处理管线核心Vision 提取 + AI trio |
| `backend/app/services/grader.py` | 判卷 + variant 生成 |
| `backend/app/routers/papers.py` | 上传 API |
| `pastpaper-scraper/README.md` | 爬虫使用说明 |
| `pastpaper-scraper/batch_download.py` | 爬虫主脚本 |
| `docker-compose.yml` | 后端部署配置 |