Skip to content

Simple swimming performance tracker and analytics platform written in Python. Manage swim times, analyze progress, earn badges, and compare with community. Built with Flask, PostgreSQL & Chart.js.

Notifications You must be signed in to change notification settings

Br0kenByDesign/HydroHero

Repository files navigation

HydroHero

HydroHero is a comprehensive swimming performance tracking application that helps swimmers monitor their progress, analyze their performance, and achieve their goals through detailed analytics and gamification. Also offers a trainer panel for trainers to manage their swimmers and gain insights.

mobildesktop

Also take a look at https://hydrohero.cloud to use my 'HydroHero Cloud' instance or to see some more screenshots and my FAQ.


Features

Performance Analytics

  • Normalized Time Analysis: Compare performance across distances using time-per-meter metrics
  • Multi-Pool Conversion: Automatic 25m/50m pool time conversion and analysis
  • Interactive Timeline Charts: Chart.js visualization with filtering
  • Community Performance Comparison: Multi-user analytics with privacy controls

Gamification System

  • 19+ Achievement Badges: Across 8 categories (Placement, Distance, Improvement, Streaks)
  • Real-time Progress Tracking: Dynamic progress bars and milestone notifications
  • Community Leaderboards: Rankings by badges, distance, and competitive performance
  • Success Rate Analytics: Podium finish percentages and competitive insights

Team Management

  • Trainer Dashboard: Multi-athlete performance monitoring and analytics
  • Dual Account Types: Login-enabled users and team-only member accounts
  • Email Invitation System: Team member onboarding workflow
  • Cross-Team Support: Trainers can manage multiple teams simultaneously

Security

  • TOTP Multi-Factor Authentication: With QR code setup and backup recovery codes
  • 7-Layer Image Validation: Magic bytes, PIL verification, format consistency checks
  • Redis Rate Limiting: Sliding window with graceful in-memory fallback
  • 40+ XSS Pattern Detection: Input sanitization and protection
  • PBKDF2 Password Hashing: 100k iterations with 32-byte salts

Tech experience

  • Progressive Web App (PWA): Native mobile app experience
  • REST API: Complete token-based data access with PBKDF2-secured API keys
  • Docker Containerization: Full production deployment with health monitoring
  • Advanced Data Export: CSV exports with calculated performance metrics
  • Responsive Design: Glassmorphism ocean UI design optimized for all screen sizes

Architecture

  • Flask + PostgreSQL: Backend with SQLAlchemy ORM
  • Redis Integration: Caching and rate limiting
  • Gunicorn WSGI: Production-ready application server
  • Logging: Application health monitoring
  • Email System: HTML templates for verification, invitations, and security alerts

⚠️ Currently only available in German

image

Quick Start

Prerequisites

  • Docker & Docker Compose
  • Git

Installation

  1. Clone the repository

    git clone https://github.com/Br0kenByDesign/hydrohero.git
    cd hydrohero
  2. Environment Configuration

    cp .env.example .env
    # Edit .env with your settings
  3. Start Services

    docker-compose up -d
  4. Access the application


Documentation

User guides, API docs, technical documentation


Technology Stack

Backend

  • Framework: Flask 2.3+ (Python 3.11) with SQLAlchemy 3.0+ ORM
  • Database: PostgreSQL 15+
  • Security: WTForms CSRF protection, PyOTP 2FA with QR generation
  • Caching: Redis 7+ with sliding window rate limiting
  • Image Processing: PIL/Pillow with python-magic validation
  • Email: SMTP integration with HTML template system

Frontend

  • UI Framework: Bootstrap 5.1+ with custom glassmorphism design
  • Data Visualization: Chart.js and date-fns adapter
  • Progressive Web App: Service Worker, manifest.json, mobile app capabilities
  • Icons & Fonts: Font Awesome 6.4+, Google Fonts (Inter)
  • Responsive Design: Mobile-first with touch-friendly navigation

Infrastructure & DevOps

  • Application Server: Gunicorn 21.2+ with multi-worker WSGI deployment
  • Containerization: Docker multi-stage builds with Docker Compose orchestration
  • Health Monitoring: Built-in health checks, structured logging
  • Security: PBKDF2 password hashing, CSP headers, XSS protection middleware
  • Environment Management: Environment-based configuration with secure secrets handling

API Endpoints

# Get API key from profile page, then use for requests:
curl -H "Authorization: Bearer YOUR_API_KEY" \
  http://localhost:5000/api/datenabruf

# Export personal competition data
GET /api/datenabruf

# Export team activities data (trainers only)
GET /api/teamaktivitaeten

License

This project is licensed under the MIT License - see the LICENSE file for details.


Roadmap

  • Improve UI/UX (espacially on mobile devices)
  • Add language support for languages besides german
  • More advanced statistics & visualizations
  • Integrations for sports wear like Garmin etc. to import times automatically

Status

This project is still in early development.

Feedback and suggestions are very welcome!

Also visit https://hydrohero.cloud

About

Simple swimming performance tracker and analytics platform written in Python. Manage swim times, analyze progress, earn badges, and compare with community. Built with Flask, PostgreSQL & Chart.js.

Topics

Resources

Stars

Watchers

Forks

Languages