Files
lhbfx/README.md

109 lines
2.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.

# lhbfx
`lhbfx` 是一个围绕 A 股龙虎榜数据构建的“顶级游资监控系统”,当前聚焦盘后分析、游资席位跟踪、关注池管理、预警提示与个股复盘。
## 项目结构
- `backend/`
- FastAPI 服务
- 龙虎榜导入、席位映射、预警生成脚本
- MySQL schema 与查询逻辑
- `frontend/`
- Vue 3 + TypeScript + Vite 单页应用
- 首页总控台、游资详情、个股详情、预警中心
- `docs/`
- 需求文档
- 技术文档
- 历史说明与 UI 草稿
## 当前核心能力
- 首页支持“关注池与操作流水”联动展示。
- 待加入关注列表支持按买卖结构着色、净额重点突出、快速加入关注。
- 关注池写入数据库,支持新增和删除。
- 个股详情支持 K 线、MA5、买卖点与预警信息展示。
- 预警中心支持卖出预警、慢流出观察等风险信息查看。
- 已明确新增“每日 17:00 自动更新 + 邮件日报 + PDF 附件”需求,待后续实现。
## 环境要求
- Python 3.11+
- Node.js 20+
- MySQL 8+
## 后端启动
1. 复制配置文件:
-`backend/config.example.yaml` 复制为 `backend/config.yaml`
- 按实际数据库连接信息修改
2. 初始化数据库:
```powershell
python backend/scripts/init_db.py
```
3. 启动 API
```powershell
python backend/scripts/run_api.py
```
默认地址:
- `http://127.0.0.1:8000`
## 前端启动
```powershell
cd frontend
npm install
npm run dev -- --host 127.0.0.1 --port 5173
```
默认地址:
- `http://127.0.0.1:5173`
## 一键开发启动
根目录提供了 `start-dev.ps1`
```powershell
powershell -ExecutionPolicy Bypass -File .\start-dev.ps1
```
脚本会同时拉起:
- 后端:`127.0.0.1:8000`
- 前端:`127.0.0.1:5173`
日志输出目录:
- `logs/`
## 常用后端接口
- `GET /api/summary`
- `GET /api/pipeline/status`
- `GET /api/traders`
- `GET /api/traders/{trader_id}`
- `GET /api/stocks/{stock_code}`
- `GET /api/actions`
- `GET /api/watchlist`
- `POST /api/watchlist`
- `DELETE /api/watchlist/{stock_code}`
- `GET /api/warnings`
## 文档索引
- 需求文档:`docs/需求文档.md`
- 技术文档:`docs/技术文档.md`
- 历史需求梳理:`docs/需求梳理-今日游资操作优先.md`
- 历史 UI 说明:`docs/UI设计说明.md`
## 仓库说明
- 仓库已补充 `.gitignore``.gitattributes`
- 本地敏感配置 `backend/config.yaml` 已忽略,不会推送
- 提交前建议使用 `backend/config.example.yaml` 作为共享配置模板