Skip to content

About

A Windows desktop application built with C# and Windows Forms that helps users track their fitness activities and monitor progress toward their personal calorie-burning goals.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Fitness Tracker

Windows desktop app built with C# and Windows Forms. Register an account, log workouts, set a calorie goal, and see whether you are on track.

Repository: github.com/Saidul00005/Fitness-Tracker

What it does

  • Accounts - Register and log in with username/password rules enforced in code.
  • Goals - Set a daily calorie-burn target on the dashboard.
  • Activities - Log walking, swimming, running, cycling, yoga, or weight training; calories are computed per activity type.
  • Progress - View totals on the main form and open the progress report for a breakdown.

Data lives in memory for the current session only (no database).

Requirements

Item Details
OS Windows 7 or later
Runtime .NET Framework 4.7.2+
IDE (optional) Visual Studio 2017+
Packages None (Windows Forms only)

Quick start

Get the code

git clone https://github.com/Saidul00005/Fitness-Tracker.git
cd "Fitness Tracker"

Or download the ZIP from GitHub and extract it.

Open in Visual Studio

  1. Start Visual Studio.
  2. Use File, then Open, then Project/Solution.
  3. Open Fitness Tracker.csproj.
  4. Build with Ctrl+Shift+B (menu: Build, then Build Solution).
  5. Run with F5.

Run the executable

After a Debug build:

bin\Debug\Fitness Tracker.exe

For Release builds, use bin\Release\ instead.

Using the app

Register

  1. Open the app and choose Register.
  2. Username - letters and numbers only (see Validation.cs).
  3. Password - exactly 12 characters, at least one uppercase and one lowercase letter.
  4. Return to the login screen and sign in.

Failed logins are counted; after three failures you get a security warning.

Dashboard

  1. Enter a Calorie Goal and click Set Goal.
  2. Pick an Activity Type and fill in the three metric fields (labels change per type).
  3. Click Add Activity to append to your history and update totals.
  4. Use View Progress for a detailed report.

Activity types and formulas

All formulas are implemented in Activity.cs as CalculateCalories().

Activity Metric 1 Metric 2 Metric 3 Calories
Walking steps distance (km) time (min) (steps * 0.04) + (distance * 50)
Swimming laps time (min) avg heart rate (laps * 30) + (time * 8) + (heart rate * 0.5)
Running distance (km) time (min) pace (min/km) (distance * 100) + (time * 10)
Cycling distance (km) time (min) speed (km/h) (distance * 40) + (time * 7)
Yoga duration (min) intensity (1-10) pose count (duration * 3) + (intensity * 15) + (poses * 2)
Weight Training duration (min) sets avg weight (kg) (duration * 6) + (sets * 10) + (weight * 0.5)

Note: Running, cycling, yoga, and weight training use three inputs in the UI; the running and cycling formulas in code currently use only the first two metrics.

Example session

  1. Register as john123 with password MyPassword21.
  2. Log in and set goal to 500 calories.
  3. Add walking: 5000 steps, 2.5 km, 30 min -> (5000 * 0.04) + (2.5 * 50) = 325 cal.
  4. Add swimming: 10 laps, 45 min, 130 bpm -> (10 * 30) + (45 * 8) + (130 * 0.5) = 620 cal.
  5. Total 945 calories (goal exceeded).

Project layout

Fitness Tracker/
  Program.cs           Entry point
  LoginForm.cs         Login and registration UI
  MainForm.cs          Dashboard and activity logging
  ProgressForm.cs      Progress report UI
  User.cs              User model and calorie totals
  Activity.cs          Activity base class and types
  UserManager.cs       Registration and authentication
  Validation.cs        Username and password rules
  Fitness Tracker.csproj
  LICENSE                MIT License

Architecture (short)

  • OOP - Activity is abstract; each sport is a subclass with its own calorie logic.
  • Layers - Forms handle UI; UserManager and Validation handle auth rules; User holds session data.
  • Flow - Program -> UserManager -> LoginForm -> MainForm -> optional ProgressForm.

Troubleshooting

Problem What to try
Build errors Install .NET Framework 4.7.2 targeting pack; check project properties for target framework 4.7.2.
Password rejected Use exactly 12 characters with upper and lower case.
Cannot add activity All three metric fields must be valid numbers.
Locked after 3 failed logins Restart the application.
App will not start Run as administrator or check Windows compatibility settings.

Contributing

  1. Fork the repo.
  2. Create a branch for your change.
  3. Commit and push.
  4. Open a pull request on GitHub.

License

Free and open source under the MIT License.

Author

Mohammad Sayadul Hoque

FAQ

Can I run this on macOS or Linux?
No. It depends on Windows Forms. A cross-platform UI (for example .NET MAUI) would require a port.

Is data saved when I close the app?
Not today. Everything is in-memory until you add persistence (file or database).

How do I change password rules?
Edit Validation.cs.

How do I add a new activity type?
Add a class in Activity.cs, wire it in MainForm.CreateActivity, and add it to the activity combo box.

About

A Windows desktop application built with C# and Windows Forms that helps users track their fitness activities and monitor progress toward their personal calorie-burning goals.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages