{"id":37598219,"url":"https://github.com/wchiways/geyago","last_synced_at":"2026-01-16T10:00:10.188Z","repository":{"id":325637609,"uuid":"1101894038","full_name":"wchiways/Geyago","owner":"wchiways","description":"现代化、全栈的智能题库系统，支持多AI提供商的问题解答和本地缓存。Python 3.13 + Flask + Vue 3 + TypeScript","archived":false,"fork":false,"pushed_at":"2025-11-23T16:11:26.000Z","size":411,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-02T23:54:50.859Z","etag":null,"topics":["ai","artificial-intelligence","chatgpt","flask","intelligent-system","python","question-bank","quiz","typescript","vue3"],"latest_commit_sha":null,"homepage":"https://toni.wang/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wchiways.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-22T12:44:51.000Z","updated_at":"2025-11-23T17:14:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/wchiways/Geyago","commit_stats":null,"previous_names":["blankzsh/geyago","wchiways/geyago"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/wchiways/Geyago","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wchiways%2FGeyago","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wchiways%2FGeyago/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wchiways%2FGeyago/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wchiways%2FGeyago/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wchiways","download_url":"https://codeload.github.com/wchiways/Geyago/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wchiways%2FGeyago/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","artificial-intelligence","chatgpt","flask","intelligent-system","python","question-bank","quiz","typescript","vue3"],"created_at":"2026-01-16T10:00:09.745Z","updated_at":"2026-01-16T10:00:10.075Z","avatar_url":"https://github.com/wchiways.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎭 Geyago智能题库\n\n[![Python](https://img.shields.io/badge/Python-3.13+-blue.svg)](https://python.org)\n[![UV](https://img.shields.io/badge/UV-Modern%20Package%20Manager-green.svg)](https://github.com/astral-sh/uv)\n[![Flask](https://img.shields.io/badge/Flask-3.0+-red.svg)](https://flask.palletsprojects.com)\n[![Vue.js](https://img.shields.io/badge/Vue.js-3.4+-green.svg)](https://vuejs.org)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.3+-blue.svg)](https://www.typescriptlang.org)\n[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\n现代化、全栈的智能题库系统，支持多AI提供商的问题解答和本地缓存。后端采用Python 3.13 + Flask + UV工具链，前端使用Vue 3 + TypeScript + Element Plus，具备完整的测试覆盖和类型注解。\n\n## ✨ 特性\n\n### 🤖 多AI服务提供商支持\n- **阿里云百炼平台** - 阿里云AI服务 (默认)\n- **智谱AI** - GLM系列大模型\n- **硅基流动** - 高性能AI服务\n- **OpenAI** - OpenAI GPT系列模型\n- **Google Gemini** - Google最新AI模型\n- **Ollama** - 本地AI模型部署支持\n\n### 💾 智能缓存与管理\n- **本地缓存**: 自动缓存AI生成的答案，提高响应速度\n- **答案历史**: 完整的查询历史记录管理\n- **智能去重**: 相同问题避免重复调用AI API\n\n### 🏗️ 全栈架构\n- **后端服务**: Python 3.13 + Flask + SQLite\n- **前端应用**: Vue 3 + TypeScript + Element Plus\n- **模块化设计**: 分层架构，易于维护和扩展\n- **API优先**: RESTful API设计，支持第三方集成\n\n### 🎨 现代化前端\n- **响应式设计**: 适配桌面和移动设备\n- **丰富组件**: Element Plus UI组件库\n- **数据可视化**: ECharts图表展示\n- **路由管理**: Vue Router单页应用\n- **状态管理**: Pinia状态管理\n\n### 🧪 开发体验\n- **完整测试**: 单元测试和集成测试覆盖\n- **类型安全**: Python类型注解 + TypeScript\n- **代码质量**: Black格式化、ESLint、Prettier\n- **现代工具链**: UV包管理、Vite构建\n- **开发工具**: pre-commit钩子、自动化检查\n\n## 🚀 快速开始\n\n### 环境要求\n\n**后端环境:**\n- Python 3.13+\n- UV包管理器 ([安装指南](https://github.com/astral-sh/uv))\n\n**前端环境:**\n- Node.js 18+\n- npm 或 yarn 包管理器\n\n### 安装和运行\n\n```bash\n# 1. 克隆项目\ngit clone https://github.com/blankzsh/Geyago.git\ncd Geyago\n\n# 2. 后端设置\nuv sync --dev\n\n# 3. 前端设置\ncd frontend\nnpm install\n\n# 4. 环境配置\n# 复制并编辑配置文件\ncp config.example.json config.json\n# 编辑 config.json 文件，设置你的API密钥\n\n# 5. 启动服务\n# 后端服务 (终端1)\nmake run\n# 或者\nuv run python -m geyago.main\n\n# 前端服务 (终端2)\ncd frontend\nnpm run dev\n```\n\n### 🌐 访问应用\n\n- **前端界面**: http://localhost:5173\n- **后端API**: http://localhost:5000\n- **API文档**: http://localhost:5000/api/config\n\n### 配置\n\n在 `config.json` 文件中设置以下配置：\n\n```json\n{\n  \"server\": {\n    \"host\": \"0.0.0.0\",\n    \"port\": 5000,\n    \"debug\": false\n  },\n  \"database\": {\n    \"url\": \"sqlite:///question_bank.db\"\n  },\n  \"app\": {\n    \"name\": \"Geyago智能题库\",\n    \"default_ai\": \"ali\"\n  },\n  \"ai_providers\": {\n    \"ali\": {\n      \"name\": \"阿里百炼平台\",\n      \"enabled\": true,\n      \"api_key\": \"your-ali-dashscope-api-key-here\"\n    }\n  }\n}\n```\n\n详细的配置选项请参考 `config.example.json` 文件。\n\n### 🔑 获取API密钥\n\n**支持的AI服务提供商:**\n\n1. **阿里云百炼平台** (默认)\n   - [官网](https://dashscope.aliyun.com/)\n   - 支持通义千问系列模型\n\n2. **智谱AI**\n   - [官网](https://open.bigmodel.cn/)\n   - 支持GLM-4系列模型\n\n3. **硅基流动**\n   - [注册链接](https://cloud.siliconflow.cn/)\n\n4. **OpenAI**\n   - [官网](https://platform.openai.com/)\n   - 支持GPT-3.5、GPT-4等模型\n\n5. **Google Gemini**\n   - [官网](https://ai.google.dev/)\n   - 支持Gemini Pro等模型\n\n6. **Ollama (本地)**\n   - [官网](https://ollama.ai/)\n   - 本地部署，无需API密钥\n\n## 📋 API接口\n\n### 查询问题答案\n\n```http\nGET /api/query?title=问题文本\u0026options=选项\u0026type=类型\n```\n\n### 获取API配置信息\n\n```http\nGET /api/config\n```\n\n### 健康检查\n\n```http\nGET /api/health\n```\n\n### 题库统计\n\n```http\nGET /api/stats\n```\n\n### 搜索问题\n\n```http\nGET /api/search?q=关键词\u0026limit=10\n```\n\n### 最近问题\n\n```http\nGET /api/recent?limit=10\n```\n\n## 🛠️ 开发指南\n\n### 项目结构\n\n```\ngeyago/\n├── 📁 src/geyago/           # 后端源代码\n│   ├── 📁 api/             # API路由和数据模式\n│   │   ├── 📁 routes/      # API路由定义\n│   │   └── 📁 schemas/     # 数据验证模式\n│   ├── 📁 config/          # 配置管理\n│   ├── 📁 core/            # 核心功能（数据库、异常）\n│   ├── 📁 models/          # 数据模型\n│   ├── 📁 services/        # 业务逻辑服务\n│   │   └── 📁 ai_providers/ # AI服务提供商\n│   └── 📁 utils/           # 工具函数\n├── 📁 frontend/            # 前端应用\n│   ├── 📁 src/             # Vue源代码\n│   │   ├── 📁 components/  # Vue组件\n│   │   ├── 📁 views/       # 页面视图\n│   │   ├── 📁 stores/      # Pinia状态管理\n│   │   └── 📁 utils/       # 前端工具\n│   ├── 📄 package.json     # 前端依赖配置\n│   └── 📄 vite.config.ts   # Vite构建配置\n├── 📁 tests/               # 测试代码\n├── 📄 pyproject.toml       # Python项目配置\n├── 📄 Makefile           # 开发命令快捷方式\n├── 📄 config.example.json # 配置文件模板\n└── 📄 README.md          # 项目文档\n```\n\n### 开发命令\n\n#### 后端开发 (Python)\n\n```bash\n# 安装开发环境\nmake dev\n\n# 运行后端服务\nmake run\n\n# 后端测试\nmake test\nmake test-cov\n\n# 代码质量检查\nmake lint\n\n# 代码格式化\nmake format\n\n# 数据库管理\nmake init-db\nmake backup-db\n\n# 构建后端项目\nmake build\n```\n\n#### 前端开发 (Vue.js)\n\n```bash\ncd frontend\n\n# 安装依赖\nnpm install\n\n# 启动开发服务器\nnpm run dev\n\n# 构建生产版本\nnpm run build\n\n# 预览生产构建\nnpm run preview\n\n# 代码检查和格式化\nnpm run lint\nnpm run format\n```\n\n#### 全栈开发\n\n```bash\n# 并发启动前后端 (需要两个终端)\n# 终端1: 启动后端\nmake run\n\n# 终端2: 启动前端\ncd frontend \u0026\u0026 npm run dev\n```\n\n### 测试\n\n#### 后端测试\n\n```bash\n# 运行所有后端测试\nuv run pytest\n\n# 运行特定测试文件\nuv run pytest tests/test_api.py\n\n# 生成覆盖率报告\nuv run pytest --cov=src/geyago --cov-report=html\n\n# 运行带标记的测试\nuv run pytest -m unit      # 单元测试\nuv run pytest -m integration # 集成测试\n```\n\n#### 前端测试\n\n```bash\ncd frontend\n\n# 运行单元测试 (如果配置了)\nnpm run test\n\n# 运行端到端测试 (如果配置了)\nnpm run test:e2e\n```\n\n#### 测试覆盖率\n\n- **后端覆盖率报告**: `htmlcov/index.html`\n- **前端覆盖率报告**: `coverage/lcov-report/index.html` (如果配置)\n\n## 🏗️ 架构设计\n\n### 后端架构 (Python + Flask)\n\n本项目采用分层架构：\n\n```\n┌─────────────────┐\n│   API 路由层     │ ← HTTP请求处理、参数验证\n├─────────────────┤\n│   业务服务层     │ ← AI服务、业务逻辑\n├─────────────────┤\n│   数据访问层     │ ← 数据库操作、模型映射\n├─────────────────┤\n│   核心基础层     │ ← 配置管理、异常处理\n└─────────────────┘\n```\n\n- **API路由层**: 处理HTTP请求和响应，数据验证\n- **业务服务层**: AI服务集成、业务逻辑处理\n- **数据访问层**: 数据模型定义、数据库操作\n- **核心基础层**: 配置管理、异常处理、工具函数\n\n### 前端架构 (Vue 3 + TypeScript)\n\n```\n┌─────────────────┐\n│   视图层 (Views) │ ← 页面组件、路由管理\n├─────────────────┤\n│   组件层 (Comps) │ ← 可复用UI组件\n├─────────────────┤\n│  状态管理 (Store)│ ← Pinia状态管理\n├─────────────────┤\n│   服务层 (API)   │ ← HTTP请求、数据获取\n└─────────────────┘\n```\n\n- **视图层**: 页面组件，使用Vue Router管理路由\n- **组件层**: 可复用的UI组件，基于Element Plus\n- **状态管理**: 使用Pinia进行全局状态管理\n- **服务层**: API请求封装，与后端通信\n\n### AI服务架构\n\n```\n┌─────────────────┐\n│  AI服务管理器    │ ← 统一接口、提供商切换\n├─────────────────┤\n│  提供商工厂      │ ← 动态创建AI服务实例\n├─────────────────┤\n│  AI提供商实现    │ ← 各种AI服务适配器\n│  - SiliconFlow   │\n│  - OpenAI        │\n│  - Gemini        │\n│  - 百度文心      │\n│  - 阿里通义      │\n│  - Ollama        │\n└─────────────────┘\n```\n\n## 🔧 技术栈\n\n### 后端技术栈\n- **Web框架**: Flask 3.0+\n- **包管理器**: UV (现代Python包管理)\n- **数据库**: SQLite (可扩展到PostgreSQL/MySQL)\n- **ORM**: SQLAlchemy (通过Flask扩展)\n- **数据验证**: Pydantic + Pydantic Settings\n- **类型检查**: mypy\n- **测试框架**: pytest + pytest-cov\n- **代码格式化**: Black + isort\n- **代码质量**: flake8 + pre-commit hooks\n- **HTTP客户端**: requests\n- **CORS支持**: Flask-CORS\n- **依赖管理**: pyproject.toml\n\n### 前端技术栈\n- **框架**: Vue 3.4+ (Composition API)\n- **语言**: TypeScript 5.3+\n- **构建工具**: Vite 5.0+\n- **UI组件库**: Element Plus 2.4+\n- **路由管理**: Vue Router 4.2+\n- **状态管理**: Pinia 2.1+\n- **HTTP客户端**: Axios 1.6+\n- **图表库**: ECharts 5.4+ + vue-echarts 6.6+\n- **图标库**: @element-plus/icons-vue\n- **代码规范**: ESLint + Prettier\n- **包管理**: npm\n\n### AI服务集成\n- **阿里云百炼平台** (默认) - 阿里云AI服务\n- **智谱AI** - GLM系列大模型\n- **硅基流动** - 高性能AI服务\n- **OpenAI** - OpenAI GPT系列模型\n- **Google Gemini** - Google最新AI模型\n- **Ollama** - 本地AI模型部署\n\n### 开发工具\n- **版本控制**: Git + pre-commit hooks\n- **容器化**: Docker (可选)\n- **文档**: Markdown + 自动化文档生成\n\n## 📦 部署\n\n### Docker部署\n\n```bash\n# 构建后端镜像\nmake docker-build\n\n# 运行后端容器\nmake docker-run\n\n# 或者使用docker-compose (推荐)\ndocker-compose up -d\n```\n\n### 全栈部署\n\n#### 后端部署\n\n```bash\n# 安装生产依赖\nuv sync --frozen\n\n# 设置生产环境变量\nexport DEBUG=false\nexport HOST=0.0.0.0\nexport PORT=5000\nexport AI_PROVIDER=siliconflow\nexport API_KEY=your_production_api_key\n\n# 启动后端服务\nuv run python -m geyago\n# 或使用生产WSGI服务器 (如gunicorn)\npip install gunicorn\ngunicorn -w 4 -b 0.0.0.0:5000 \"geyago:create_app()\"\n```\n\n#### 前端部署\n\n```bash\ncd frontend\n\n# 构建生产版本\nnpm run build\n\n# 部署到Web服务器 (如nginx)\n# 将 dist/ 目录内容复制到Web服务器根目录\n```\n\n#### 生产环境配置\n\n**Nginx配置示例:**\n```nginx\nserver {\n    listen 80;\n    server_name your-domain.com;\n\n    # 前端静态文件\n    location / {\n        root /path/to/frontend/dist;\n        try_files $uri $uri/ /index.html;\n    }\n\n    # 后端API代理\n    location /api/ {\n        proxy_pass http://localhost:5000;\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n    }\n}\n```\n\n### 云平台部署\n\n- **后端**: 可部署到Heroku、Railway、Render等支持Python的平台\n- **前端**: 可部署到Vercel、Netlify、GitHub Pages等静态托管平台\n- **数据库**: SQLite适合小规模，生产环境建议使用PostgreSQL或MySQL\n\n## 🤝 贡献指南\n\n1. Fork 项目\n2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)\n3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)\n4. 推送到分支 (`git push origin feature/AmazingFeature`)\n5. 打开 Pull Request\n\n## 📄 许可证\n\n本项目采用 MIT 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情。\n\n## 🙏 致谢\n\n- [UV](https://github.com/astral-sh/uv) - 现代Python包管理器\n- [Flask](https://flask.palletsprojects.com) - Web框架\n\n## 📞 联系方式\n\n如有问题或建议，请通过以下方式联系：\n\n- 提交 [Issue](https://github.com/blankzsh/geyago/issues)\n- 发送邮件到 wchiway@163.com\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003cp\u003e用 💖 和 ☕ 制作\u003c/p\u003e\n  \u003cp\u003e© 2024 Geyago Project\u003c/p\u003e\n\u003c/div\u003e\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwchiways%2Fgeyago","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwchiways%2Fgeyago","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwchiways%2Fgeyago/lists"}