Skip to content

Self-hosted fitness tracker with AI workout generation, medication tracking, gamification, and privacy-first design. Track workouts, medications, correlations, and compete on leaderboards—all on your own infrastructure.

License

Notifications You must be signed in to change notification settings

Poolchaos/PersonalFit

Repository files navigation

PersonalFit 🏋️

AI-Powered Personal Fitness Platform with Gamification

Self-hosted • Privacy-first • Full control over your data

TypeScript React Express MongoDB Docker License


⚠️ License Notice

This software is NOT free for commercial use.

PersonalFit is licensed under the PolyForm Noncommercial License 1.0.0.

Allowed: Personal use, learning, research, non-profit organizations ❌ Not Allowed: Commercial use, SaaS integration, reselling

For commercial licensing, contact: phillipjuanvanderberg@gmail.com

See the LICENSE file for full terms.


🎯 What is PersonalFit?

Self-hosted fitness tracking with AI-powered workout generation and gamification. Keep your data private, earn XP while working out, and get personalized plans based on your goals and equipment.


📸 Screenshots

Onboarding Setup

OpenAI API Key Setup

User Profile Setup

Workout Generation & Dashboard

Generated Workout Plan

Dashboard with Stats

Workout Management & Scheduling

Workouts Overview

Weekly Schedule

Daily Workout Plan

Medication & Supplement Tracking

Medications Manager

Gamification & Rewards

Rewards Shop

Leaderboard


✨ Key Features

  • 🎮 Gamification System — XP, levels, 42 achievements, daily challenges, streak tracking
    • 🏆 Global & Weekly Leaderboards — Compete with other users, see rankings with XP/streaks/levels
    • 💎 Rewards Shop — Earn gems from milestones, purchase themes, badges, titles, profile items
    • 🎁 Adherence Rewards — Claim gems for reaching level/streak milestones (Level 5/10/15/20, Streaks 7/14/30 days)
  • 🤖 AI Workout Generation — OpenAI, Claude, or OpenRouter with multi-agent orchestration
  • 📅 Smart Scheduling — Visual calendar, weekly preview, progress tracking
  • 💪 Workout Management — Multiple plans, session logging, active plan system
  • 📊 Progress Tracking — Body metrics, charts, progress photos with S3 storage
  • 💊 Medicine & Supplement Manager — Track medications, dosages, frequencies, health impacts
  • 🔐 Privacy-First — Self-hosted, your data on your server
  • 🛡️ Production-Ready — Rate limiting, security headers, 170+ tests

🆕 Medicine & Supplement Manager (Complete)

Phase 1:

  • 📋 Add medications/supplements with dosage, frequency, inventory tracking
  • 🏥 Support for prescriptions, OTC, and supplements
  • ❤️ Map medications to fitness metrics (heart rate, blood pressure, sleep, energy, etc.)
  • ⚠️ Track warnings and contraindications
  • 📅 Adherence logging with mood/energy tracking before/after doses
  • 🔄 Plan regeneration with medications context in AI prompts
  • 🧅 Onboarding integration — collect medications during signup

Phase 2 (AI Vision & Analytics):

  • 📸 Scan medication bottle labels with camera or photo upload
  • 🤖 Claude Vision API for automatic label OCR extraction
  • 📊 Confidence scoring for extracted data with manual review/correction flow
  • 🔗 Correlation analysis dashboard showing medication impact on fitness metrics
  • 💡 Smart insights: "Vitamin D appears to improve sleep by 23%"
  • 🎯 AI-powered parsing from onboarding notes with batch import
  • ✨ Auto-fill medication forms from extracted/parsed data

Phase 3 (Advanced Gamification & Rewards):

  • 🏆 Leaderboards — Global and weekly rankings showing top users by XP, streak, level, and workout count
  • 💎 Gems Currency — Earn gems by reaching milestones (levels, streaks)
  • 🛍️ Rewards Shop — Purchase cosmetic items with gems:
    • Themes (8 options): Ocean Breeze, Electric Purple, Golden Sunset, Fire & Ice, Midnight Moon, Desert Oasis, Forest Ranger, Northern Lights
    • Badges (5): Dedication, Champion, Elite, Master, Legend
    • Titles (5): "The Motivated", "Fitness Guru", "Iron Will", "Beast Mode", "Unstoppable"
    • Profile items with rarity tiers (common, uncommon, rare, epic, legendary)
  • 🎁 Milestone Rewards — Auto-claim gems when reaching level 5, 10, 15, 20 or streak 7, 14, 30 days
  • 📱 Mobile Navigation — Leaderboard and Shop accessible from bottom navigation on mobile devices

🛠️ Tech Stack

Backend: Node.js 22, Express 5.1, TypeScript 5.9, MongoDB 8.x, OpenAI/Anthropic SDKs, Jest

Frontend: React 19, Vite 7, TypeScript 5.9, TailwindCSS 3, Recharts, Playwright

Infrastructure: Docker, Docker Compose, Nginx, MinIO


📦 Quick Start

Prerequisites

  • Docker & Docker Compose
  • Git
  • (Optional) Node.js 22+ for local development

1. Clone & Configure

git clone https://github.com/Poolchaos/PersonalFit.git
cd PersonalFit

# Copy environment templates
cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env

2. Set Environment Variables

backend/.env:

NODE_ENV=development
PORT=5000
MONGODB_URI=mongodb://mongodb:27017/personalfit
JWT_SECRET=your-super-secret-jwt-key
JWT_REFRESH_SECRET=your-refresh-secret
ENCRYPTION_SECRET=your-32-char-encryption-key
CORS_ORIGIN=http://localhost:5173
OPENAI_API_KEY=sk-... # Required for AI workout generation
ANTHROPIC_API_KEY=sk-ant-... # Required for Phase 2 bottle label OCR

frontend/.env:

VITE_API_URL=http://localhost:5000

3. Launch

docker-compose up -d

4. Access

Service URL
🌐 Web App http://localhost:3000
🔌 API http://localhost:5000
🗄️ MinIO Console http://localhost:9003

🧪 Development

Run Backend Locally

cd backend
npm install
npm run dev

Run Frontend Locally

cd frontend
npm install
npm run dev

Run Tests

# Backend tests
cd backend && npm test

# Frontend E2E tests
cd frontend && npm run test:e2e

📁 Project Structure

PersonalFit/
├── backend/
│   ├── src/
│   │   ├── controllers/     # Route handlers
│   │   ├── models/          # Mongoose schemas
│   │   ├── routes/          # Express routes
│   │   ├── services/        # Business logic
│   │   │   └── ai/          # AI orchestration layer
│   │   ├── middleware/      # Auth, rate limiting
│   │   ├── validators/      # Request validation
│   │   └── __tests__/       # Jest tests
│   └── Dockerfile
├── frontend/
│   ├── src/
│   │   ├── pages/           # Route components
│   │   ├── components/      # Reusable UI
│   │   ├── design-system/   # Component library
│   │   ├── hooks/           # Custom React hooks
│   │   ├── api/             # API client & query keys
│   │   ├── store/           # Zustand stores
│   │   └── utils/           # Helpers & validation
│   ├── e2e/                 # Playwright tests
│   └── Dockerfile
├── docs/                    # Documentation
├── docker-compose.yml
└── LICENSE

📜 License

PersonalFit is licensed under PolyForm Noncommercial License 1.0.0.

Allowed: Personal use, learning, research, non-profit organizations ❌ Not Allowed: Commercial use, SaaS, reselling

For commercial licensing: phillipjuanvanderberg@gmail.com

See LICENSE for full terms.


🤝 Contributing

Contributions are welcome! Please note that by contributing, you agree that your contributions will be licensed under the same PolyForm Noncommercial License.

See CONTRIBUTING.md for development guidelines.


🐛 Found a Bug?

If you're using PersonalFit and encounter any issues, please help us improve by reporting them!

How to report:

  1. Check if the issue already exists in GitHub Issues
  2. If not, create a new issue
  3. Include:
    • Steps to reproduce
    • Expected vs actual behavior
    • Your environment (OS, Docker version, browser)
    • Any error messages or screenshots

Your feedback helps make PersonalFit better for everyone!


📧 Contact

Phillip-Juan van der Berg 📧 phillipjuanvanderberg@gmail.com


Built with ❤️ for fitness enthusiasts who value privacy

About

Self-hosted fitness tracker with AI workout generation, medication tracking, gamification, and privacy-first design. Track workouts, medications, correlations, and compete on leaderboards—all on your own infrastructure.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages