A multi-user JavaFX desktop application for secure health tracking with user authentication and personalized health data management.
MedTrack is a comprehensive health tracking system that allows users to:
- Create secure user accounts with password protection
- Log personal health vitals (blood pressure, heart rate, glucose, weight, etc.)
- View their health history with statistics
- Visualize health trends using interactive charts
- Manage their health data with full privacy separation between users
The application strictly follows the Model-View-Controller (MVC) design pattern with clear separation of concerns and is fully documented.
- Secure Registration: Create new user accounts with email and profile information
- Login System: Sign in with username and password (SHA-256 encrypted)
- Session Management: Logout functionality to securely end sessions
- User-Specific Data: Each user's health data is completely isolated and private
- Password Security: Passwords are hashed using SHA-256, never stored in plain text
-
Record daily health vitals including:
- Date: When the measurements were taken
- Blood Pressure: Format (e.g., 120/80)
- Heart Rate: Beats per minute (30-200 bpm)
- Glucose: Blood sugar levels (20-600 mg/dL)
- Weight: Body weight in kg (20-300 kg)
- Medications: Record current medications
- Notes: Additional health observations
-
Built-in validation for all numeric fields
-
Real-time error messages to guide users
-
Automatic data persistence to user-specific CSV file
- Browse all logged health entries in a sortable table
- View all vitals at a glance: date, BP, HR, glucose, weight, medications, and notes
- Statistics panel showing:
- Total number of entries
- Average heart rate
- Average glucose level
- Delete entries with confirmation dialog
- Entries sorted chronologically
- Interactive line charts showing health trends over time
- Heart Rate Chart: Track HR variations day by day
- Glucose Chart: Monitor blood sugar levels
- Weight Chart: Track weight changes over time
- All charts use consistent date-based timeline
- Quick navigation to all major features
- Visual cards for intuitive access
- Display of currently logged-in user
- Health tracking tips and guidance
- Logout button for session management
- Language: Java 25.0.1+
- GUI Framework: JavaFX 25.0.1+
- Data Storage: CSV (users.csv and per-user health_data.csv files)
- Security: SHA-256 password hashing
- Architecture: Model-View-Controller (MVC) pattern
- Java Development Kit (JDK): Java 20+ (tested with Java 25.0.1)
- JavaFX SDK: Version 25.0.1+ (included in javafx-sdk directory)
- Operating System: macOS, Windows, or Linux with Java support
- Memory: Minimum 512MB RAM (1GB+ recommended)
- Disk Space: Minimal (~50MB for application and dependencies)
Note: If the JavaFX SDK is not included or needs to be downloaded, see SETUP.md for detailed installation instructions.
# Navigate to the project directory
cd MEDTRACKER
# Make scripts executable (first time only)
chmod +x run.sh build.sh
# Run the application
./run.sh# Navigate to the project directory
cd MEDTRACKER
# Run the application
java --module-path javafx-sdk/lib --add-modules javafx.controls,javafx.graphics,javafx.fxml MedTrack# From the project directory
javac -cp javafx-sdk/lib:. *.javajava --module-path javafx-sdk/lib --add-modules javafx.controls,javafx.graphics,javafx.fxml MedTrackMEDTRACKER/
├── MedTrack.java (Main Controller - Application lifecycle)
├── User.java (Model - User credentials and profile)
├── HealthEntry.java (Model - Single health record)
├── UserManager.java (Service - Authentication and user management)
├── DataManager.java (Service - Data persistence)
├── LoginScreen.java (View - Login and registration)
├── HomeScreen.java (View - Main dashboard)
├── LogEntryScreen.java (View - Health entry form)
├── HistoryScreen.java (View - History table and stats)
├── ChartsScreen.java (View - Health trend visualizations)
├── users.csv (Data file - User accounts)
├── user_data/ (Directory - Per-user health data)
│ ├── username1_health_data.csv
│ ├── username2_health_data.csv
│ └── ...
├── javafx-sdk/ (JavaFX library)
├── README.md (This file)
├── UML_DIAGRAM.md (Architecture and design documentation)
├── build.sh (Build script)
└── run.sh (Run script)
- Launch the application
- Click the "Create Account" tab
- Fill in your information:
- Full Name
- Email Address
- Username (must be unique)
- Password (minimum 6 characters)
- Confirm your password
- Click "Create Account"
- Return to the "Sign In" tab and log in with your credentials
- From the home screen, click "Log Vitals"
- Enter the current date (format: YYYY-MM-DD)
- Fill in your health measurements:
- Blood Pressure (e.g., "120/80")
- Heart Rate (beats per minute)
- Glucose level
- Current weight
- Any medications you're taking
- Additional notes
- Click "Save Entry"
- Your data is automatically saved to your personal health file
- From the home screen, click "View History"
- Browse your entries in the table
- View summary statistics at the top:
- Total entries recorded
- Average heart rate
- Average glucose level
- Click the "Delete" button next to any entry to remove it (with confirmation)
- From the home screen, click "Health Charts"
- View interactive charts showing:
- Heart Rate Trends: Your HR variations over time
- Glucose Trends: Your blood sugar levels
- Weight Trends: Your weight changes
- Charts automatically update as you add new data
- From the home screen, click the "Sign Out" button
- You'll be returned to the login screen
- Your health data remains safe in your personal user file
- You can log in again with the same credentials
- User accounts stored in
users.csv(global file) - Each user's health data stored in
user_data/{username}_health_data.csv - CSV format follows RFC 4180 with quoted fields for safety
- Files are automatically created on first save
- Backup your data files regularly for safety
Global file storing user account information:
- username: Unique identifier
- passwordHash: SHA-256 encrypted password
- fullName: User's full name
- email: Contact email
Format:
username,passwordHash,fullName,email
john_doe,a6e5e69f...,John Doe,john@example.com
jane_smith,b7f6f70g...,Jane Smith,jane@example.com
Individual files for each user's health data:
- Located in
user_data/directory - One file per user:
{username}_health_data.csv - Contains all health entries for that user
Format:
date,bloodPressure,heartRate,glucose,weight,medications,notes
2025-01-15,120/80,72,95,70.5,"Aspirin","Feeling well"
2025-01-16,118/79,70,98,70.3,"Aspirin","Good day"
- Date: Must be a valid calendar date (YYYY-MM-DD)
- Blood Pressure: Format XX/XX (two numbers separated by /)
- Heart Rate: Must be 30-200 bpm
- Glucose: Must be 20-600 mg/dL
- Weight: Must be 20-300 kg
- Username: Must be unique, alphanumeric
- Password: Minimum 6 characters, hashed with SHA-256
- Medications & Notes: Text with special character escaping
- Alt+H: Home screen
- Alt+L: Log Entry screen
- Alt+V: View History screen
- Alt+C: Charts screen
(Keyboard shortcuts can be added in future versions)
- Ensure
javafx-sdk/directory is in the project folder - Check that JavaFX SDK version 25.0.1+ is installed
- Verify the module path is set correctly
- Compile all Java files:
javac -cp javafx-sdk/lib:. *.java - Ensure all .class files are in the same directory
- Check that there are no typos in class names
- Verify Java version is 20 or higher:
java --version - Check that users.csv and user_data/ directory have write permissions
- Ensure JavaFX library files are not corrupted
- Verify username and password are correct (case-sensitive)
- Check that users.csv file exists and is readable
- Ensure password meets minimum requirements (6+ characters)
- Try resetting by deleting users.csv and recreating account
- Verify write permissions on the project directory
- Check that user_data/ directory exists (auto-created on first use)
- Ensure disk space is available
- Restart the application and try again
- Add getter/setter to
HealthEntry.java - Update CSV header in
DataManager.saveData() - Add parser in
DataManager.loadData() - Add input field in
LogEntryScreen.java - Add column in
HistoryScreen.javatable - Add chart in
ChartsScreen.javaif trending data
The application follows a strict Model-View-Controller pattern:
- User.java: Represents user credentials and profile
- HealthEntry.java: Represents a single health record
- LoginScreen.java: User authentication interface
- HomeScreen.java: Main dashboard
- LogEntryScreen.java: Health entry form
- HistoryScreen.java: History table and statistics
- ChartsScreen.java: Health trend visualizations
- MedTrack.java: Main application controller
- Manages screen navigation
- Handles user sessions
- Orchestrates data loading/saving
-
UserManager.java: User authentication and management
- User registration with validation
- Login authentication with SHA-256 verification
- Password hashing and verification
- User file I/O
-
DataManager.java: Data persistence
- CSV reading/writing with proper escaping
- CSV parsing with special character handling
- File I/O for user-specific health data
See UML_DIAGRAM.md for complete architecture documentation with diagrams.
Navigation: Use app.showXScreen() methods
app.showHomeScreen();
app.showLogEntryScreen();Adding Data: Create HealthEntry and call:
HealthEntry entry = new HealthEntry(date, bp, hr, glucose, weight, meds, notes);
app.addHealthEntry(entry);Accessing Data: All screens can get data via:
List<HealthEntry> entries = app.getHealthLogs();- Export data to PDF reports
- Health alert notifications
- Doctor/health provider sharing
- Dark mode theme
- Advanced analytics and statistics
- Integration with health APIs
- Two-factor authentication
- Cloud backup option
- Team: N-Team
- Developers:
- Collin Arnsworth
- Chinedum Akunne
- Zachary Machani
- Lucia Njemanze
- Roles: Full-stack development (Frontend, Backend, Authentication, Database)
- Project: MedTrack - Personal Health Log Application
- Date: December 2025
The application has been tested with:
- Multiple user accounts with various passwords
- Various health data sets and edge cases
- CSV round-trip (save and reload with special characters)
- Chart generation with edge case data
- Login/logout cycles
- Data isolation between users
- Concurrent user scenarios
- Create multiple user accounts
- Log in as different users and add data
- Verify data is separate for each user
- Test all navigation features
- Add, view, and delete health entries
- Check that charts update correctly
- Verify logout properly clears session
- Quick overview of app purpose and key features
- Live registration and login with credentials
- Recording multiple health entries as a user
- Navigation through all screens
- Viewing and filtering health history
- Visualizing trends with charts
- Logging out and switching to another user
- CSV data persistence demonstration
This project is created for educational purposes as part of a university course.
For issues or questions:
- Check the
Troubleshootingsection above - Review
UML_DIAGRAM.mdfor architecture details - Examine JavaDoc comments in source files
- Check data files for corruption:
users.csvanduser_data/directory
Version: 2.0 (Multi-User with Authentication) Last Updated: January 2025 Status: Production Ready