A mobile-optimized web application for tracking and visualizing weight data with secure user authentication.
- About
- Features
- Screenshots
- Technologies
- Project Structure
- Deployment Instructions
- Environment Variables
- Development Instructions
- Data Import/Export
- API Reference
- Roadmap
- Contributing
- License
ScaleTrack is designed for individuals who want to monitor their weight changes over time. The application provides an intuitive interface for recording weight measurements, viewing historical data in a table, and visualizing trends through interactive charts.
ScaleTrack is designed for:
- Health-conscious individuals tracking their weight as part of a fitness journey
- People with specific health goals who need to monitor weight fluctuations
- Fitness coaches who want a simple tool to track client progress
- Anyone interested in logging and analyzing their weight data over time
Currently, deployment requires basic knowledge of Docker and Docker Compose as the project is in an early development stage.
- User Authentication: Secure multi-user system with registration and login
- Password Recovery: Self-service password reset via email
- Mobile-optimized UI: Responsive design works great on smartphones and tablets
- Data Input: Simple form for recording weight values with optional notes
- Data Visualization: Interactive chart showing weight trends over time with floor/ceiling guidelines
- Data Table: Comprehensive table view of all recorded entries
- Secure Data Storage: Each user can only access their own data
- Data Filtering: Filter chart data by date ranges
- Data Export: Export chart visualizations as images
- Data Import: Import weight data from Excel files (see Import/Export section)
- Dark Mode: Support for light and dark themes
- User Settings: Customize application behavior and display preferences
Home Screen - Weight Input |
Chart Visualization |
Data Table View |
User Settings |
Login Screen |
Excel Data Import |
- Frontend: Next.js 14+ with TypeScript and Tailwind CSS
- Database: SQLite with Prisma ORM
- Authentication: NextAuth.js for secure user management
- Visualization: Chart.js with react-chartjs-2
- API: Next.js API Routes
- Containerization: Docker support for easy deployment
- Docker and Docker Compose
- Git
- SMTP server details (for password reset functionality)
-
Clone the repository:
git clone https://github.com/BadWinniePooh/weight-tracking.git cd weight-tracking -
Create and configure the
.envfile according to the environment variables section -
Adjust the docker compose yaml to your needs (add labels for traefik, etc.)
-
Build and run the container:
docker-compose up -d --build
-
Access the application at http://localhost:3000 (or your configured domain)
-
To stop the container:
docker-compose down
Create a .env file in the root directory with the following variables:
NODE_ENV=production
# Database configuration
## Default development path:
# DATABASE_URL="file:./prisma/dev.db?connection_limit=1"
## Default production path:
DATABASE_URL="file:/app/data/weight-tracking.db"
# NextAuth.js configuration
NEXTAUTH_SECRET=your-nextauth-secret-key-change-in-production
NEXTAUTH_URL=http://localhost:3000
# Email configuration (for password reset)
EMAIL_SERVER_HOST=smtp.example.com
EMAIL_SERVER_PORT=587
[email protected]
EMAIL_SERVER_PASSWORD=your-email-password
[email protected]
EMAIL_SERVER_SECURE=false
# Timezone configuration
# Use IANA timezone names: Europe/Berlin for Germany (MEZ/CET)
TIMEZONE="Europe/Berlin"
- NODE_ENV: Sets application environment (production/development)
- DATABASE_URL: Connection string for your database (Prisma by default)
- NEXTAUTH_SECRET: A random string used to encrypt cookies and tokens (use a secure random generator)
- NEXTAUTH_URL: The base URL of your deployed application
- EMAIL_SERVER_*: SMTP settings for sending password reset emails
- EMAIL_FROM: The "from" address for outgoing emails
- EMAIL_SERVER_SECURE: TLS setting for connection security (check with your provider whether TLS (true) is used)
- TIMEZONE: Default timezone for date calculations and display
-
Clone the repository:
git clone https://github.com/BadWinniePooh/weight-tracking.git cd weight-tracking -
Install dependencies:
npm install
-
Create a
.env.localfile based on the example above, using:DATABASE_URL="file:./prisma/dev.db?connection_limit=1" NEXTAUTH_SECRET=any-random-string-for-development NEXTAUTH_URL=http://localhost:3000 -
Set up the database:
npx prisma migrate dev
-
Start the development server:
npm run dev
-
Open http://localhost:3000 in your browser
-
View your database with Prisma Studio:
npx prisma studio
-
Create a migration after schema changes:
npx prisma migrate dev --name your_migration_name
-
Reset database (deletes all data):
npx prisma migrate reset
ScaleTrack allows you to import weight data from Excel files:
- Navigate to the Import page (
/import) - Upload an Excel file (.xlsx) containing your weight data
- The system expects columns for date and weight measurements (up to 3 per day) with one line for headers
| date | measurement 1 | measurement 2 | measurement 3 |
|---|---|---|---|
| 11.08.2024 | 102.4 | 104.4 | |
| 12.08.2024 | ... | ... | ... |
You can export your data in the following formats:
- Chart Export: From the Chart page, use the export button to save the visualization as a PNG image
Future development plans include in no particular order:
- Add image upload of scale (7 segment display) as alternative input method
- Docker image published to docker hub
- Table export to CSV/Excel
- Multi-language support
- Design improvements
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.