Keep My Weight Tracker
A minimalist, privacy-first web application for tracking your weight and daily meals. This application is designed to be simple, lightweight, and focused on data ownership.
Features
- Weight Tracking: Log your weight with optional notes
- Meal Logging: Record your daily breakfast, lunch, dinner, and other meals
- Data Visualization: View your weight progress on an interactive chart
- Data Export/Import: Export and import your data as JSON or CSV
- Privacy-First: All data stays on your device using browser's localStorage
- Password Protection: Secure access to your health data
- Automated Backups: Optional S3-compatible storage backups
- Mobile-Friendly: Responsive design works on all devices
Getting Started
- Clone this repository or download the source code
- Open
index.htmlin your web browser - Start logging your weight and meals!
No installation or setup required. The application works entirely in your browser.
Data Storage
All your data is stored locally in your browser using localStorage. No data is sent to any server.
- To backup your data, use the "Export Data" button in the Settings tab
- To restore a backup, use the "Import Data" button in the Settings tab
Technical Details
This application is built with:
- Frontend: HTML5, CSS3, and vanilla JavaScript (ES6+)
- Data Storage: Browser localStorage
- Charts: Chart.js library
- Dependencies: None, except Chart.js which is loaded from CDN
Deployment
Local Development
Simply open index.html in your web browser.
Docker Deployment
The application includes a complete Docker setup with persistent data storage.
# Build and run with Docker Compose
docker-compose up -d
This will create:
- A container with both the web server and data API
- A persistent volume for data storage at
/data
Coolify Deployment
To deploy on Coolify with persistent storage:
- In your Coolify dashboard, create a new service
- Select "Docker Compose" as the deployment type
- Connect to your Git repository or upload the files directly
- Important: The docker-compose.yml file has been configured with:
- A named volume:
coolify-weight-tracker-data - A Coolify-specific label:
coolify.volume.weight-tracker-data=/data
- A named volume:
- Deploy the application
- Verify that the persistent volume appears in your Coolify resources
The application will be available at the URL provided by Coolify. All weight and meal data will be stored in the persistent volume, ensuring your data remains intact across container restarts or updates.
Verifying Data Persistence
After deployment:
- Add some weight or meal entries in the application
- Restart the container from the Coolify dashboard
- Verify your data is still available after the restart
Even with persistent storage configured, it's recommended to occasionally use the "Export Data" feature in the Settings tab as an additional backup.
S3 Backup Configuration
The application includes automated backups to S3-compatible storage (like Minio):
-
Configure S3 Credentials in Coolify:
- In your Coolify dashboard, go to your Weight Tracker service
- Under the "Environment Variables" section, set the following:
S3_ENDPOINT: Your Minio server URL (e.g.,https://minio.example.com)S3_REGION: Region name (e.g.,us-east-1, can be any value for Minio)S3_BUCKET: Bucket name for backups (e.g.,weight-tracker-backups)S3_ACCESS_KEY: Your Minio access keyS3_SECRET_KEY: Your Minio secret keyS3_USE_SSL: Set totrueif your Minio server uses HTTPS
-
Backup Schedule (Optional):
BACKUP_SCHEDULE: Cron expression for backup schedule (default:0 0 * * *- daily at midnight)BACKUP_RETENTION: Number of backups to keep (default:7)
-
Verify Backups:
- Check your Minio bucket for backup files named
weight-tracker-backup-[timestamp].json - Backups are automatically rotated based on the retention setting
- Check your Minio bucket for backup files named
Authentication
The Weight Tracker application can be password-protected to secure your personal health data. To enable password protection, set the following environment variables in your Coolify deployment:
AUTH_USERNAME: The username for authentication (defaults touserif not specified)AUTH_PASSWORD: The password for authentication (defaults topasswordif not specified)
Example:
AUTH_USERNAME=myusername
AUTH_PASSWORD=mysecurepassword
Authentication Details
- Simple Setup: Just set the username and password directly in your environment variables
- Browser Login: When accessing your Weight Tracker, you'll be prompted with a browser login dialog
- Login Credentials:
- Username: The value of
AUTH_USERNAME(defaults touser) - Password: The value of
AUTH_PASSWORD(defaults topassword)
- Username: The value of
Note
: This approach uses Nginx's basic authentication with plaintext passwords stored in environment variables. While simpler to set up, ensure your Coolify environment is secure and that you're using HTTPS for all connections.
Password Protection
The application includes password protection to secure your health data:
-
Generate a Password Hash:
# Install dependencies locally npm install bcryptjs # Generate a hash for your password node generate-password-hash.js your-secure-passwordThis will output a bcrypt hash that you can use in your environment variables.
-
Configure Password in Coolify:
- In your Coolify dashboard, go to your Weight Tracker service
- Under the "Environment Variables" section, set:
PASSWORD_HASH: The bcrypt hash generated in step 1SESSION_SECRET: A random string for session encryptionCOOKIE_SECURE: Set totrueif using HTTPS
-
Alternative: Use Your Caddy Hash:
- If you already have a bcrypt hash from Caddy, you can use it directly
- Set the
PASSWORD_HASHenvironment variable to your existing bcrypt hash
-
Security Notes:
- The password is never stored in plain text
- Only the hash is stored in the environment variable
- Authentication uses secure HTTP-only cookies
- Sessions expire after 24 hours of inactivity
Roadmap
Phase 1 (Current)
- Weight log UI + persistence
- Meal log UI + persistence
- Save & Load from JSON
Phase 2
- Weight evolution line chart
- CSV export of all entries
- Date-range filters
Phase 3
- JSON import (merge vs overwrite)
- Responsive mobile-first refinements
- Docker & Coolify deployment docs
Phase 4
- Theming (light/dark)
- Localization support
- Migration guide
License
MIT License
Privacy Policy
This application does not collect any personal data. All data you enter remains on your device.