Skip to content

JozefJarosciak/Blue2Scale.com

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blue2Scale

Track 39 body composition metrics from your Bluetooth scale — right in your browser.

License: Source-Available Website Browser Support


What Is Blue2Scale?

Blue2Scale is a web application that connects to Bluetooth Low Energy (BLE) body composition scales directly from your browser using the Web Bluetooth API. No mobile app installation required — just open the site, step on your scale, and get a complete breakdown of 39 body composition metrics in seconds.

Every measurement captures detailed body composition data including weight, body fat percentage, muscle mass, hydration levels, bone mineral content, visceral fat rating, metabolic age, and full segmental analysis (muscle and fat for each arm, leg, and trunk). All data is stored securely and visualized through interactive charts, trend indicators, and an anatomical body map.

Blue2Scale is free to use at blue2scale.com. Sign in with Google or try a single measurement as a guest without creating an account.


Screenshots

Screenshots coming soon — the app is live at blue2scale.com


Supported Metrics

Blue2Scale captures 39 distinct metrics per measurement, organized into the following categories:

Core Metrics

Metric Unit Description
Weight kg / lbs Total body weight
BMI index Body Mass Index

Body Fat

Metric Unit Description
Body Fat % Total body fat percentage
Fat Mass kg / lbs Absolute fat mass
Subcutaneous Fat kg / lbs Fat beneath the skin
Subcutaneous Fat % As percentage of body weight
Visceral Fat rating (1–59) Fat around internal organs
Android Fat kg / lbs Fat in the abdominal region
Gynoid Fat kg / lbs Fat in the hip/thigh region
A/G Ratio % Android-to-Gynoid fat ratio

Lean & Muscle

Metric Unit Description
Lean Mass kg / lbs Total non-fat mass
Lean Mass % As percentage of body weight
Skeletal Muscle kg / lbs Muscle attached to skeleton
Body Cell Mass kg / lbs Metabolically active cell mass

Water

Metric Unit Description
Body Water % Total water as percentage of body weight
Total Water kg / lbs Absolute water mass
ECW (Extracellular Water) kg / lbs Water outside cells
ICW (Intracellular Water) kg / lbs Water inside cells

Bone & Mineral

Metric Unit Description
Bone Mineral kg / lbs Mineral content of bones
Mineral Mass kg / lbs Total mineral mass

Other Composition

Metric Unit Description
Skeletal Mass kg / lbs Total skeletal system mass
Organ Mass kg / lbs Mass of internal organs

Metabolic

Metric Unit Description
BMR kcal Basal Metabolic Rate
Metabolic Age years Estimated metabolic age

Segmental Analysis (5 segments × 3 values = 15 data points)

Segment Muscle (kg/lbs) Fat (%) Fat (kg/lbs)
Right Arm
Left Arm
Trunk
Right Leg
Left Leg

Tested Devices / Compatibility

✅ Hume Body Pod — Fully tested, all 39 metrics supported

Blue2Scale uses the standard Bluetooth Low Energy (BLE) Body Composition Service (UUID 0x181B) and Weight Scale Service (UUID 0x181D). It should work with other BLE body composition scales that implement these standard services, though it has only been verified with the Hume Body Pod.

If you've tested Blue2Scale with another scale, please open an issue to let us know!


Features

  • Web Bluetooth Connection — Connect directly from your browser, no app install needed
  • Real-time Measurement — Live weight display with body composition results in seconds
  • 39 Body Metrics — Full body composition breakdown including segmental analysis
  • Interactive Dashboard — At-a-glance view of key metrics with trend indicators and sparklines
  • Body Map Visualization — Anatomical silhouette showing segmental muscle and fat data per body region
  • Trend Charts — Interactive, zoomable charts tracking every metric over time with time range filters (1W, 1M, 3M, 6M, 1Y, ALL)
  • Dark & Light Themes — Full dark and light theme support with system preference detection
  • Data Table View — Sortable, filterable history of all measurements with column visibility controls
  • Data Export — Export as CSV and JSON
  • Goal Tracking — Set targets for any metric and track progress with visual progress bars
  • Google Sign-In — One-click authentication with your Google account
  • Guest Mode — Try a single weigh-in without creating an account (data stored locally)
  • Privacy First — Your data stays on the server, full account deletion available
  • Responsive Design — Optimized for desktop, tablet, and mobile with adaptive sidebar/bottom navigation
  • Unit Toggle — Switch between metric (kg/cm) and imperial (lbs/ft-in) in settings
  • Measurement Notes — Attach notes to any weigh-in for context

Browser Compatibility

Blue2Scale uses the Web Bluetooth API, which is only available in:

Browser Supported Minimum Version
Google Chrome ✅ Yes 56+
Microsoft Edge ✅ Yes 79+
Opera ✅ Yes 43+
Firefox ❌ No No Web Bluetooth API
Safari ❌ No No Web Bluetooth API

Web Bluetooth requires HTTPS. The app at blue2scale.com is served over HTTPS. If self-hosting, you must configure SSL.


How It Works

  1. User clicks "Connect Scale" → the browser's Web Bluetooth device picker appears
  2. User selects their BLE scale from the list
  3. App connects via GATT and subscribes to Body Composition Service notifications
  4. User stands on scale and grabs the handle electrodes (for scales with handles)
  5. Scale transmits weight and bioelectrical impedance data over BLE
  6. App parses the raw BLE data and calculates all 39 body composition metrics using BIA (Bioelectrical Impedance Analysis) algorithms
  7. Results are displayed instantly — user can save to their account or continue as guest

All BLE communication happens locally in the browser. Raw measurement data is only sent to the server when the user explicitly saves a measurement.


Tech Stack

Layer Technology
Frontend Vanilla HTML + CSS (Tailwind via CDN) + JavaScript
Backend PHP 8.x
Database MySQL 8.0
Auth Google OAuth 2.0 (custom PHP implementation)
BLE Web Bluetooth API (browser-native)
Charts Chart.js
Icons Lucide (via CDN)
Web Server Apache 2.4 with mod_rewrite
SSL Let's Encrypt (certbot)

Self-Hosting

Self-hosting for personal, non-commercial use is permitted under the Blue2Scale Source-Available License. Commercial or production deployment requires a commercial license. See LICENSE for details.

Prerequisites

  • PHP 8.1+ with extensions: pdo_mysql, curl, json, session
  • MySQL 8.0+
  • Apache 2.4 with mod_rewrite enabled
  • HTTPS (Web Bluetooth requires a secure context)

Setup

# Clone the repository
git clone https://github.com/JozefJarosciak/blue2scale.com.git
cd blue2scale.com

# Create and configure the app
cp php/includes/config.example.php php/includes/config.php
# Edit php/includes/config.php with your database credentials and Google OAuth keys

# Import the database schema
mysql -u your_db_user -p your_db_name < php/schema.sql

Apache Virtual Host

Point your Apache DocumentRoot to the php/ subdirectory:

<VirtualHost *:443>
    ServerName your-domain.com
    DocumentRoot /var/www/blue2scale.com/php

    <Directory /var/www/blue2scale.com/php>
        AllowOverride All
        Require all granted
    </Directory>

    # SSL config (certbot will add this)
</VirtualHost>

Enable mod_rewrite:

a2enmod rewrite
systemctl reload apache2

Google OAuth Setup

  1. Go to Google Cloud Console → APIs & Services → Credentials
  2. Create an OAuth 2.0 Client ID (Web application type)
  3. Add your domain to Authorized JavaScript origins: https://your-domain.com
  4. Add the callback URL to Authorized redirect URIs: https://your-domain.com/api/auth/callback
  5. Copy the Client ID and Client Secret into php/includes/config.php

Configuration

Edit php/includes/config.php (copied from config.example.php):

Setting Description
SITE_URL Full URL of your deployment (no trailing slash)
DB_HOST MySQL hostname (usually localhost)
DB_NAME MySQL database name
DB_USER MySQL username
DB_PASS MySQL password
GOOGLE_CLIENT_ID Google OAuth 2.0 client ID
GOOGLE_CLIENT_SECRET Google OAuth 2.0 client secret

Security note: php/includes/config.php is excluded from version control via .gitignore. Never commit it.


Project Structure

blue2scale.com/
├── php/                            # Application root (Apache DocumentRoot)
│   ├── index.php                   # Landing page
│   ├── login.php                   # Login page
│   ├── dashboard.php               # Main dashboard
│   ├── weigh-in.php                # BLE connection + measurement flow
│   ├── history.php                 # Measurement history table
│   ├── charts.php                  # Interactive trend charts
│   ├── goals.php                   # Goal tracking
│   ├── export.php                  # Data export (CSV, JSON)
│   ├── settings.php                # Profile + preferences
│   ├── about.php                   # About page
│   ├── compatibility.php           # Device compatibility list
│   ├── privacy.php                 # Privacy policy
│   ├── .htaccess                   # URL rewriting + security headers
│   ├── api/
│   │   ├── auth/
│   │   │   ├── login.php           # Initiates Google OAuth flow
│   │   │   ├── callback.php        # OAuth callback handler
│   │   │   ├── session.php         # Returns current session info
│   │   │   └── logout.php          # Destroys session
│   │   ├── measurements.php        # GET/POST/DELETE measurements
│   │   ├── goals.php               # GET/POST/DELETE goals
│   │   ├── profile.php             # GET/PUT user profile
│   │   ├── account.php             # DELETE account (permanent)
│   │   ├── device-reports.php      # POST device compatibility reports
│   │   └── export/
│   │       ├── csv.php             # Export measurements as CSV
│   │       └── json.php            # Export measurements as JSON
│   ├── includes/
│   │   ├── config.example.php      # Configuration template (commit this)
│   │   ├── config.php              # Your local config (gitignored)
│   │   ├── db.php                  # PDO database connection
│   │   ├── auth.php                # Session helpers + require_auth()
│   │   ├── functions.php           # Shared utilities
│   │   ├── header.php              # Public page header
│   │   ├── footer.php              # Public page footer
│   │   ├── app-header.php          # App page header (with sidebar)
│   │   └── app-footer.php          # App page footer
│   └── assets/
│       ├── css/                    # Stylesheets
│       └── js/                     # Client-side JavaScript
├── php/schema.sql                  # MySQL schema (import to create tables)
├── LICENSE                         # Source-Available License
├── NOTICE                          # Plain-English license summary
└── README.md                       # This file

API Endpoints

Method Endpoint Auth Required Description
GET /api/auth/session No Current session info
GET /api/auth/login No Redirect to Google OAuth
GET /api/auth/callback No OAuth callback handler
GET /api/auth/logout No Destroy session
GET /api/profile Yes Get user profile/preferences
PUT /api/profile Yes Update user profile/preferences
GET /api/measurements Yes List measurements (?limit=N)
POST /api/measurements Yes Save a new measurement
DELETE /api/measurements?id=:id Yes Delete a measurement
GET /api/goals Yes List goals
POST /api/goals Yes Create a goal
DELETE /api/goals?id=:id Yes Delete a goal
GET /api/export/csv Yes Export measurements as CSV
GET /api/export/json Yes Export measurements as JSON
POST /api/device-reports No Submit device compatibility report
DELETE /api/account Yes Permanently delete account and all data

Contributing

Contributions are welcome for bug fixes and improvements. By submitting a pull request, you agree to assign all rights in your contribution to the project owner (see LICENSE, Section 5).

To contribute:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request with a clear description

Please open an issue first for major changes to discuss the approach.


Security

Self-hosters are responsible for supplying their own credentials. Never commit php/includes/config.php to version control — it contains your database password and OAuth secrets. The file is gitignored by default.

If you discover a security vulnerability, please open a GitHub issue.


License

Blue2Scale is released under the Blue2Scale Source-Available License.

You may view, study, fork, and modify the code for personal, non-commercial, non-production purposes.

Commercial use, production deployment, or incorporation into other products requires a commercial license. To initiate a licensing inquiry, please open a GitHub issue.

See LICENSE for full terms.


Disclaimer

Blue2Scale is an independent project. It is not affiliated with, endorsed by, or associated with Hume Health or any other scale manufacturer. All product names, logos, and trademarks are property of their respective owners.

Blue2Scale is not a medical device. Body composition metrics are estimates based on bioelectrical impedance analysis (BIA) and are provided for informational purposes only. Always consult a healthcare professional for medical advice.


Contact

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

No contributors