KeyMacro.fit
Red screens are for traffic lights, not nutrition — so I built a plan that forgives a normal day and still gets you where you're going.
An AI nutrition and training partner that turns goals into a personalized meal plan, logs meals from a photo, coaches through the week, and trains in the same app you eat in — designed and built solo, from database to App Store and Google Play.
The problem
Most nutrition apps punish you for being human — gram-by-gram panic, red numbers, streaks that break on a normal Tuesday. Training lives in a different app, coaching is a guilt trip, and photo logging either doesn't exist or dumps unverified macros into your day.
KeyMacro started as the product I wanted to use: stay in a forgiving Green Zone, snap a plate instead of typing, get a coach that rebalances the week instead of lecturing, and train where you eat.
The approach
One codebase, three surfaces: an installable PWA at app.keymacro.fit, plus native iOS and Android via Capacitor — same product, store-ready. Marketing lives on keymacro.fit from the same monorepo.
- Server-side AI only. OpenAI for meal planning, vision food logging, and Coach Key — routed through Supabase Edge Functions. Zero client-exposed API keys. Free vs Strategist rate limits enforced on the server.
- Dual billing that can't be gamed. Stripe on web, RevenueCat for App Store / Play IAP. Webhooks reconcile entitlement; a Postgres trigger blocks clients from writing their own
subscription_statusor referral stamps. - Native where it matters. HealthKit / Health Connect, home-screen widgets (WidgetKit + Android), Face ID / biometric lock, push, camera / barcode — not a thin web wrapper pretending to be an app.
- Freemium that still feels complete. Daily Driver (free) covers Green Zone, Snap, Workout basics, and Consistency Score. The Strategist unlocks Coach Key, SmartFit macro shifts, unlimited scans, and deeper Learn content — without gutting the free tier into a demo.
What's actually running
- Green Zone — hit 90–110% of target and you're golden. No gram-by-gram panic.
- Smarter Snap — plate photo → editable foods and macros before you log. Barcode and label scanning too.
- Coach Key — chat coaching that rebalances the week; photo check-ins; persistent memory. Strategist tier.
- Workout + SmartFit — train in the same app; Strategist SmartFit shifts carb/protein targets for the day's session.
- Consistency Score — daily 0–100 on habits that move the needle, not a streak you break with one off day.
- KeyMacro Learn — 15 lessons across 3 tiers, freemium gating, learning paths, trophy system tied to progress.
- Creator partner program — signed referral attribution, idempotent commission ledger from Stripe + RevenueCat webhooks (including refund reversal), token-authenticated partner earnings dashboard with no account login required.
- Async meal-plan jobs — start → process → poll status, then hydrate recipe IDs client-side so long generations don't hang the UI.
The numbers
Counted from the live repo — not rounded up for effect. React + TypeScript PWA, Capacitor 8 native shells, Supabase (Postgres, Auth, RLS, Edge Functions), Stripe + RevenueCat, OpenAI server-side.
Production Lighthouse (mobile): 98 Performance, 100 Accessibility, 100 Best Practices, 100 SEO.
The hardest part
Keeping web and native billing honest at the same time. Stripe owns checkout on the web; RevenueCat owns App Store and Play. Both fire webhooks into the same entitlement story on the profile — restores, refunds, and plan changes included — while a database privilege guard makes sure a client can never write itself to Pro or stamp its own referral.
Get that wrong and you either leak paid features or lock out people who already paid. The fix wasn't a clever UI — it was webhook idempotency, a sync path for restores, and treating subscription state as server-owned, period.
Close second: routing all AI through Edge Functions with Free/Strategist limits and zero keys in the browser, while still feeling instant for Snap and Coach Key.
Where it stands
Live on the web, App Store, and Google Play. Free tier and Strategist subscriptions shipping. Partner program and Learn hub in production. Still iterating — same solo pipeline from schema to store submission.
If you're evaluating this for your own project
This is what end-to-end product ownership looks like when one person ships it: mobile + web, AI features with keys that never touch the client, dual-store billing that doesn't trust the device, and native integrations that make it feel like a real app. If you need a nutrition product, a Capacitor app, or a SaaS that has to survive App Store review and Stripe webhooks — let's talk.