Skip to content

BribeYourselfFit is an open-source, self-hosted fitness tracker that uses streaks and custom rewards to keep you motivated. Track steps, workouts, hydration, and healthy habits with a simple daily checklist. Hit your goals, build streaks, and bribe yourself with the rewards that actually work for you. No guilt. Just progress.

License

Notifications You must be signed in to change notification settings

TheBIMsider/BYF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BribeYourselfFit - Gamified Fitness Tracker

🎯 Open-source, self-hosted fitness tracking with streak-based motivation

🤖 Built with AI-Assisted Development

This project was created using modern AI-powered development tools, demonstrating the power of human-AI collaboration in software development:

  • Live Coding Sessions: Built live using AI pair programming and systematic debugging
  • 🧠 Claude (Anthropic): Primary AI assistant for architecture, code generation, documentation, and problem-solving
  • 👨‍💻 GitHub Copilot: Code completion and intelligent suggestions
  • 🏗️ Human Expertise: AECO/BIM industry knowledge and project direction by The BIMsider

Why this matters: This showcases how AI tools can help domain experts (like AECO professionals) create sophisticated web applications without traditional programming backgrounds, while maintaining high code quality and best practices through systematic debugging and iterative development.

🤔 Why This App Exists

Sometimes when you're trying to lose weight or be more active, you need accountability. But accountability means different things to different people. For some, it's just tracking numbers. For others - like me - you need an incentive, a motive, a real reason for doing something.

Back in the 2000s when The Biggest Loser was popular, friends would get together for weight loss competitions. There'd be something on the line - $50, a night out, bragging rights - and the winner would take it all. That external motivation helped people actually track their stats, log their weights, and do the work.

But here's the thing: Not everyone is motivated by money or new clothes or the same rewards. Every person's fitness journey is different.

That's why BribeYourselfFit was born - a fitness tracker that lets you set your own rewards, your own "bribes" for hitting your goals. Whether it's a cheat meal after a 7-day streak, new workout gear at 30 days, or a weekend getaway at 100 days - you decide what motivates you.

🎮 How It Works

BribeYourselfFit combines simple daily tracking with powerful motivation:

Daily Tracking Made Simple

  • Weight: Log weekly (because daily fluctuations are noise)
  • Steps: Your daily movement goal
  • Exercise: Minutes + type (cardio, strength, yoga, etc.)
  • Water: Hydration tracking
  • Wellness Score: 5-point daily checklist:
    • ✅ Avoided sugary drinks
    • ✅ 5+ servings fruits & vegetables
    • ✅ Practiced portion control
    • ✅ No eating after 8 PM
    • ✅ 7+ hours of sleep

Streak-Based Motivation

  • Individual streaks for each goal (steps, exercise, water, wellness)
  • Overall streak when you hit ALL daily goals
  • Visual progress with streak calendars and charts
  • Built-in milestones at 7, 14, 30, 50, 100+ days

Your Custom Rewards

The magic happens in the rewards system. Set your own "bribes":

  • 7-day streak: Favorite cheat meal
  • 14-day streak: New workout playlist
  • 30-day streak: New athletic shoes
  • 50-day streak: Massage or spa day
  • 100-day streak: Weekend vacation

You know what motivates you. The app just helps you stay accountable to your own system.

📱 Screenshot

(localStorage version shown)

BYF_Local

🚀 Get Started in 2 Minutes

Option 1: Fork & Deploy (Recommended)

  1. Fork this repository to your GitHub account
  2. Choose your storage (see backend options below)
  3. Enable GitHub Pages in repository settings
  4. Open your app and start your first streak!

Option 2: Download & Run Locally

  1. Download your preferred version
  2. Open index.html in any web browser
  3. Set your goals and rewards
  4. Log your first day!

First Day Setup

  1. Set your profile: Starting weight, goal weight, daily targets
  2. Choose your rewards: What will you "bribe" yourself with?
  3. Log today: Hit those daily goals and start your streak
  4. Check back tomorrow: The streak magic begins with day 2

🌟 Choose Your Backend

BribeYourselfFit offers multiple storage options to fit your needs:

Version Storage Setup Best For Branch Status
🏠 localStorage Browser only None Simple setup, offline use main ✅ v1.1 Ready
🌐 JSONBin.io Cloud API API key Cross-device sync, simple cloud jsonbin-version ✅ v1.1 Ready
📊 Airtable Structured DB API setup Rich data features, sharing airtable-version ✅ v1.1 Ready
🔥 Firebase Real-time DB Project setup Enterprise scale, real-time sync firebase-version ✅ v1.1 Ready

📱 Features

🎯 Core Tracking

  • Daily Logging: Weight (weekly), steps, exercise minutes, water intake
  • Exercise Types: Multi-select from cardio, strength, yoga, sports, walking, cycling, swimming, other
  • Food & Wellness Score: 5-point daily checklist system
    • ✅ Avoided sugary drinks
    • ✅ 5+ servings fruits & vegetables
    • ✅ Practiced portion control
    • ✅ No eating after 8 PM
    • ✅ 7+ hours of sleep

🔥 Gamification

  • Streak Tracking: Individual streaks for each goal + overall streak
  • Achievement System: Default milestones + claimable custom rewards
  • Progress Visualization: Weight trends, activity charts, streak calendar
  • Milestone Celebrations: 7, 14, 30, 50, 100+ day streaks
  • Weight Loss Rewards: Every 10 lbs + bonus at 25 & 50 lb marks

📊 Analytics & Progress

  • Interactive Charts: Weight trends with goal projection and unit conversion
  • Activity Summaries: Daily metrics with 7/30/all-time views
  • Streak Calendar: Monthly heatmap showing completion status
  • Data Export: Full JSON backup and restore capabilities

📱 Mobile Optimized

  • Progressive Web App: Install like a native app
  • Responsive Design: Works perfectly on phone, tablet, desktop
  • Offline Capable: localStorage version works without internet
  • Touch Optimized: 44px touch targets, mobile-friendly forms

⚙️ Advanced Settings (v1.1 Features)

  • App Preferences: Theme selection, units (Imperial/Metric) with real-time conversion, date formats
  • Goal Management: Modify daily targets and weight goals without losing streak history
  • Data Management: Complete backup/restore system with import/export
  • Wellness Customization: View wellness checklist details and customize goal thresholds
  • Streak Management: Reset options with granular control (streaks only, logs only, etc.)

✨ User Experience Enhancements (v1.1 NEW)

  • Processing Indicators: Real-time feedback during operations (saving, loading charts, exports)
  • Smart Form Handling: Auto-load today's data, weight unit conversion in all inputs
  • Error Recovery: Graceful handling of network issues and data validation
  • Accessibility: Enhanced keyboard navigation, screen reader support, focus indicators

🎨 User Interface

Clean & Minimal Design

  • 🌓 Dark/Light mode toggle with system preference detection
  • Accessible design with keyboard navigation and screen reader support
  • 🎨 Modern styling with smooth animations and micro-interactions
  • 📱 Mobile-first responsive layout

Intuitive Navigation

  • Dashboard: Daily logging and streak overview with real-time processing feedback
  • Progress: Charts and analytics with weight unit conversion
  • Rewards: Achievements and milestone management with custom reward claiming
  • Settings: Comprehensive preferences and data management (v1.1)

Smart User Feedback (v1.1 NEW)

  • Processing Indicators: ⏳ "Saving daily log..." → ✅ "Complete!"
  • Real-time Validation: Instant feedback on form inputs with unusual value confirmation
  • Progressive Loading: Charts and data load with visual progress indicators
  • Error Recovery: Clear error messages with suggested solutions

🔧 Technical Details

Built With

  • Frontend: Vanilla HTML, CSS, JavaScript (no frameworks!)
  • Charts: Custom Canvas-based visualization with unit conversion
  • Storage: Multiple backend options (see versions above)
  • PWA: Service Worker + Web App Manifest

Performance

  • Loads in <3 seconds on mobile
  • Handles 2+ years of daily data efficiently
  • Mobile performance: 86/100 Lighthouse score
  • Accessibility: Enhanced keyboard navigation and focus indicators
  • Smooth operations: Processing indicators prevent user confusion during longer tasks

Code Quality

  • 📝 Well-documented: Comprehensive comments for beginners
  • 🏗️ Modular architecture: Clean ES6 class-based structure
  • 🧪 Production-ready: Error handling and data validation
  • 📦 2,500+ lines of clean, maintainable code (updated for v1.1)

📖 Backend Setup Guides

🏠 localStorage v1.1 (Main Branch)

✅ No setup required!

  • Data stored in browser only
  • Works offline
  • Perfect for getting started
  • New in v1.1: Advanced settings, goal management, data import/export, processing indicators

🌐 JSONBin.io Cloud v1.1 (Readme)

git checkout jsonbin-version
  1. Get free API key from jsonbin.io
  2. Enter API key during app setup
  3. Data syncs across devices automatically

📊 Airtable Database v1.1 (Readme)

git checkout airtable-version
  1. Create Airtable base with provided template
  2. Get Personal Access Token and base ID
  3. Enjoy structured database with:
    • 5 fully functional tables (Users, Daily Logs, Settings, Custom Rewards, Achievements)
    • Weight unit conversion (lbs ↔ kg) with real-time UI updates
    • Custom reward claiming with milestone integration
    • Real-time database sync across all tables
    • Enterprise-level field validation and error handling

🔥 Firebase Real-time v1.1 (Readme)

git checkout firebase-version
  1. Create Firebase project
  2. Enable Realtime Database with test rules
  3. Get API Key and Database URL
  4. Enjoy real-time synchronization with:
    • Instant sync across all devices and browser tabs
    • Real-time updates without page refresh
    • Offline persistence with automatic sync when reconnected
    • Enterprise-grade infrastructure with Google's security
    • Complete weight unit conversion (lbs ↔ kg) with instant updates
    • Live custom rewards integration with real-time milestone claiming

🎯 Use Cases

Perfect For:

  • 👤 Personal fitness tracking with complete data ownership
  • 🎓 Learning web development with real-world project
  • 🏠 Self-hosted solutions without dependency on fitness apps
  • 🔧 Customization - modify goals, rewards, and features
  • 👨‍💻 Developers wanting to understand PWA and data storage patterns
  • 📊 Database enthusiasts who want structured fitness data (Airtable version)
  • 🔥 Real-time enthusiasts who want instant sync across devices (Firebase version)

Target Users:

  • Individuals who want to own their fitness data
  • People learning web development
  • Users preferring open-source, self-hosted solutions
  • Anyone wanting a simple, customizable fitness tracker
  • Teams/families wanting to share fitness data (Airtable/Firebase versions)
  • Tech enthusiasts wanting real-time synchronization (Firebase version)

🛠️ Development

Local Development

# Clone repository
git clone https://github.com/TheBIMsider/BYF.git
cd BYF

# Choose your branch
git checkout main                    # localStorage v1.1
git checkout jsonbin-version        # JSONBin.io v1.1
git checkout airtable-version       # Airtable v1.1
git checkout firebase-version       # Firebase v1.1

# Open in browser
open index.html

Project Structure

BYF/
├── index.html          # Main app structure
├── styles.css          # Complete styling with themes
├── script.js           # Core application logic (2,500+ lines)
├── manifest.json       # PWA manifest
├── sw.js              # Service Worker for PWA
├── README.md          # This file

Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open Pull Request

📊 Data Structure

Core Data Types

// User Profile
{
  startingWeight: 180,
  goalWeight: 160,
  dailySteps: 8000,
  dailyExercise: 30,
  dailyWater: 2
}

// Daily Log Entry
{
  date: "2025-07-30",
  weight: 175,
  steps: 8500,
  exerciseMinutes: 45,
  exerciseTypes: ["cardio", "strength"],
  water: 2.5,
  wellnessScore: 4,
  wellnessItems: ["sugary-drinks", "fruits-vegetables", "portion-control", "sleep"]
}

// Streak Tracking
{
  overall: 15,        // All goals met
  steps: 20,          // Individual streaks
  exercise: 18,
  water: 22,
  wellness: 16
}

// Settings (v1.1)
{
  themePreference: "system",
  weightUnit: "lbs",      // Real-time conversion support
  dateFormat: "US",
  weekStart: "sunday",
  allowPartialSteps: false,
  allowPartialExercise: false,
  strictWellness: false
}

// Custom Rewards (with claiming integration)
{
  type: "weight",
  description: "New workout shoes",
  weightLoss: 10,
  claimed: false,
  createdDate: "2025-07-30"
}

🔒 Privacy & Security

Data Ownership

  • You own your data - stored in your chosen backend
  • No tracking - zero analytics or user monitoring
  • Open source - audit the code yourself
  • Self-hosted - deploy on your own infrastructure

Security by Backend

  • localStorage: Data stays in your browser only - ultimate privacy
  • JSONBin.io: API keys stored locally, HTTPS encryption
  • Airtable: Personal Access Tokens with granular permissions, enterprise-grade security
  • Firebase: Google's enterprise security infrastructure with real-time encryption

📱 Browser Support

Browser Version Status
Chrome 80+ ✅ Full support
Firefox 75+ ✅ Full support
Safari 13+ ✅ Full support
Edge 80+ ✅ Full support
iOS Safari 13+ ✅ PWA installable
Chrome Mobile 80+ ✅ PWA installable

🗺️ Roadmap

Phase 4: Backend IntegrationsCOMPLETE

  • localStorage advanced features (v1.1)
  • JSONBin.io cloud storage (v1.1)
  • Airtable structured database (v1.1)
  • Firebase real-time sync (v1.1) ✅ NEW

Phase 5: Advanced Features

  • Custom wellness checklists
  • Social sharing capabilities
  • Advanced analytics dashboard
  • Nutrition tracking integration
  • Workout routine templates
  • Firebase Authentication for secure user accounts
  • Push notifications for fitness reminders

Phase 6: Mobile Apps

  • React Native mobile app
  • Apple Watch companion
  • Android Wear support

🆘 Support

Documentation

  • 📖 Branch READMEs: Each version has detailed setup instructions
  • 🏠 localStorage v1.1: Setup Guide - No setup required!
  • 🌐 JSONBin v1.1: Setup Guide
  • 📊 Airtable v1.1: Setup Guide
  • 🔥 Firebase v1.1: Setup GuideNEW

Community

Getting Help

  1. Check the README for your specific branch
  2. Search existing GitHub issues
  3. Create new issue with:
    • Branch/version you're using
    • Browser and version
    • Steps to reproduce the problem
    • Screenshots if applicable

📄 License

BSD-3-Clause License - see LICENSE file for details.

TL;DR: You can use, modify, and distribute this freely. Just keep the license notice.

🙏 Acknowledgments

  • Fitness tracking community for feature inspiration
  • Open source contributors for best practices
  • Web development community for modern standards
  • Beta testers for real-world feedback
  • AI development tools for enabling rapid iteration and systematic debugging
  • Firebase & Google Cloud for providing enterprise-grade real-time infrastructure

Star This Repo

If BribeYourselfFit helps you on your fitness journey, please star this repository to help others discover it!


🚀 Ready to Start Your Fitness Journey?

  1. ⭐ Star this repository to bookmark it
  2. 🍴 Fork it to your GitHub account
  3. 🌿 Choose your branch based on storage needs:
    • Simple start: main (localStorage v1.1)
    • Cloud sync: jsonbin-version (JSONBin v1.1)
    • Database power: airtable-version (Airtable v1.1)
    • Real-time sync: firebase-version (Firebase v1.1) ✅ NEW
  4. 🚀 Deploy to GitHub Pages or run locally
  5. 💪 Start tracking and building streaks!

🎉 Latest Updates

localStorage v1.1 - Enhanced UXUPDATED (July 31, 2025)

  • Processing indicators with real-time operation feedback
  • Complete weight unit conversion (lbs ↔ kg) throughout entire app
  • Smart form handling with auto-loading and validation
  • Enhanced error recovery with graceful degradation
  • Improved accessibility and mobile experience

Firebase v1.1 - CompleteNEW (July 30, 2025)

  • Real-time synchronization across all devices and browser tabs
  • Complete weight unit conversion (lbs ↔ kg) with instant updates
  • Full custom rewards integration with live claiming
  • Enterprise-grade Firebase infrastructure with Google's security
  • Offline persistence with automatic sync when reconnected
  • Production-ready with comprehensive error handling

All Versions v1.1 - Complete Backend Suite

  • localStorage v1.1: Enhanced settings, offline functionality, and processing indicators
  • JSONBin v1.1: Simple cloud sync with JSON storage
  • Airtable v1.1: Structured database with 5 tables and enterprise features
  • Firebase v1.1: Real-time sync with Google's infrastructure ✅ NEW

Questions? Problems? Success stories?

We'd love to hear from you! Create an issue.


localStorage v1.1 - Enhanced settings, enhanced UX, processing indicators and your data stays in your browser only - ultimate privacy

Made with ❤️ & 🤖 assistance for the fitness and open-source communities

About

BribeYourselfFit is an open-source, self-hosted fitness tracker that uses streaks and custom rewards to keep you motivated. Track steps, workouts, hydration, and healthy habits with a simple daily checklist. Hit your goals, build streaks, and bribe yourself with the rewards that actually work for you. No guilt. Just progress.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published