https://github.com/kurulko/workout-tracker
Web application to track your fitness progress
https://github.com/kurulko/workout-tracker
angular asp-net-core asp-net-core-identity asp-net-core-web-api automapper clean-architecture entity-framework-core html-css jwt netcore swagger typescript xunit
Last synced: 3 months ago
JSON representation
Web application to track your fitness progress
- Host: GitHub
- URL: https://github.com/kurulko/workout-tracker
- Owner: Kurulko
- Created: 2024-09-27T04:48:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-03T13:14:50.000Z (about 1 year ago)
- Last Synced: 2025-10-12T00:48:11.440Z (8 months ago)
- Topics: angular, asp-net-core, asp-net-core-identity, asp-net-core-web-api, automapper, clean-architecture, entity-framework-core, html-css, jwt, netcore, swagger, typescript, xunit
- Language: C#
- Homepage:
- Size: 13.9 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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](#features)
- [Technologies Used](#technologies-used)
- [Project Structure](#project-structure)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Environment Configuration](#environment-configuration)
- [Running](#running)
- [API Documentation](#api-documentation)
- [Internal Pages](#internal-pages)
---
## 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.
7. **Admin Dashboard**
- Manage users and roles.
- Impersonate users.
8. **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:
```
```
### **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.

- Filtered by name:

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


#### 3. Create Workout Page (`/workout`)

#### 4. Workout Details Page (`/workout/{id}/details`)
General information, exercises and calendar with records.


### 2. Progress Page (`/progress`)
Shows your total progress in a table, chart and calendar.

### 3. Exercise Pages
#### 1. Exercises Page (`/exercises`)
Lists logged exercises.
- #### All
Your and internal exercises


- #### Yours
Your exercises

- #### Internal
Internal exercises

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


#### 3. Create Exercise Pages
#### Yours - `/your-exercise`
#### Internal - `/exercise`


#### 4. Exercise Details Page (`/exercise/{id}/details`)
General information, workouts, records and calendar with records.


### 4. Equipment Pages
#### 1. Equipments Page (`/equipments`)
Lists logged equipments with edit and create options.
- #### All
Your and internal equipments

- #### Yours
Your equipments

- #### Internal
Internal equipments

#### 2. Equipment Details Page (`/equipment/{id}/details`)
Its muscles and exercises.

### 5. Muscle Pages
#### 1. Muscles Page (`/muscles`)
Lists logged muscles.

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

#### 3. Create Muscle Page (`/muscle`)

#### 4. Muscle Details Page (`/muscle/{id}/details`)
Its parent and child muscles, exercises and muscle sizes.


### 6. Account (`/account`)
Shows your preferable measurements and links to other account related pages.

### 7. Profile (`/profile`)
Change your name and/or email.

### 8. Password (`/password`)
Change your current password.

### 9. Personal Data (`/personal-data`)
Change your personal data.

### 10. Muscle Size Pages
#### 1. Muscle Sizes Page (`/muscle-sizes`)
Lists logged muscle sizes with charts.


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

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

### 11. Body Weight Pages
#### 1. Body Weights Page (`/body-weights`)
Lists logged body weights with charts.


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

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

### 12. Exercise Record Pages
#### 1. Exercise Records Page (`/exercise-records`)
Lists logged exercise records with charts.


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

### 14. Workout Record Pages
#### 1. Workout Records Page (`/workout-records`)
Lists logged workout records with charts.


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


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

#### 4. Workout Record Details Page (`/workouts/{workoutId}/workout-record-details/{id}`)
General information and records.

### 15. User Pages
#### 1. Users Page (`/users`)
Lists logged users with impersonate option.



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

#### 3. Create Users Page (`/user`)

### 16. Role Pages
#### 1. Roles Page (`/users`)
Lists logged roles with edit and add options.

#### 2. Role Details Page (`/role/{id}/details`)
Users with this role

### 17. Login Page (`/login`)

### 18. Register Page (`/register`)



### 19. Logout (`/logout`)
### 20. Not Found
