Skip to content

Self-hosted fitness tracker with AI workout generation, gamification, and privacy-first design. Track workouts, metrics, and progress photos on your own infrastructure.

License

Notifications You must be signed in to change notification settings

Poolchaos/PersonalFit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

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?

PersonalFit is a comprehensive, self-hosted fitness tracking application that combines AI-powered workout generation with gamification to keep you motivated. Built with a modern TypeScript stack, it offers a complete solution for tracking workouts, progress, and maintaining accountabilityโ€”all while keeping your data private.

Why PersonalFit?

Feature Benefit
๐Ÿ”’ Privacy-First Your fitness data stays on YOUR server
๐Ÿ’ฐ No Subscriptions Host it yourself, no monthly fees
๐ŸŽฎ Gamification XP, levels, streaks, 42 achievements
๐Ÿค– Multi-AI Support OpenAI, Anthropic Claude, or OpenRouter
๐Ÿ“ฑ Responsive Works beautifully on desktop, tablet, mobile
๐Ÿ›ก๏ธ Production-Ready Rate limiting, security headers, error boundaries

โœจ Features

๐ŸŽฎ Gamification System

  • XP & Leveling โ€” Earn experience points for every workout completed
  • 42 Achievements โ€” Unlock badges for milestones (First Workout, Week Warrior, Century Club, etc.)
  • Streak Tracking โ€” Build daily workout streaks with freeze protection
  • Daily Challenges โ€” Fresh challenges every day for bonus XP
  • Personal Records โ€” Track PRs with automatic detection
  • Gems Currency โ€” Earn gems to purchase streak freezes

๐Ÿค– AI Workout Generation

  • Multi-Provider โ€” OpenAI GPT-4, Anthropic Claude, or OpenRouter
  • Personalized Plans โ€” Based on goals, equipment, experience, injuries
  • Multi-Agent Orchestration โ€” Planner โ†’ Worker โ†’ Reviewer pipeline
  • Token Management โ€” Smart token counting and budget optimization
  • Retry Logic โ€” Exponential backoff with jitter for reliability
  • Response Validation โ€” Zod schemas ensure valid AI responses

๐Ÿ“… Smart Scheduling

  • Visual Calendar โ€” Week and month views
  • Workout Details โ€” Click any day for full exercise breakdown
  • Progress Tracking โ€” Completed vs planned at a glance
  • Missed Workout Detection โ€” Automated accountability

๐Ÿ’ช Workout Management

  • Multiple Plans โ€” Generate and save multiple workout programs
  • Active Plan System โ€” One active plan at a time
  • Plan Preview โ€” Weekly schedule with XP forecasts
  • Session Logging โ€” Track sets, reps, weight, RPE, notes

๐Ÿ“Š Progress Tracking

  • Body Metrics โ€” Weight, body fat, measurements over time
  • Progress Photos โ€” Front/side/back with S3-compatible storage
  • Charts & Trends โ€” Visualize your journey with Recharts
  • Equipment Inventory โ€” Track your home gym

๐Ÿ”” Accountability

  • Streak Penalties โ€” Gamified consequences for missed workouts
  • Makeup Workouts โ€” Clear penalties by completing extra sessions
  • Partner System โ€” Invite accountability partners (coming soon)

๐Ÿ›ก๏ธ Security & Performance

  • 3-Tier Rate Limiting โ€” Auth (10/min), AI (10/hr), General (100/min)
  • Helmet Security Headers โ€” XSS, HSTS, CSP protection
  • API Key Encryption โ€” User keys encrypted at rest
  • Error Boundaries โ€” Graceful crash recovery
  • Optimistic Updates โ€” Instant UI feedback

๐Ÿ› ๏ธ Tech Stack

Backend

Technology Purpose
Node.js 22 Runtime
Express 5.1 Web framework
TypeScript 5.9 Type safety
MongoDB 8.x Database
Mongoose 8.x ODM
OpenAI SDK AI integration
Anthropic SDK Claude support
tiktoken Token counting
Zod Schema validation
Jest Testing (170+ tests)
Helmet Security headers
express-rate-limit Rate limiting

Frontend

Technology Purpose
React 19 UI framework
Vite 7 Build tool
TypeScript 5.9 Type safety
TailwindCSS 3 Styling
TanStack Query Server state
Zustand Client state
React Hook Form Form handling
Zod Validation
Framer Motion Animations
Recharts Data visualization
Playwright E2E testing

Infrastructure

Technology Purpose
Docker Containerization
Docker Compose Orchestration
Nginx Reverse proxy
MinIO S3-compatible storage

๐Ÿ“ฆ 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

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

๐Ÿ“œ Legal

Copyright

Copyright (c) 2025-2026 Phillip-Juan van der Berg. All Rights Reserved.

License

This project is licensed under the PolyForm Noncommercial License 1.0.0.

What this means:

  • โœ… You CAN use this for personal fitness tracking
  • โœ… You CAN study and learn from the code
  • โœ… You CAN use this at non-profit organizations
  • โŒ You CANNOT use this in a commercial product
  • โŒ You CANNOT sell this or offer it as a service
  • โŒ You CANNOT use this within a for-profit company

Commercial Use

If you want to use PersonalFit commercially, you need a paid license.

Contact: phillipjuanvanderberg@gmail.com

Available license tiers:

  • Startup License โ€” For companies with < $1M annual revenue
  • Enterprise License โ€” For larger organizations
  • OEM License โ€” For embedding in your products

๐Ÿค Contributing

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


๐Ÿ“ง 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, gamification, and privacy-first design. Track workouts, metrics, and progress photos on your own infrastructure.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages