Skip to content

A project completely generated via claude code, whithout writing a single line of code by myself

Notifications You must be signed in to change notification settings

deck-dev/WorkoutTracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Workout Tracker Application

A comprehensive workout plan manager built with .NET 10, Blazor WebAssembly, and SQLite that enables users to create, manage, and execute workout sessions with real-time tracking.

Project Structure

WorkoutTracker/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ WorkoutTracker.Domain/           # Core domain entities and interfaces
β”‚   β”‚   β”œβ”€β”€ Entities/                    # Domain entities (Exercise, WorkoutPlan, etc.)
β”‚   β”‚   β”œβ”€β”€ Enums/                       # Domain enums (ExerciseType, DurationType)
β”‚   β”‚   └── Interfaces/                  # Repository interfaces
β”‚   β”‚
β”‚   β”œβ”€β”€ WorkoutTracker.Contracts/        # Shared DTOs and request types
β”‚   β”‚   β”œβ”€β”€ Common/                      # Shared enums and types
β”‚   β”‚   β”œβ”€β”€ Exercises/                   # Exercise DTOs and requests
β”‚   β”‚   β”œβ”€β”€ WorkoutPlans/                # WorkoutPlan DTOs and requests
β”‚   β”‚   β”œβ”€β”€ WorkoutSessions/             # WorkoutSession DTOs and requests
β”‚   β”‚   β”œβ”€β”€ PlanExercises/               # PlanExercise DTOs and requests
β”‚   β”‚   └── SetRecords/                  # SetRecord DTOs and requests
β”‚   β”‚
β”‚   β”œβ”€β”€ WorkoutTracker.Application/      # Application services layer
β”‚   β”‚   β”œβ”€β”€ Common/Mappings/             # Entity to DTO mapping extensions
β”‚   β”‚   β”œβ”€β”€ Exercises/                   # Exercise service and validators
β”‚   β”‚   β”œβ”€β”€ WorkoutPlans/                # WorkoutPlan service and validators
β”‚   β”‚   β”œβ”€β”€ WorkoutSessions/             # WorkoutSession service and validators
β”‚   β”‚   └── SetRecords/                  # SetRecord service and validators
β”‚   β”‚
β”‚   β”œβ”€β”€ WorkoutTracker.Infrastructure/   # Infrastructure layer
β”‚   β”‚   β”œβ”€β”€ Data/                        # DbContext, configurations, seeder
β”‚   β”‚   β”œβ”€β”€ Repositories/                # Repository implementations
β”‚   β”‚   └── Migrations/                  # EF Core migrations
β”‚   β”‚
β”‚   β”œβ”€β”€ WorkoutTracker.API/              # Backend REST API (.NET 10)
β”‚   β”‚   β”œβ”€β”€ Controllers/                 # API endpoints
β”‚   β”‚   └── Extensions/                  # ErrorOr result extensions
β”‚   β”‚
β”‚   └── WorkoutTracker.Client/           # Frontend (Blazor WebAssembly)
β”‚       β”œβ”€β”€ Pages/                       # Blazor pages/components
β”‚       └── Services/                    # API communication services
β”‚
β”œβ”€β”€ tests/
β”‚   └── WorkoutTracker.Tests/            # xUnit test project
β”‚
└── WorkoutTracker.sln                   # Solution file

Architecture

The application follows Clean Architecture principles with clear separation of concerns:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     PRESENTATION LAYER                          β”‚
β”‚   WorkoutTracker.API        WorkoutTracker.Client               β”‚
β”‚   (Controllers)             (Blazor WASM)                       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚                         β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     INFRASTRUCTURE LAYER                         β”‚
β”‚   WorkoutTracker.Infrastructure                                  β”‚
β”‚   (EF Core DbContext, Repositories)                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     APPLICATION LAYER                            β”‚
β”‚   WorkoutTracker.Application                                     β”‚
β”‚   (Services, Validators, Mappings)                               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        CORE LAYER                                β”‚
β”‚   WorkoutTracker.Domain          WorkoutTracker.Contracts        β”‚
β”‚   (Entities, Interfaces)         (DTOs, API Contracts)           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key Architectural Patterns

  • Domain-Driven Design (DDD): Rich domain entities with private setters and factory methods
  • Repository Pattern: Abstracted data access through repository interfaces
  • Unit of Work: Coordinated database transactions
  • Result Pattern: ErrorOr for explicit error handling without exceptions
  • FluentValidation: Request validation in the application layer

Features Implemented

Core Features

  • Workout Plan Management: Create and view workout plans with multiple exercises
  • Exercise Types: Support for time-based, repetition-based, and duration-based exercises
  • Real-Time Set Tracking: Track weight, reps, execution time, and recovery time for each set
  • Recovery Timer: Visual countdown timer with color-coded feedback (green β†’ yellow β†’ red)
  • Data Persistence: SQLite database with Entity Framework Core
  • Seeded Test Data: "Full Body Workout A" plan pre-loaded for testing

Technical Implementation

  • .NET 10 backend API with RESTful endpoints
  • Blazor WebAssembly for responsive web UI
  • SQLite database for cross-platform local storage
  • Entity Framework Core 10 ORM with migrations
  • xUnit test framework with 136 passing tests
  • Git version control with proper .gitignore

Getting Started

Prerequisites

Running the Application

1. Start the Backend API

cd src/WorkoutTracker.API
dotnet run

The API will start on:

  • HTTPS: https://localhost:7001
  • HTTP: http://localhost:5000

The database will be automatically created and seeded with test data on first run.

2. Start the Blazor Client

In a new terminal:

cd src/WorkoutTracker.Client
dotnet run

The client will start on:

  • HTTPS: https://localhost:7002
  • HTTP: http://localhost:5001

API Endpoints

Workout Plans

  • GET /api/WorkoutPlans - Get all workout plans
  • GET /api/WorkoutPlans/{id} - Get specific workout plan
  • POST /api/WorkoutPlans - Create new workout plan
  • PUT /api/WorkoutPlans/{id} - Update workout plan
  • DELETE /api/WorkoutPlans/{id} - Delete workout plan

Exercises

  • GET /api/Exercises - Get all exercises
  • GET /api/Exercises/{id} - Get specific exercise
  • POST /api/Exercises - Create new exercise
  • PUT /api/Exercises/{id} - Update exercise
  • DELETE /api/Exercises/{id} - Delete exercise

Workout Sessions

  • GET /api/WorkoutSessions - Get all sessions
  • GET /api/WorkoutSessions/{id} - Get specific session
  • POST /api/WorkoutSessions - Start new session
  • PUT /api/WorkoutSessions/{id}/complete - Complete session
  • DELETE /api/WorkoutSessions/{id} - Delete session

Set Records

  • GET /api/SetRecords - Get all set records
  • GET /api/SetRecords/{id} - Get specific set record
  • GET /api/SetRecords/session/{sessionId} - Get sets for a session
  • POST /api/SetRecords - Record a completed set
  • DELETE /api/SetRecords/{id} - Delete a set record

Database Schema

WorkoutPlan

  • Stores workout plan metadata (name, description, creation date)

Exercise

  • Defines exercises with muscle groups, images, videos, and type

PlanExercise

  • Junction table linking plans to exercises with target sets/reps/duration

WorkoutSession

  • Tracks individual workout sessions

SetRecord

  • Records each completed set with actual performance data

Seeded Test Data

The application includes a pre-configured "Full Body Workout A" plan with 10 exercises:

  1. Treadmill (10 min warm-up)
  2. Lunges (4 sets x 10 reps)
  3. Leg Extension (4 sets x 10 reps)
  4. Horizontal Press (3 sets x 8 reps)
  5. One-Arm Dumbbell Row (3 sets x 15 reps)
  6. Dumbbell Shoulder Press (3 sets x 12 reps)
  7. Lat Machine (4 sets x 10 reps)
  8. Chest Press (4 sets x 10 reps)
  9. Plank (4 sets x 30 sec)
  10. Treadmill Uphill (10 min cool-down)

User Interface

Home Page

  • Displays all available workout plans as cards
  • Shows exercise count and creation date
  • "Start Workout" button to begin a session

Active Workout Page

  • Current exercise details with muscle groups
  • Set tracking form (weight, reps/duration, execution time)
  • Recovery Timer with visual feedback:
    • Green: Within suggested recovery time
    • Yellow: 1-1.5x suggested time
    • Red: Over 1.5x suggested time
  • Progress indicator showing remaining exercises
  • "End Workout" button to complete session

Configuration

API Base URL

The client is configured to connect to the API at https://localhost:7001. To change this, edit:

File: src/WorkoutTracker.Client/wwwroot/appsettings.json

{
  "ApiBaseUrl": "https://localhost:7001"
}

Database Connection

The API uses SQLite with a local database file. To change the connection string, edit:

File: src/WorkoutTracker.API/appsettings.json

{
  "ConnectionStrings": {
    "DefaultConnection": "Data Source=workouttracker.db"
  }
}

Testing

The project includes comprehensive tests with 136 passing tests covering:

  • Controller integration tests
  • Client service tests
  • Database seeding tests
  • Domain entity tests
# Run all tests
dotnet test

# Run with verbose output
dotnet test --verbosity normal

Build & Run Commands

# Build entire solution
dotnet build WorkoutTracker.sln

# Build API only
dotnet build src/WorkoutTracker.API/WorkoutTracker.API.csproj

# Build Client only
dotnet build src/WorkoutTracker.Client/WorkoutTracker.Client.csproj

# Run tests
dotnet test

# Create new migration
cd src/WorkoutTracker.API
dotnet ef migrations add MigrationName

# Update database
dotnet ef database update

Future Enhancements

The database schema and architecture support these planned features:

  • Workout history and calendar view
  • Progress tracking with charts
  • Personal record (PR) tracking
  • Custom exercise creation
  • Workout plan templates
  • Body measurements tracking
  • Mobile deployment (MAUI conversion)

Architecture Notes

  • Clean Architecture: Strict dependency rules between layers
  • CORS: Configured to allow Blazor client origins
  • Database Seeding: Automatic on application start
  • Future Mobile Support: Architecture designed for MAUI conversion
  • RESTful API: Clean separation between frontend and backend
  • ErrorOr Result Pattern: Explicit error handling without exceptions

License

This project was created as a demonstration application.

Developer Notes

  • Created with .NET 10.0.101
  • Blazor WebAssembly for web-first development
  • SQLite for simple, portable data storage
  • Architecture supports future Android deployment via MAUI

About

A project completely generated via claude code, whithout writing a single line of code by myself

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •