一个由 AI 驱动的周训练计划生成与打印工具,通过对话制定个性化的每周训练计划,支持编辑和打印功能,帮助你保持节奏、坚持目标。
访问网站:https://weekwise-trainingplan.vercel.app/
- 🤖 AI健身教练助手 - 使用GitHub AI生成个性化训练计划
- 📅 周训练计划 - 7天完整的训练安排
- ✏️ 可编辑内容 - 点击即可编辑训练内容、时长和备注
- ✅ 进度跟踪 - 每日完成状态标记
- 🖨️ 打印友好 - 优化的打印样式,支持A4纸张
- 🌐 中英文切换 - 一键切换界面语言,支持 English / 中文
- React 18 + TypeScript
- Vite
- Tailwind CSS
- shadcn/ui 组件库
- React Router
- Node.js + Express
- GitHub AI API
- CORS支持
npm install编辑 .env 文件,添加你的GitHub AI Token:
GITHUB_TOKEN=your_github_token_here
PORT=3001npm run dev:full# 终端1:启动后端服务器
npm run dev:server
# 终端2:启动前端开发服务器
npm run dev- 描述你的健身目标、经验水平、可用时间等信息
- AI会生成个性化的周训练计划
- 生成后点击“打印周训练计划“按钮,跳转到新的页面
- 点击任意训练内容、时长或备注区域进行编辑
- 点击标题可以修改训练计划名称
- 使用复选框标记每日完成状态
- 点击右上角的🖨️按钮或使用快捷键 Ctrl+P
- 页面已优化为A4纸张打印格式
POST /api/chat
Content-Type: application/json
{
"message": "用户消息",
"history": [聊天历史]
}
POST /api/generate-plan
Content-Type: application/json
{
"prompt": "训练计划描述"
}
GET /api/health
weekwise/
├── src/ # 前端源代码
│ ├── components/ # React组件
│ ├── pages/ # 页面组件
│ ├── lib/ # 工具库和API服务
│ └── hooks/ # 自定义Hooks
├── server/ # 后端服务器
│ └── index.js # Express服务器
├── public/ # 静态资源
└── dist/ # 构建输出
- 在
server/index.js中添加新的路由 - 在
src/lib/api.ts中添加对应的API服务方法 - 在前端组件中调用API服务
修改 server/index.js 中的 TRAINING_PLAN_PROMPT 来调整AI生成的内容格式。
npm run buildnpm run dev:server-
AI功能不工作
- 检查
.env文件中的GITHUB_TOKEN是否正确设置 - 确认网络连接正常
- 检查
-
前端无法连接后端
- 确认后端服务器在3001端口运行
- 检查Vite代理配置
-
打印样式问题
- 使用Chrome或Edge浏览器
- 确保启用了打印背景颜色选项
欢迎提交Issue和Pull Request来改进这个项目!
MIT License
- 移动端适配
- 英文训练计划生成
An AI-powered tool for generating and printing personalized weekly training plans. Through natural conversation, you can design a tailored weekly workout schedule, edit it, and print it — helping you stay consistent and reach your fitness goals.
Visit the website: https://weekwise-trainingplan.vercel.app/
- 🤖 AI Fitness Coach – Uses GitHub AI to generate personalized training plans
- 📅 Weekly Training Schedule – A complete 7-day workout routine with training tips and key strategies
- ✏️ Editable Content – Click to modify exercises, duration, and notes
- ✅ Progress Tracking – Mark your daily completion status
- 🖨️ Print-Friendly Design – Optimized layout for A4 printing
- 🌐 Bilingual Interface – One-click switch between English / 中文
- React 18 + TypeScript
- Vite
- Tailwind CSS
- shadcn/ui component library
- React Router
- Node.js + Express
- GitHub AI API
- CORS support
npm installEdit the .env file and add your GitHub AI Token:
GITHUB_TOKEN=your_github_token_here
PORT=3001
npm run dev:full# Terminal 1: Start the backend server
npm run dev:server
# Terminal 2: Start the frontend dev server
npm run devFrontend: http://localhost:8080
Backend API: http://localhost:3001
Health check: http://localhost:3001/api/health
- Describe your fitness goals, experience level, and available time.
- The AI will generate a personalized weekly plan.
- After generation, click the “Print Weekly Plan” button to open the printable view.
- Click any exercise, duration, or note to edit it directly.
- Click the title to rename the plan.
- Use checkboxes to mark daily completion.
- Click the 🖨️ button at the top right or press Ctrl+P.
- The page is optimized for A4 paper printing.
POST /api/chat
Content-Type: application/json
{
"message": "用户消息",
"history": [聊天历史]
}
POST /api/generate-plan
Content-Type: application/json
{
"prompt": "训练计划描述"
}
GET /api/health
weekwise/
├── src/ # Frontend source code
│ ├── components/ # React components
│ ├── pages/ # Page components
│ ├── lib/ # Utilities and API services
│ └── hooks/ # Custom React hooks
├── server/ # Backend server
│ └── index.js # Express server entry point
├── public/ # Static assets
└── dist/ # Build output
- Add a new route in server/index.js
- Add the corresponding API function in src/lib/api.ts
- Call the API function from your frontend component
Modify the TRAINING_PLAN_PROMPT in server/index.js to adjust how the AI structures the generated content.
npm run buildnpm run dev:server
- AI features not working
- Check whether your GITHUB_TOKEN in .env is correctly set
- Ensure your network connection is stable
- Frontend cannot connect to backend
- Make sure the backend server is running on port 3001
- Check your Vite proxy configuration
- Printing layout issues
- Use Chrome or Edge browsers
- Make sure “Print Background Colors” is enabled
Contributions are welcome! Please submit Issues or Pull Requests to help improve this project.
MIT License
- Mobile adaptation
- English-based training plan generation
