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
- 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).
| Item | Details |
|---|---|
| OS | Windows 7 or later |
| Runtime | .NET Framework 4.7.2+ |
| IDE (optional) | Visual Studio 2017+ |
| Packages | None (Windows Forms only) |
git clone https://github.com/Saidul00005/Fitness-Tracker.git
cd "Fitness Tracker"Or download the ZIP from GitHub and extract it.
- Start Visual Studio.
- Use File, then Open, then Project/Solution.
- Open
Fitness Tracker.csproj. - Build with Ctrl+Shift+B (menu: Build, then Build Solution).
- Run with F5.
After a Debug build:
bin\Debug\Fitness Tracker.exe
For Release builds, use bin\Release\ instead.
- Open the app and choose Register.
- Username - letters and numbers only (see
Validation.cs). - Password - exactly 12 characters, at least one uppercase and one lowercase letter.
- Return to the login screen and sign in.
Failed logins are counted; after three failures you get a security warning.
- Enter a Calorie Goal and click Set Goal.
- Pick an Activity Type and fill in the three metric fields (labels change per type).
- Click Add Activity to append to your history and update totals.
- Use View Progress for a detailed report.
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.
- Register as
john123with passwordMyPassword21. - Log in and set goal to 500 calories.
- Add walking: 5000 steps, 2.5 km, 30 min ->
(5000 * 0.04) + (2.5 * 50)= 325 cal. - Add swimming: 10 laps, 45 min, 130 bpm ->
(10 * 30) + (45 * 8) + (130 * 0.5)= 620 cal. - Total 945 calories (goal exceeded).
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
- OOP -
Activityis abstract; each sport is a subclass with its own calorie logic. - Layers - Forms handle UI;
UserManagerandValidationhandle auth rules;Userholds session data. - Flow -
Program->UserManager->LoginForm->MainForm-> optionalProgressForm.
| 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. |
- Fork the repo.
- Create a branch for your change.
- Commit and push.
- Open a pull request on GitHub.
Free and open source under the MIT License.
Mohammad Sayadul Hoque
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.