Skip to content

MedTracker App that showcase our UI & UX Design of the App

Notifications You must be signed in to change notification settings

collinxander/Medtracker-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MedTrack - Personal Health Log Application

A multi-user JavaFX desktop application for secure health tracking with user authentication and personalized health data management.

Overview

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.

Features

🔐 User Authentication (NEW!)

  • 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

📋 Log New Entries

  • 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

📊 View Health History

  • 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

📈 Visualize Health Trends

  • 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

🏠 Dashboard Home Screen

  • 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

Technology Stack

  • 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

Requirements

  • 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)

Installation & Setup

Note: If the JavaFX SDK is not included or needs to be downloaded, see SETUP.md for detailed installation instructions.

Quick Start (macOS/Linux)

# Navigate to the project directory
cd MEDTRACKER

# Make scripts executable (first time only)
chmod +x run.sh build.sh

# Run the application
./run.sh

Quick Start (Windows)

# 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

Manual Compilation

# From the project directory
javac -cp javafx-sdk/lib:. *.java

Manual Execution

java --module-path javafx-sdk/lib --add-modules javafx.controls,javafx.graphics,javafx.fxml MedTrack

Project Structure

MEDTRACKER/
├── 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)

Usage Guide

First-Time Setup

  1. Launch the application
  2. Click the "Create Account" tab
  3. Fill in your information:
    • Full Name
    • Email Address
    • Username (must be unique)
    • Password (minimum 6 characters)
    • Confirm your password
  4. Click "Create Account"
  5. Return to the "Sign In" tab and log in with your credentials

Recording Health Data

  1. From the home screen, click "Log Vitals"
  2. Enter the current date (format: YYYY-MM-DD)
  3. 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
  4. Click "Save Entry"
  5. Your data is automatically saved to your personal health file

Viewing Your Health History

  1. From the home screen, click "View History"
  2. Browse your entries in the table
  3. View summary statistics at the top:
    • Total entries recorded
    • Average heart rate
    • Average glucose level
  4. Click the "Delete" button next to any entry to remove it (with confirmation)

Tracking Health Trends

  1. From the home screen, click "Health Charts"
  2. View interactive charts showing:
    • Heart Rate Trends: Your HR variations over time
    • Glucose Trends: Your blood sugar levels
    • Weight Trends: Your weight changes
  3. Charts automatically update as you add new data

Logging Out

  1. From the home screen, click the "Sign Out" button
  2. You'll be returned to the login screen
  3. Your health data remains safe in your personal user file
  4. You can log in again with the same credentials

Data Storage

  • 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

users.csv

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

user_data/{username}_health_data.csv

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"

Validation Rules

  • 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

Keyboard Shortcuts

  • 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)

Troubleshooting

"JavaFX not found" error

  • 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

"Class not found" error

  • 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

Application crashes on startup

  • 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

Can't log in

  • 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

Data not saving

  • 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

For Developers

Adding a New Vital

  1. Add getter/setter to HealthEntry.java
  2. Update CSV header in DataManager.saveData()
  3. Add parser in DataManager.loadData()
  4. Add input field in LogEntryScreen.java
  5. Add column in HistoryScreen.java table
  6. Add chart in ChartsScreen.java if trending data

MVC Architecture

The application follows a strict Model-View-Controller pattern:

Model Layer

  • User.java: Represents user credentials and profile
  • HealthEntry.java: Represents a single health record

View Layer

  • 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

Controller Layer

  • MedTrack.java: Main application controller
    • Manages screen navigation
    • Handles user sessions
    • Orchestrates data loading/saving

Service Layer

  • 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.

Code Patterns

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();

Future Enhancements

  • 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

Contributors

  • 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

Testing

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

To Test:

  1. Create multiple user accounts
  2. Log in as different users and add data
  3. Verify data is separate for each user
  4. Test all navigation features
  5. Add, view, and delete health entries
  6. Check that charts update correctly
  7. Verify logout properly clears session

Demo Video Highlights

  • 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

License

This project is created for educational purposes as part of a university course.

Support

For issues or questions:

  1. Check the Troubleshooting section above
  2. Review UML_DIAGRAM.md for architecture details
  3. Examine JavaDoc comments in source files
  4. Check data files for corruption: users.csv and user_data/ directory

Version: 2.0 (Multi-User with Authentication) Last Updated: January 2025 Status: Production Ready

About

MedTracker App that showcase our UI & UX Design of the App

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published