一个用于智能管理 GitHub Star(收藏)的 Web 应用,支持 AI 自动标签生成和智能搜索。
# 前端依赖
pnpm install
# 后端依赖
cd ../stars-server
go mod tidy
参考 ../stars-server/.env.example 创建 .env 文件:
# GitHub OAuth 配置
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
GITHUB_REDIRECT_URI=http://localhost:8080/api/v1/auth/callback
# 腾讯混元 API
HUNYUAN_API_KEY=your_hunyuan_api_key
# 加密密钥
SESSION_SECRET=$(openssl rand -base64 32)
ENCRYPTION_KEY=$(openssl rand -base64 32)
# 启动后端服务
cd ../stars-server
go run cmd/server/main.go
# 启动前端开发服务器(新终端)
cd ../stars-manage
pnpm dev
访问 http://localhost:3000 开始使用。
pnpm build
优点:
/api部署架构:
用户访问:https://your-domain.com
↓
前端页面:https://your-domain.com/
↓
API 请求:https://your-domain.com/api/v1/stars
↓
Nginx 代理:转发到后端服务
Nginx 配置示例:
参考 nginx.conf.example 文件,关键配置:
server {
listen 80;
server_name your-domain.com;
# 前端静态文件
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
}
# 后端 API 代理(可随时修改后端地址)
location /api {
proxy_pass http://localhost:8080;
# 或 Docker 容器:proxy_pass http://stars-server:8080;
}
}
优势:
如果前后端在不同域名,需配置 CNB Secret:
CNB Secrets:
Name: VITE_API_BASE_URL
Value: https://api.example.com
首次使用需要通过 GitHub OAuth 登录:
手动添加标签:
AI 自动标签:
模糊搜索:
AI 思考助手:
配置同步仓库:
推送数据:
stars.jsonREADME.md 文档stars-manage/
├── src/
│ ├── api/ # API 调用
│ ├── components/ # React 组件
│ ├── stores/ # 状态管理
│ ├── types/ # 类型定义
│ └── utils/ # 工具函数
├── public/ # 静态资源
└── package.json # 项目配置
详见 安全配置指南
欢迎提交 Issue 和 Pull Request!
feat: 新功能
fix: 修复 bug
docs: 文档更新
style: 代码格式调整
refactor: 重构
test: 测试相关
chore: 构建/工具链相关
Apache 2.0