Gamified Fitness Challenge App
A gamified fitness platform with ML-powered exercise detection — users compete in real-money challenges, the mobile app detects exercises and counts reps using on-device pose estimation, and real-time leaderboards track rankings with Redis.
Category
SaaS Products
Year
2026
Status
Development
The Problem
Most fitness apps track what users claim they did. There is no verification. A user can log 50 push-ups without doing a single one. This kills the integrity of any competitive or reward-based system — if you are paying out real money to winners, you need proof that exercises were actually performed correctly.
Beyond verification, fitness apps struggle with retention. Users download the app, use it for a week, and abandon it. The missing ingredient is stakes. When there is money on the line — a participation fee and a real cash prize pool — people show up consistently. But adding money means you need airtight exercise verification, fair leaderboards, wallet management, and fraud prevention.
FitChallenge was built to solve both problems: ML-powered exercise detection that verifies every rep, combined with real-money competitive challenges that keep users coming back.
What I Built
A complete fitness challenge platform with a Flutter mobile app (Android + iOS), an admin portal, ML-based exercise detection, real-time leaderboards, and a wallet system with real-money payouts.
ML-Powered Exercise Detection:
- On-device pose estimation using TensorFlow Lite — the phone camera tracks 33 body landmarks in real-time
- Exercise classification model trained on multiple exercises: push-ups, squats, lunges, burpees, jumping jacks, planks, sit-ups, mountain climbers, and more
- Rep counting — the model detects the start and end of each repetition by tracking joint angles through the movement cycle (e.g., push-up = elbow angle goes from >160° to <90° and back)
- Form validation — the model checks whether the exercise is being performed correctly. A push-up with sagging hips or incomplete range of motion does not count. Users get real-time on-screen feedback: “Go lower”, “Keep your back straight”, “Full extension”
- Anti-cheat measures — the model checks for consistent body presence in frame, detects if the phone is being shaken to fake movement, and flags suspicious patterns (50 push-ups in 30 seconds)
- All detection runs on-device — no video uploaded to servers, preserving user privacy. Only the verified rep count and exercise metadata are sent to the backend
Exercise Library (Admin-Managed):
- Admin portal where exercises are added and configured: exercise name, target muscle groups, difficulty rating, detection parameters (joint angles, movement thresholds, minimum hold times for isometric exercises)
- Each exercise has a reference video demonstrating correct form
- Admin can tune detection sensitivity per exercise — stricter for competitive challenges, more lenient for casual/practice mode
- Exercise categorization — strength, cardio, flexibility, HIIT — used for challenge creation and recommendation
Challenge System:
- Practice Challenges (Free) — No entry fee, no prize. Users practice exercises, test the detection, and get comfortable with the system. Leaderboard is visible but no money involved. Designed for onboarding and retention between paid challenges.
- Real Challenges (Paid) — Users pay a participation fee from their wallet to enter. Admin defines the prize structure: winner-takes-all, top 3 split, top 10% share the pool, or fixed prizes. The platform takes a percentage as commission.
- Admin creates challenges with: exercise type (or multi-exercise circuit), duration (24 hours, 3 days, 1 week), entry fee, prize pool structure, max participants, and start/end times
- Challenge formats — max reps in a time window, first to reach a target count, daily consistency (complete X reps every day for 7 days), or circuit challenges (combination of exercises)
- Challenge lifecycle: Upcoming → Registration Open → In Progress → Completed → Prizes Distributed
- Users see active and upcoming challenges on the home screen with entry fee, current prize pool, participant count, and time remaining
Real-Time Leaderboard:
- Redis sorted sets power the leaderboard — every verified rep triggers a score update that reflects instantly across all participants
- Leaderboard shows rank, username, avatar, rep count, and time of last activity
- Live updates — users watching the leaderboard see positions change in real-time during active challenges
- Tie-breaking rules: if two users have the same rep count, the one who reached it first wins
- Historical leaderboards preserved after challenge completion — users can view past challenge results and their ranking history
- Global leaderboard across all challenges (lifetime stats) and per-challenge leaderboards
Wallet & Payments:
- In-app wallet with coin balance — users recharge with real money via payment gateway (Razorpay — UPI, cards, net banking, wallets)
- Coin-based economy — users buy coins, spend coins to enter challenges, win coins as prizes
- Coin-to-cash withdrawal — winners can withdraw coins back to their bank account or UPI
- Transaction history — every recharge, entry fee deduction, prize credit, and withdrawal is logged with timestamp and reference
- Admin sets coin-to-INR conversion rate, minimum recharge amount, minimum withdrawal threshold, and platform commission percentage
- Fraud prevention — withdrawal cooldowns, velocity checks (too many small recharges), and manual review for large withdrawals
Mobile App (Flutter):
- Single codebase for Android and iOS via Flutter
- Home screen with active challenges, upcoming challenges, and quick-start practice mode
- Camera-based exercise detection screen with real-time pose overlay, rep counter, form feedback, and timer
- Challenge detail screen — rules, prize structure, current leaderboard, join button
- Profile with lifetime stats: total reps, challenges won, earnings, exercise breakdown
- Wallet screen with balance, recharge, withdrawal, and transaction history
- Push notifications for challenge start/end reminders, prize announcements, and leaderboard position changes
- Offline support — practice mode works without internet, syncs when connectivity returns
Admin Portal:
- Web-based admin dashboard (React)
- Exercise management — add/edit exercises, upload reference videos, configure detection parameters
- Challenge management — create challenges, set fees and prizes, monitor participation, and trigger prize distribution
- User management — view user profiles, wallet balances, challenge history, and flag suspicious accounts
- Financial dashboard — total platform revenue (commissions), prize pool balances, pending withdrawals, recharge volume
- Leaderboard monitoring — real-time view of all active challenge leaderboards
- Content management — app banners, announcements, and push notification broadcasts
Technical Challenges
-
On-device pose estimation accuracy — TensorFlow Lite models run under strict mobile constraints (CPU/GPU budget, battery drain, thermal throttling). Optimized the model with quantization and tested across a range of devices — from flagship phones to budget Android devices common in India. Tuned confidence thresholds so the model is accurate without being so strict that it frustrates users on lower-end cameras.
-
Rep counting reliability — Counting reps from joint angle trajectories sounds simple but edge cases are everywhere: partial reps, pauses mid-rep, users moving out of frame, camera angle variations, different body proportions. Built a state machine per exercise that tracks the movement phase (eccentric → bottom → concentric → top) with hysteresis to avoid double-counting on jerky movements.
-
Real-time leaderboard at scale — During popular challenges, hundreds of users submit reps simultaneously. Redis sorted sets with
ZINCRBYhandle atomic score updates. The Flutter app subscribes to leaderboard changes via polling (every 2 seconds during active challenges). Leaderboard reads are served entirely from Redis — zero database load for the hottest path. -
Fair competition and anti-cheat — Real money means users will try to game the system. Detection model flags physically impossible rep rates. Backend validates that rep timestamps are consistent (can not submit 100 reps with identical timestamps). Device fingerprinting detects multi-account abuse. Admin can review flagged sessions before prize distribution.
-
Wallet consistency — Financial transactions must be atomic. Entry fee deduction and challenge registration happen in a single database transaction — if either fails, both roll back. Prize distribution is idempotent — running it twice does not double-credit. All wallet mutations go through a ledger table with double-entry bookkeeping.
-
Cross-platform camera performance — Camera access, frame processing pipeline, and TensorFlow Lite inference behave differently on Android vs iOS. Used Flutter platform channels to interface with native camera APIs for maximum frame rate, with the TF Lite model running on a background isolate to keep the UI thread smooth.
Architecture
- Mobile App — Flutter (Dart) for Android and iOS. TensorFlow Lite for on-device pose estimation and exercise detection. Platform channels for native camera access. Local SQLite for offline practice data.
- API Layer — Node.js + TypeScript REST API behind Nginx reverse proxy. JWT authentication. Rate limiting per user. Request validation for all exercise submission and wallet endpoints.
- Leaderboard Service — Redis sorted sets for real-time ranking. Atomic score updates via
ZINCRBY. Separate sorted sets per challenge. Snapshot to PostgreSQL on challenge completion for permanent storage. - Wallet Service — PostgreSQL-backed ledger with double-entry bookkeeping. Atomic transactions for fee deduction and prize distribution. Razorpay integration for recharge and withdrawal.
- Database — PostgreSQL for users, challenges, exercises, wallet ledger, challenge results, and audit logs. Indexes on challenge lookups, user wallet queries, and leaderboard snapshots.
- Cache — Redis for leaderboards, active challenge metadata, user session tokens, and frequently-accessed exercise configurations.
- File Storage — AWS S3 for exercise reference videos, user avatars, and challenge banner images.
- Infrastructure — AWS deployment. Nginx as reverse proxy and static asset server. Docker containers for API and admin portal. RDS for PostgreSQL. ElastiCache for Redis. CloudWatch for monitoring.
Results & Impact
- ML-verified exercise tracking — every rep is validated by on-device pose estimation, eliminating fake submissions and making competitive challenges fair
- Real-money engagement loop — participation fees and cash prizes create stakes that drive consistent daily usage, unlike free fitness apps that users abandon after a week
- Real-time competition — Redis-powered leaderboards update instantly, creating live competitive energy during active challenges
- Cross-platform reach — single Flutter codebase delivers a native experience on both Android and iOS, covering the full Indian smartphone market
- Admin-configurable platform — new exercises and challenges launched from the admin portal without code changes, enabling rapid content iteration
- Sole architect and developer — designed and built the entire system: ML exercise detection pipeline, Flutter mobile app, Node.js backend, wallet/payment system, real-time leaderboards, and admin portal
Stack Deep Dive
- Flutter for cross-platform mobile app — single codebase for Android and iOS with native camera performance via platform channels
- TensorFlow Lite for on-device pose estimation and exercise classification — runs locally, no video upload, privacy-preserving
- Node.js + TypeScript for the backend API — handles exercise submissions, challenge management, wallet operations, and admin functions
- PostgreSQL for all persistent data — users, challenges, wallet ledger (double-entry), exercise configurations, and challenge results
- Redis sorted sets for real-time leaderboards — atomic score updates, sub-millisecond rank queries, zero database load on the hot path
- Razorpay for payment processing — recharge via UPI/cards/wallets, withdrawal to bank accounts
- Nginx as reverse proxy with SSL termination, rate limiting, and static asset serving
- AWS (EC2, RDS, ElastiCache, S3, CloudWatch) for cloud infrastructure
- Docker for containerized deployment of API and admin services
Interested in working together?
Get in Touch →