跪拜 Guibai
← All articles
Frontend · JavaScript · GitHub

A Solo Dev's WeChat Mini-Program Unifies Training Logs, Diet, and Body Data

By 独立开阀者_FwtCoder ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Fitness tracking on WeChat is dominated by step counters and generic health dashboards. A mini-program that ties structured strength programming, nutrition, and body metrics into one workflow fills a gap for lifters inside China's dominant messaging platform, and the cloud-backed architecture means it works across devices without a separate app install.

Summary

Built by an independent developer scratching their own itch, 智形健身助手 brings together training plans, session logging, a monthly calendar view, and diet plus body-data tracking inside a WeChat mini-program. It supports both structured split routines and ad-hoc free training, and it references past performance to reduce repetitive data entry during workouts. A calendar distinguishes planned rest days from missed sessions so users aren't pushed to train every day just to maintain a streak.

The tool also estimates calorie and macro intake from logged meals, records weight, body fat, muscle mass, and circumference measurements, and offers AI-generated training suggestions that preview before applying. Challenges and badges provide light feedback without turning fitness into a gamified check-in.

Under the hood, the project runs on uni-app, Vue 3, and Pinia, with uniCloud handling data sync and AI calls through cloud functions so records survive device switches and API keys stay off the client. The developer frames this as a progress share rather than a finished product, openly noting rough edges in diet estimation accuracy, AI suggestion stability, and cross-device layout details.

Takeaways
Training plans can be pre-defined split routines or free-form sessions built on the fly.
Session logging records weight, reps, rest time, and duration per exercise, and pulls in recent history for the same movement to cut down on manual entry.
A monthly calendar view separates planned rest days from genuinely missed workouts, so recovery days don't break a streak.
Diet logging estimates calories and macros from food items and portion sizes.
Body data tracking covers weight, body fat percentage, muscle mass, and circumference measurements over time.
AI-generated training suggestions produce plan drafts that preview before applying, and the developer is tuning them to lean more on actual training history than on brief text prompts.
Challenges and badges update monthly goals and streaks, but the intent is retrospective feedback, not gamification.
The stack is uni-app + Vue 3 + Pinia targeting WeChat mini-programs, with uniCloud cloud functions handling auth, exercise library, and AI calls.
Conclusions

Rest-day handling is a deliberate design choice that pushes against the streak-obsession common in fitness apps; treating planned recovery as part of the rhythm rather than a failure to log in acknowledges how strength programming actually works.

The AI suggestion feature's preview-and-confirm flow is a pragmatic safety rail: generated plans don't overwrite existing schedules automatically, which matters when the suggestions are still being tuned for stability.

Offloading AI calls to cloud functions solves two problems at once — it keeps API keys off the client and makes the feature available even on lower-powered devices inside WeChat's runtime constraints.

Concepts & terms
uni-app
A cross-platform frontend framework that compiles a single Vue.js codebase into multiple mini-program platforms (WeChat, Alipay, Baidu, etc.) as well as iOS and Android apps.
uniCloud
A serverless cloud platform tightly integrated with uni-app, providing cloud functions, database, and storage without managing separate backend infrastructure.
Pinia
The officially recommended state management library for Vue 3, replacing Vuex with a simpler, TypeScript-friendly API.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗