8000 GitHub - Kurulko/Workout-Tracker: Web application to track your fitness progress
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Kurulko/Workout-Tracker

Repository files navigation

WorkoutTracker

WorkoutTracker is a web application designed to help users track their fitness progress through workouts, exercises, body and muscle measurements, and more. It offers a seamless experience through an Angular frontend and a .NET Core backend, providing robust tracking and reporting features.


Table of Contents


Features

WorkoutTracker provides the following features:

  1. User Authentication and Authorization

    • Secure user registration and login with JWT-based authentication.
    • Role-based access control (admin/user roles).
    • Password management (change/reset).
  2. Workout Tracking

    • Log exercises with sets, reps, weight, and duration.
    • View workout history and track progress over time.
    • Add personal workout routines.
  3. Muscles, Exercises and Equipments Management

    • View muscles, exercises and equipments and filter them.
    • Create your own exercises and equipments.
  4. Body and Muscle Measurements Tracking

    • Record weight and muscle measurements over time.
    • Progress visualization via charts.
  5. User Profile Management

    • Update your username and email.
    • Update profile details and preferences.
  6. Admin Dashboard

    • Manage users and roles.
    • Impersonate users.
  7. Responsive Design

    • Mobile-friendly interface with Angular Material.

Technologies Used

Back-end (ASP.NET Core)

  • ASP.NET Core 6 - Backend API framework.
  • Entity Framework Core 6 - Database interaction and ORM.
  • Microsoft SQL Server - Relational database storage.
  • AutoMapper - Object-to-object mapping.
  • xUnit - Unit testing framework.
  • Newtonsoft.Json - JSON processing
  • Swagger - API documentation
  • Logging: Serilog
  • Authentication: JWT (JSON Web Token)

Back-end Packages:

 <ItemGroup>
    <PackageReference Include="AutoMapper" Version="13.0.1" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.0" />
    <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.0" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.0" />
    <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
    <PackageReference Include="Serilog.Settings.Configuration" Version="7.0.0" />
    <PackageReference Include="Serilog.Sinks.MSSqlServer" Version="6.0.0" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
    <PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.5" />
  </ItemGroup>

Front-end (Angular)

  • Angular 16 - Component-based frontend framework.
  • Angular Material - UI components and responsive design.
  • RxJS - Reactive programming with observables.
  • SCSS - CSS preprocessor for styling.
  • Angular Router - Client-side navigation.
  • Charts: Chart.js with ng2-charts
  • Styling: Bootstrap 5

Front-end Dependencies:

"dependencies": {
  "@angular/material": "^16.2.14",
  "chart.js": "^3.9.1",
  "ng2-charts": "^4.1.1",
  "bootstrap": "^5.3.3"
}

Prerequisites

To run the project, make sure you have the following installed:

  • Node.js (v18+) - JavaScript runtime for running Angular.
  • Angular CLI (16+) - CLI tool to manage Angular apps.
  • .NET 6 SDK - Required to run the backend.
  • SQL Server - Database for data persistence.
  • Git - Version control.
  • npm - Node Package Manager.

Project Structure

  • Back-End (API): WorkoutTrackerAPI (ASP.NET Core 6.x)
  • Front-End: WorkoutTracker (Angular 16.x)
  • Tests: WorkoutTrackerAPI.Tests (xUnit)

All parts of the project are included in a single solution folder.


Installation

Step 1: Clone the repository

git clone https://github.com/Kurulko/Workout-Tracker.git
cd WorkoutTracker

Step 2: Install Back-End Dependencies

1. Navigate to the WorkoutTrackerAPI directory:

cd WorkoutTrackerAPI

2. Restore the .NET dependencies:

dotnet restore

Step 3. Install Front-End Dependencies:

1. Navigate to the WorkoutTracker directory:

cd ../WorkoutTracker

2. Install the necessary dependencies for the Angular project:

npm install

Environment Configuration

Back-end (ASP.NET)

Modify settings in WorkoutTrackerAPI/appsettings.json

Configure appsettings.json

1. In the WorkoutTrackerAPI project, locate or create the appsettings.json file in the root folder.
2. Add your sensitive settings (e.g., connection strings, JWT settings) to appsettings.json:
{
  "ConnectionStrings": {
    "DefaultConnection": "Server=(localdb)\\mssqllocaldb; Database=Workout; MultipleActiveResultSets=True;"
  },

  "JwtSettings": {
    "SecretKey": "your-secret-key",
    "Issuer": "your-issuer",
    "Audience": "your-audience",
    "ExpirationDays": 7
  },

  "Admin": {
    "Name": "YourName",
    "Email": "youremail@email.com",
    "Password": "your-password"
  }
}

Front-end (Angular)

Configure Environment Variables

1. Modify WorkoutTracker/src/environments/environment.prod.ts:
export const environment = {
  production: true,
  apiUrl: 'https://your-production-api-url/api'
};
2. Modify WorkoutTracker/src/proxy.conf.js:
const PROXY_CONFIG = [
  {
    context: [
      "/api",
      "/resources"
    ],
    target: "https://your-production-api-url/api",
    secure: false,
  }
]

module.exports = PROXY_CONFIG;

Running

Back-End (ASP.NET Core)

1. Navigate to the WorkoutTrackerAPI directory and run the back-end:

cd WorkoutTrackerAPI
dotnet run

This will start your back-end server

Front-End (Angular)

1. Navigate to the WorkoutTracker directory and run the Angular application:

cd ../WorkoutTracker
ng serve

The Angular application will be available at http://localhost:4200.

API Documentation

The backend API documentation is available via Swagger:

Swagger URL: https://your-production-api-url/swagger Swagger provides endpoints documentation and testing capabilities.

Internal Pages

1. Workout Pages

1. Workouts Page (/workouts)

  • Lists logged workouts. image
  • Filtered by name: image

2. Edit Workout Page (/workout/{id})

image image

3. Create Workout Page (/workout)

image

4. Workout Details Page (/workout/{id}/details)

General information, exercises and calendar with records. image image

2. Progress Page (/progress)

Shows your total progress in a table, chart and calendar. image

3. Exercise Pages

1. Exercises Page (/exercises)

Lists logged exercises.

  • All

Your and internal exercises image image

  • Yours

Your exercises image

  • Internal

Internal exercises image

2. Edit Exercise Page (/exercise/{id})

image image

3. Create Exercise Pages

Yours - /your-exercise

Internal - /exercise

image image

4. Exercise Details Page (/exercise/{id}/details)

General information, workouts, records and calendar with records.

image image

4. Equipment Pages

1. Equipments Page (/equipments)

Lists logged equipments with edit and create options.

  • All

Your and internal equipments image

  • Yours

Your equipments image

  • Internal

Internal equipments image

2. Equipment Details Page (/equipment/{id}/details)

Its muscles and exercises.

image

5. Muscle Pages

1. Muscles Page (/muscles)

Lists logged muscles. image

2. Edit Muscle Page (/muscle/{id})

image

3. Create Muscle Page (/muscle)

image

4. Muscle Details Page (/muscle/{id}/details)

Its parent and child muscles, exercises and muscle sizes.

image image

6. Account (/account)

Shows your preferable measurements and links to other account related pages. image

7. Profile (/profile)

Change your name and/or email. image

8. Password (/password)

Change your current password. image

9. Personal Data (/personal-data)

Change your personal data. image

10. Muscle Size Pages

1. Muscle Sizes Page (/muscle-sizes)

Lists logged muscle sizes with charts. image image

2. Edit Muscle Size Page (/muscle-size/{id})

image

3. Create Muscle Size Page (/muscle-size)

image

11. Body Weight Pages

1. Body Weights Page (/body-weights)

Lists logged body weights with charts. image image

2. Edit Body Weight Page (/body-weight/{id})

image

3. Create Body Weight Page (/body-weight)

image

12. Exercise Record Pages

1. Exercise Records Page (/exercise-records)

Lists logged exercise records with charts. image image

2. Edit Exercise Record Page (/exercise-record/{id})

image

14. Workout Record Pages

1. Workout Records Page (/workout-records)

Lists logged workout records with charts. image image

2. Edit Workout Record Page (workouts/{workoutId}/workout-record/{id})

image image

3. Create Workout Record Page (/workout-record or workouts/{workoutId}/workout-record)

image

4. Workout Record Details Page (/workouts/{workoutId}/workout-record-details/{id})

General information and records. image

15. User Pages

1. Users Page (/users)

Lists logged users with impersonate option. image image image

2. Edit Users Page (user/{id})

image

3. Create Users Page (/user)

image

16. Role Pages

1. Roles Page (/users)

Lists logged roles with edit and add options. image

2. Role Details Page (/role/{id}/details)

Users with this role image

17. Login Page (/login)

image

18. Register Page (/register)

image image image

19. Logout (/logout)

20. Not Found

image

0