LotteryMaster

LotteryMaster

LotteryMaster - Let LLM be your lucky charm

Stars: 55

Visit
 screenshot

LotteryMaster is a tool designed to fetch lottery data, save it to Excel files, and provide analysis reports including number prediction, number recommendation, and number trends. It supports multiple platforms for access such as Web and mobile App. The tool integrates AI models like Qwen API and DeepSeek for generating analysis reports and trend analysis charts. Users can configure API parameters for controlling randomness, diversity, presence penalty, and maximum tokens. The tool also includes a frontend project based on uniapp + Vue3 + TypeScript for multi-platform applications. It provides a backend service running on Fastify with Node.js, Cheerio.js for web scraping, Pino for logging, xlsx for Excel file handling, and Jest for testing. The project is still in development and some features may not be fully implemented. The analysis reports are for reference only and do not constitute investment advice. Users are advised to use the tool responsibly and avoid addiction to gambling.

README:

LotteryMaster

✨ 主要功能 (Key Features)

  • 📊 数据处理: 抓取彩票数据,保存到Excel文件,支持抓取全部期数。
  • 🤖 输出报告: 集成通义千问大模型(Qwen-MAX)/(Qwen-Long),根据prompt生成分析报告,包括号码预测、号码推荐、号码趋势等。
  • 📱 多端访问支持: 支持Web、移动App等多平台访问,方便用户随时随地获取彩票分析信息

🔗 前端项目

  • 代码仓库:GitHub
  • 在线演示:Vercel

🛠️ 技术栈 (Tech Stack)

  • 后端开发

    • Fastify Badge Node.js Badge Cheerio.js Badge Pino Badge xlsx Badge Jest Badge
  • AI 模型

    • 通义千问 Qwen API: 阿里云大语言模型API,用于生成分析报告,趋势分析图表。
    • DeepSeek: 阿里云百炼平台提供的 DeepSeek 大语言模型,具有强大的推理和分析能力。
    • deepseek的api比较慢,页面上使用不建议设置

    API 参数说明

    .env.example 中的 API 相关参数说明:

    • API_MODEL: 选择使用的模型,可选值包括:

      • qwen-turbo
      • qwen-long
      • qwen-max
      • deepseek-v3
      • deepseek-r1
    • API_TEMPERATURE: 控制输出的随机性,取值范围 0-1

      • 值越低(如 0.1): 输出更确定、更保守,适合分析报告等需要准确性的场景
      • 值越高(如 0.7): 输出更多样化、更创新,适合创意性内容生成
      • 注意:deepseek-r1 模型不支持此参数设置
    • API_TOP_P: 控制输出的多样性,取值范围 0-1

      • 值越低:输出更加集中在高概率的词上
      • 值越高:输出更多样化
      • 推荐值:0.6
      • 注意:deepseek-r1 模型不支持此参数设置
    • API_PRESENCE_PENALTY: 控制重复内容的惩罚程度,取值范围 0-2

      • 值越高:模型更倾向于生成新的内容而不是重复已有内容
      • 推荐值:0.95
      • 注意:deepseek-r1 模型不支持此参数设置
    • API_MAX_TOKENS: 限制模型返回的最大 Token 数量

      • 较大的值允许模型生成更详细的分析结果
      • 默认值为 3000,可根据需要调整
    • API_TIMEOUT: API 请求超时时间(毫秒)

      • 默认值为 120000(2分钟)
      • deepseek-r1的超时时间可能要拉长

    更多详细参数说明请参考通义千问 API 文档

  • 前端开发

  • 测试覆盖率

  • Coverage Badge

    总体覆盖率指标

    指标 覆盖率
    Statements 91.14%
    Branches 78.97%
    Functions 90.32%
    Lines 91.3%

    说明

    • 具体的数据执行 pnpm run test:coverage 查看

🚀 快速开始 (Quick Start)

⚙️ 环境要求 (Prerequisites)

👣 步骤 (Steps)

  1. 克隆代码仓库 (Clone the repository)

    git clone https://github.com/lifefloating/LotteryMaster
    cd LotteryMaster
  2. 安装后端依赖 (Install backend dependencies)

    pnpm install
  3. 配置环境变量 (Configure environment variables)

    在项目根目录下创建 .env 文件,并根据 .env.example 文件中的示例配置以下环境变量:

    PORT=3008
    API_KEY=your_key

    其他的按需求调整配置

  4. 运行服务 (Run backend service)

     pnpm run start

    后端服务默认运行在 http://localhost:3008

  5. 运行前端项目

    前端项目请参考 LotteryMaster-UniappREADME.md 文件启动前端服务,并确保前端配置的后端API地址正确。

  6. 部署&运行 (Deployment & Running)

    Docker部署

    前提条件

    • 已安装 Docker
    • 已克隆 LotteryMaster 代码仓库

    运行步骤

    1. 使用环境变量文件运行Docker容器:
    docker run -d -p 3008:3008 --name lottery-master-app lottery-master

    更多详细的部署说明请参考:部署指南

🔗 访问API

后端服务启动后,您可以使用Postman、curl等工具访问API接口。

例如,访问健康检查接口:

curl http://localhost:3008/api/health

🖼️ 接口测试结果

以 api/analyze/dlt 为例,获取结果:

完整结果

🧪 运行测试 (Run Tests)

运行所有测试并生成覆盖率报告:

pnpm test:coverage

测试覆盖率报告将生成在 coverage 目录下。

📝 TODO

  • 考虑前端加上模型切换选项卡
  • bun 暂时先这样,后续会切换
  • 优化下 axios请求的处理,暂时不用openai

文档将在后续继续完善。


注意: 本项目仍处于开发阶段,部分功能可能尚未完善。分析报告的结果仅供参考,不构成任何投资建议。请理性对待彩票,切勿沉迷。

如果您在使用过程中遇到任何问题,或者有任何建议,欢迎提交Issue或Pull Request。

Issues Pull Requests Project Status: Beta License: MIT

For Tasks:

Click tags to check more tools for each tasks

For Jobs:

Alternative AI tools for LotteryMaster

Similar Open Source Tools

For similar tasks

For similar jobs