# github-star-monkey **Repository Path**: zjtx2016/github-star-monkey ## Basic Information - **Project Name**: github-star-monkey - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: 260227-feat-implement-github-articles-generator - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-02-27 - **Last Updated**: 2026-02-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # GitHub Hot Articles Generator 自动从 GitHub 获取热门项目并生成微信公众号文章的工具。 ## 功能特性 - 每日自动获取 GitHub Trending 热门项目 - 支持 AI 自动生成文章(支持 HuggingFace、Groq、Together AI) - 文章编辑和预览功能 - 导出为微信公众号发布格式 - 历史文章管理 ## 技术栈 - **后端**: FastAPI + SQLAlchemy + SQLite - **前端**: React + TypeScript + Vite - **AI 服务**: HuggingFace/Groq/Together AI ## 快速开始 ### 环境要求 - Python 3.11+ - Node.js 18+ - AI 服务 API Key(可选,推荐使用 HuggingFace) ### 后端设置 1. 安装依赖: ```bash cd backend pip install --break-system-packages -r requirements.txt ``` 2. 配置环境变量: ```bash cp .env.example .env ``` 编辑 `.env` 文件,配置 AI 服务的 API Key: ``` AI_PROVIDER=huggingface AI_API_KEY=your_api_key_here AI_MODEL=mistralai/Mistral-7B-Instruct-v0.2 ``` 3. 启动后端服务: ```bash python3 main.py ``` 后端将在 `http://localhost:3000` 启动。 ### 前端设置 1. 安装依赖: ```bash cd frontend npm install ``` 2. 启动前端服务: ```bash npm run dev ``` 前端将在 `http://localhost:5173` 启动。 ## 使用说明 1. 访问 `http://localhost:5173` 2. 查看热门项目列表 3. 选择一个项目 4. 点击"生成文章" 5. 等待 AI 生成完成 6. 编辑和导出文章 ## AI 服务配置 ### HuggingFace(推荐,免费) 1. 访问 https://huggingface.co/join 注册账号 2. 获取 API Token: https://huggingface.co/settings/tokens 3. 在 `.env` 文件中配置: ``` AI_PROVIDER=huggingface AI_API_KEY=hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx AI_MODEL=mistralai/Mistral-7B-Instruct-v0.2 ``` ### Groq(免费试用) 1. 访问 https://console.groq.com/ 注册账号 2. 获取 API Key 3. 在 `.env` 文件中配置: ``` AI_PROVIDER=groq AI_API_KEY=gsk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx AI_MODEL=llama3-70b-8192 ``` ### Together AI(免费额度) 1. 访问 https://together.ai/ 注册账号 2. 获取 API Key 3. 在 `.env` 文件中配置: ``` AI_PROVIDER=together AI_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx AI_MODEL=mistralai/Mixtral-8x7B-Instruct-v0.1 ``` ## API 文档 启动后端服务后,访问 `http://localhost:3000/docs` 查看 Swagger API 文档。 ## 项目结构 ``` . ├── backend/ │ ├── main.py # FastAPI 主应用 │ ├── config.py # 配置管理 │ ├── database.py # 数据库模型 │ ├── schemas.py # Pydantic 模型 │ ├── github_service.py # GitHub 服务 │ ├── ai_service.py # AI 服务 │ ├── article_formatter.py # 文章格式化 │ └── requirements.txt # Python 依赖 ├── frontend/ │ ├── src/ │ │ ├── App.tsx # 主应用组件 │ │ ├── api.ts # API 客户端 │ │ ├── types.ts # TypeScript 类型 │ │ └── App.css # 样式文件 │ ├── package.json # Node.js 依赖 │ └── vite.config.ts # Vite 配置 └── README.md ``` ## 注意事项 1. 确保 AI 服务 API Key 配置正确,否则无法生成文章 2. GitHub Trending 数据会缓存 5 分钟 3. 数据库文件位于 `backend/data/articles.db` 4. 建议定期清理历史文章以释放空间 ## 许可证 MIT License