GitHub 热门项目周报系统 / GitHub Trending Weekly Report Generator
A full-stack web application that automatically collects and displays trending GitHub repositories weekly. Built with FastAPI, React, and SQLite.
- Automatic Collection: Scheduled weekly GitHub trending repositories collection
- Dashboard: Interactive web UI with charts and statistics
- Project Details: Detailed view with README preview and star history
- Search & Filter: Search projects by name, language, or topic
- Watch List: Track specific projects of interest
- Trend Prediction: AI-powered star growth prediction
- Export: Download reports in Markdown format
- REST API: Programmatic access to all data
- Docker Support: One-click deployment with Docker Compose
| Layer | Technology |
|---|---|
| Frontend | React 18 + TypeScript |
| UI Library | Ant Design 5 |
| Charts | ECharts 5 |
| Backend | FastAPI (Python 3.11) |
| Database | SQLite |
| Deployment | Docker + Nginx |
- Python 3.9+
- Node.js 18+
- GitHub Personal Access Token
git clone https://github.com/suriyel/github-trends-weekly.git
cd github-trends-weeklycd backend
# Create virtual environment
python -m venv .venv
# Activate (Linux/macOS)
source .venv/bin/activate
# Activate (Windows)
.venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Copy environment template
cp .env.example .env
# Edit .env and add your GitHub Token
# GITHUB_TOKEN=your_github_token_herecd backend
uvicorn app.main:app --reloadThe API will be available at http://localhost:8000
cd frontend
npm install
npm run devThe app will be available at http://localhost:5173
Open http://localhost:5173 in your browser. Click "Refresh" to trigger data collection.
- Docker 24+
- Docker Compose
# Clone and navigate to project
git clone https://github.com/suriyel/github-trends-weekly.git
cd github-trends-weekly
# Create .env file
cp .env.example .env
# Edit .env with your GitHub Token
# Start containers
docker-compose up -d
# Access the application
# Frontend: http://localhost
# Backend API: http://localhost:8000
# API Docs: http://localhost:8000/docsdocker-compose down| Variable | Required | Description |
|---|---|---|
GITHUB_TOKEN |
Yes | GitHub Personal Access Token |
WEBHOOK_URL |
No | Notification webhook URL |
API_ACCESS_TOKEN |
No | API protection token |
See Configuration Reference for full configuration options.
Once the backend is running, visit:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/reports | List all reports |
| GET | /api/projects | List projects with filters |
| POST | /api/collect | Trigger data collection |
| GET | /api/stats/languages | Language statistics |
| GET | /api/stats/trends | Weekly trends |
# Run tests
cd backend
pytest
# Run with coverage
pytest --cov=app --cov-branch --cov-report=term-missing
# Run mutation tests
mutmut runMIT License
- 自动采集: 定时收集 GitHub 热门项目
- 仪表盘: 交互式 Web UI,含图表和统计
- 项目详情: 完整信息展示,含 README 预览和 star 历史
- 搜索筛选: 按名称、语言、主题搜索项目
- 关注列表: 跟踪感兴趣的项目
- 趋势预测: AI 驱动的 star 增长预测
- 导出功能: 支持 Markdown 格式导出
- REST API: 提供完整的编程接口
- Docker 支持: 一键 Docker 部署
| 层级 | 技术 |
|---|---|
| 前端 | React 18 + TypeScript |
| UI 库 | Ant Design 5 |
| 图表 | ECharts 5 |
| 后端 | FastAPI (Python 3.11) |
| 数据库 | SQLite |
| 部署 | Docker + Nginx |
- Python 3.9+
- Node.js 18+
- GitHub Personal Access Token
git clone https://github.com/suriyel/github-trends-weekly.git
cd github-trends-weeklycd backend
# 创建虚拟环境
python -m venv .venv
# 激活 (Linux/macOS)
source .venv/bin/activate
# 激活 (Windows)
.venv\Scripts\activate
# 安装依赖
pip install -r requirements.txt
# 复制环境变量模板
copy .env.example .env
# 编辑 .env,添加 GitHub Token
# GITHUB_TOKEN=your_github_token_herecd backend
uvicorn app.main:app --reloadAPI 地址: http://localhost:8000
cd frontend
npm install
npm run dev应用地址: http://localhost:5173
在浏览器中打开 http://5173,点击"刷新"按钮触发数据采集。
- Docker 24+
- Docker Compose
# 克隆并进入项目目录
git clone https://github.com/suriyel/github-trends-weekly.git
cd github-trends-weekly
# 创建 .env 文件
cp .env.example .env
# 编辑 .env,添加 GitHub Token
# 启动容器
docker-compose up -d
# 访问应用
# 前端: http://localhost
# 后端 API: http://localhost:8000
# API 文档: http://localhost:8000/docsdocker-compose down| 变量 | 必填 | 说明 |
|---|---|---|
GITHUB_TOKEN |
是 | GitHub Personal Access Token |
WEBHOOK_URL |
否 | 通知 Webhook URL |
API_ACCESS_TOKEN |
否 | API 保护令牌 |
详见 配置参考。
后端启动后访问:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
| 方法 | 端点 | 说明 |
|---|---|---|
| GET | /api/reports | 获取报告列表 |
| GET | /api/projects | 获取项目列表(支持筛选) |
| POST | /api/collect | 触发数据采集 |
| GET | /api/stats/languages | 语言统计 |
| GET | /api/stats/trends | 周趋势 |
# 运行测试
cd backend
pytest
# 运行覆盖率
pytest --cov=app --cov-branch --cov-report=term-missing
# 变异测试
mutmut runMIT License
