diff --git a/README.md b/README.md index 1e0e732..63a40e3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,109 @@ -# zed_workouts +# Zed Workouts -Test a new coding workflow. Want to try and use a local LLM to facilitate coding a django based workout webpage to track and store workouts in MySQL db. -Implemented qwen2.57b-instruct-q4_K-M with Zed Agent to develop code. Tried some other agents and this is the first one I was able to get to respond with proper tool calls. +A Django-based workout tracking web app optimized for mobile use. Track your gym sessions with template-based exercise generation and automatic history logging. + +## Project Structure + +``` +zed_workouts/ +├── tracker/ +│ ├── migrations/ # Database migrations +│ ├── templates/tracker/ +│ │ └── index.html # Main workout tracking UI +│ ├── admin.py # Django admin configuration +│ ├── apps.py # App configuration +│ ├── models.py # Database models +│ ├── tests.py # Unit tests +│ ├── urls.py # App URL routing +│ └── views.py # View controllers +└── zed_workouts/ + ├── settings.py # Django settings + ├── urls.py # Project URL routing + └── wsgi.py # WSGI entry point +``` + +## Tech Stack + +- **Backend**: Django 4.x (Python) +- **Frontend**: Vanilla JavaScript + Bootstrap 5 +- **Database**: SQLite (default, easily swappable) +- **Deployment**: Docker + +## Data Models + +### Exercise +Stores available exercises with type and group categorization. + +| Field | Type | Description | +|-------|------|-------------| +| exercise | CharField | Exercise name (unique) | +| type | CharField | Muscle group (Chest, Back, Arms, etc.) | +| group | CharField | Priority (Primary, Secondary, Core) | + +### Workout (History) +Logs completed workout sets. + +### Template Models +Templates for each workout type: `ChestTemplate`, `BackTemplate`, `LegsTemplate` + +| Field | Type | Description | +|-------|------|-------------| +| date | DateField | Auto-set to creation date | +| group | CharField | Primary/Secondary/Core | +| type | CharField | Muscle group | +| exercise | CharField | Exercise name | +| set | IntegerField | Set number (1-4) | +| weight | DecimalField | Weight lifted | +| reps | IntegerField | Repetitions performed | +| notes | TextField | Optional notes | + +## Features + +1. **Template Selection**: Choose Chest, Back, or Legs workout +2. **Exercise Dropdowns**: Primary, Secondary, Core categories +3. **Block Generation**: Creates 4 sets per selected exercise +4. **Ad-hoc Exercises**: Add individual exercises on the fly +5. **Workout Logging**: Saves all completed sets to history +6. **Mobile Optimization**: Hides non-essential columns, touch-friendly UI + +## Getting Started + +### Local Development + +```bash +# Create virtual environment +python -m venv .venv +source .venv/bin/activate # Linux/Mac +# or .venv\Scripts\activate # Windows + +# Install dependencies +pip install -r requirements.txt + +# Run migrations +cd zed_workouts +python manage.py migrate + +# Create superuser (optional, for admin) +python manage.py createsuperuser + +# Start server +python manage.py runserver +``` + +### Docker Deployment + +```bash +docker-compose up --build +``` + +## API Endpoints + +| URL | View | Method | Description | +|-----|------|--------|-------------| +| `/` | workout_tracker | GET/POST | Main tracker page | + +## Notes + +- Data submitted via form POST as hidden input arrays +- Templates are pre-populated via JSON context +- Mobile view hides Group/Type columns to save space \ No newline at end of file diff --git a/csv files/back_202603181941.csv b/csv files/back_202603181941.csv deleted file mode 100644 index b85cc4b..0000000 --- a/csv files/back_202603181941.csv +++ /dev/null @@ -1,37 +0,0 @@ -date,group,type,exercise,set,weight,reps,notes -2024-11-21,Primary,Back,One-arm row,1,40,8, -2024-11-21,Secondary,Arms,Hammer curl,1,20,8, -2024-11-21,Core,Core,Swiss-ball crunch,1,0,25, -2024-11-21,Primary,Back,One-arm row,2,40,8, -2024-11-21,Secondary,Arms,Hammer curl,2,20,8, -2024-11-21,Core,Core,Swiss-ball crunch,2,0,25, -2024-11-21,Primary,Back,One-arm row,3,40,8, -2024-11-21,Secondary,Arms,Hammer curl,3,20,8, -2024-11-21,Core,Core,Swiss-ball crunch,3,0,25, -2024-11-21,Primary,Back,One-arm row,4,40,8,SS 35 30 -2024-11-21,Secondary,Arms,Hammer curl,4,20,8,SS 15 10 -2024-11-21,Core,Core,Swiss-ball crunch,4,0,25, -2024-11-21,Primary,Back,Lat pulldown,1,90,8, -2024-11-21,Secondary,Arms,Concentration dumbbell curl,1,15,8, -2024-11-21,Core,Core,Decline twisting ab crunch,1,0,10, -2024-11-21,Primary,Back,Lat pulldown,2,90,8, -2024-11-21,Secondary,Arms,Concentration dumbbell curl,2,15,8, -2024-11-21,Core,Core,Decline twisting ab crunch,2,0,10, -2024-11-21,Primary,Back,Lat pulldown,3,90,8, -2024-11-21,Secondary,Arms,Concentration dumbbell curl,3,15,8, -2024-11-21,Core,Core,Decline twisting ab crunch,3,0,10, -2024-11-21,Primary,Back,Lat pulldown,4,90,8,SS 80 70 -2024-11-21,Secondary,Arms,Concentration dumbbell curl,4,15,8,SS 12.5 10 -2024-11-21,Core,Core,Decline twisting ab crunch,4,0,10, -2024-11-21,Primary,Back,Cable seated close row,1,70,8, -2024-11-21,Secondary,Arms,Cable Underhand Close Grip Pulldown,1,70,8, -2024-11-21,Core,Core,Abdominal reverse curl,1,0,10, -2024-11-21,Primary,Back,Cable seated close row,2,70,8, -2024-11-21,Secondary,Arms,Cable Underhand Close Grip Pulldown,2,70,8, -2024-11-21,Core,Core,Abdominal reverse curl,2,0,10, -2024-11-21,Primary,Back,Cable seated close row,3,70,8, -2024-11-21,Secondary,Arms,Cable Underhand Close Grip Pulldown,3,70,8, -2024-11-21,Core,Core,Abdominal reverse curl,3,0,10, -2024-11-21,Primary,Back,Cable seated close row,4,70,8,SS 60 50 -2024-11-21,Secondary,Arms,Cable Underhand Close Grip Pulldown,4,70,8,SS 60 50 -2024-11-21,Core,Core,Abdominal reverse curl,4,0,10, diff --git a/csv files/chest_202603181941.csv b/csv files/chest_202603181941.csv deleted file mode 100644 index 5a48082..0000000 --- a/csv files/chest_202603181941.csv +++ /dev/null @@ -1,37 +0,0 @@ -date,group,type,exercise,set,weight,reps,notes -2024-11-21,Primary,Chest,Barbell bench press,1,40,8, -2024-11-21,Secondary,Arms,Triceps kickback,1,15,8, -2024-11-21,Core,Core,Swiss-ball crunch,1,0,25, -2024-11-21,Primary,Chest,Barbell bench press,2,40,8, -2024-11-21,Secondary,Arms,Triceps kickback,2,15,8, -2024-11-21,Core,Core,Swiss-ball crunch,2,0,25, -2024-11-21,Primary,Chest,Barbell bench press,3,40,8, -2024-11-21,Secondary,Arms,Triceps kickback,3,15,8, -2024-11-21,Core,Core,Swiss-ball crunch,3,0,25, -2024-11-21,Primary,Chest,Barbell bench press,4,40,8,SS 35 30 -2024-11-21,Secondary,Arms,Triceps kickback,4,15,8,SS 12.5 10 -2024-11-21,Core,Core,Swiss-ball crunch,4,0,25, -2024-11-21,Primary,Chest,Decline dumbbell bench press,1,35,8, -2024-11-21,Secondary,Core,Decline twisting ab crunch,1,0,10, -2024-11-21,Core,Arms,Cable triceps pushdown,1,35,8, -2024-11-21,Primary,Chest,Decline dumbbell bench press,2,35,8, -2024-11-21,Secondary,Core,Decline twisting ab crunch,2,0,10, -2024-11-21,Core,Arms,Cable triceps pushdown,2,35,8, -2024-11-21,Primary,Chest,Decline dumbbell bench press,3,35,8, -2024-11-21,Secondary,Core,Decline twisting ab crunch,3,0,10, -2024-11-21,Core,Arms,Cable triceps pushdown,3,35,8, -2024-11-21,Primary,Chest,Decline dumbbell bench press,4,35,8,SS 30 25 -2024-11-21,Secondary,Core,Decline twisting ab crunch,4,0,10, -2024-11-21,Core,Arms,Cable triceps pushdown,4,35,8,SS 30 25 -2024-11-21,Primary,Chest,Incline dumbbell fly,1,15,8, -2024-11-21,Secondary,Arms,Standing single-arm triceps extension,1,15,8, -2024-11-21,Core,Core,Abdominal reverse curl,1,0,10, -2024-11-21,Primary,Chest,Incline dumbbell fly,2,15,8, -2024-11-21,Secondary,Arms,Standing single-arm triceps extension,2,15,8, -2024-11-21,Core,Core,Abdominal reverse curl,2,0,10, -2024-11-21,Primary,Chest,Incline dumbbell fly,3,15,8, -2024-11-21,Secondary,Arms,Standing single-arm triceps extension,3,15,8, -2024-11-21,Core,Core,Abdominal reverse curl,3,0,10, -2024-11-21,Primary,Chest,Incline dumbbell fly,4,15,8,SS 12.5 10 -2024-11-21,Secondary,Arms,Standing single-arm triceps extension,4,15,8,SS 12.5 10 -2024-11-21,Core,Core,Abdominal reverse curl,4,0,10, diff --git a/csv files/exercises_202603181942.csv b/csv files/exercises_202603181942.csv deleted file mode 100644 index 24e2faf..0000000 --- a/csv files/exercises_202603181942.csv +++ /dev/null @@ -1,67 +0,0 @@ -exercise,type,group -Cable biceps curl,Arms,Secondary -Cable triceps pushdown,Arms,Secondary -Cable Underhand Close Grip Pulldown,Arms,Secondary -Chair dip (no weights),Arms,Secondary -Concentration dumbbell curl,Arms,Secondary -Drag curl,Arms,Secondary -Dumbbell biceps curl,Arms,Secondary -Dumbbell row kickback,Arms,Secondary -Hammer curl,Arms,Secondary -Kettlebell pullover,Arms,Secondary -Lying triceps extension,Arms,Secondary -Machine biceps curl,Arms,Secondary -Overhead bar press,Arms,Secondary -Prone curl,Arms,Secondary -Seated preacher curl,Arms,Secondary -Standing biceps curl,Arms,Secondary -Standing single-arm triceps extension,Arms,Secondary -Triceps kickback,Arms,Secondary -Assisted pull-up,Back,Primary -Barbell bent-over row,Back,Primary -Cable seated close row,Back,Primary -Cable seated low row,Back,Primary -Dumbbell upright row,Back,Primary -Incline y raise,Back,Primary -Lat pulldown,Back,Primary -One-arm row,Back,Primary -Seated reverse fly,Back,Primary -Barbell bench press,Chest,Primary -Cable diagonal raise,Chest,Primary -Decline dumbbell bench press,Chest,Primary -Decline dumbbell fly,Chest,Primary -Dumbbell bench press,Chest,Primary -Dumbbell incline bench press,Chest,Primary -Incline dumbbell fly,Chest,Primary -Machine chest flye,Chest,Primary -Ab crunch on a ball,Core,Core -Abdominal reverse curl,Core,Core -Bench leg raise,Core,Core -Bicycle kick,Core,Core -Decline twisting ab crunch,Core,Core -Elevated-feet plank,Core,Core -Jackknife,Core,Core -Kettlebell russian twist,Core,Core -Plank,Core,Core -Russian twist,Core,Core -Side plank,Core,Core -Superman,Core,Core -Swiss-ball crunch,Core,Core -Swiss-ball glute bridge,Core,Core -Twisting windmill,Core,Core -Two-point bridge,Core,Core -Burpees,HIIT,Core -Mountain climbers,HIIT,Core -Squat Jump,HIIT,Core -Assisted dumbbell lunge,Legs,Primary -Back squat,Legs,Primary -Beginner squat,Legs,Primary -Bulgarian split squat (no weights),Legs,Primary -Dumbbell lunge,Legs,Primary -Machine leg curl,Legs,Primary -Machine leg extension,Legs,Primary -Machine leg press,Legs,Primary -Dumbbell front raise,Shoulders,Secondary -Dumbbell lateral raise,Shoulders,Secondary -Seated dumbbell shoulder press,Shoulders,Secondary -Shrug,Shoulders,Secondary diff --git a/csv files/legs_202603181942.csv b/csv files/legs_202603181942.csv deleted file mode 100644 index 107138a..0000000 --- a/csv files/legs_202603181942.csv +++ /dev/null @@ -1,49 +0,0 @@ -date,group,type,exercise,set,weight,reps,notes -2024-11-21,Primary,Shoulders,Dumbbell front raise,1,15,10, -2024-11-21,Secondary,Legs,Dumbbell Lunge,1,5,8, -2024-11-21,Core,Core,Decline twisting ab crunch,1,0,10, -2024-11-21,Primary,Shoulders,Dumbbell front raise,2,15,10, -2024-11-21,Secondary,Legs,Dumbbell lunge,2,5,8, -2024-11-21,Core,Core,Decline twisting ab crunch,2,0,10, -2024-11-21,Primary,Shoulders,Dumbbell front raise,3,15,10, -2024-11-21,Secondary,Legs,Dumbbell lunge,3,5,8, -2024-11-21,Core,Core,Decline twisting ab crunch,3,0,10, -2024-11-21,Primary,Shoulders,Dumbbell front raise,4,15,10, -2024-11-21,Secondary,Legs,Dumbbell lunge,4,5,8, -2024-11-21,Core,Core,Decline twisting ab crunch,4,0,10, -2024-11-21,Primary,Legs,Back squat,1,50,8, -2024-11-21,Secondary,Shoulders,Seated dumbbell shoulder press,1,20,8, -2024-11-21,Core,Core,Swiss-ball glute bridge,1,0,10, -2024-11-21,Primary,Legs,Back squat,2,50,8, -2024-11-21,Secondary,Shoulders,Seated dumbbell shoulder press,2,20,8, -2024-11-21,Core,Core,Swiss-ball glute bridge,2,0,10, -2024-11-21,Primary,Legs,Back squat,3,50,8, -2024-11-21,Secondary,Shoulders,Seated dumbbell shoulder press,3,20,8, -2024-11-21,Core,Core,Swiss-ball glute bridge,3,0,10, -2024-11-21,Primary,Legs,Back squat,4,50,8, -2024-11-21,Secondary,Shoulders,Seated dumbbell shoulder press,4,20,8, -2024-11-21,Core,Core,Swiss-ball glute bridge,4,0,10, -2024-11-21,Primary,Legs,Machine leg extension,1,75,8, -2024-11-21,Secondary,Shoulders,Dumbbell lateral raise,1,10,8, -2024-11-21,Core,Core,Abdominal reverse curl,1,0,10, -2024-11-21,Primary,Legs,Machine leg extension,2,75,8, -2024-11-21,Secondary,Shoulders,Dumbbell lateral raise,2,10,8, -2024-11-21,Core,Core,Abdominal reverse curl,2,0,10, -2024-11-21,Primary,Legs,Machine leg extension,3,75,8, -2024-11-21,Secondary,Shoulders,Dumbbell lateral raise,3,10,8, -2024-11-21,Core,Core,Abdominal reverse curl,3,0,10, -2024-11-21,Primary,Legs,Machine leg extension,4,75,8, -2024-11-21,Secondary,Shoulders,Dumbbell lateral raise,4,10,8, -2024-11-21,Core,Core,Abdominal reverse curl,4,0,10, -2024-11-21,Primary,Legs,Machine leg curl,1,35,8, -2024-11-21,Secondary,Shoulders,Shrug,1,40,8, -2024-11-21,Core,Core,Swiss-ball crunch,1,0,20, -2024-11-21,Primary,Legs,Machine leg curl,2,35,8, -2024-11-21,Secondary,Shoulders,Shrug,2,40,8, -2024-11-21,Core,Core,Swiss-ball crunch,2,0,20, -2024-11-21,Primary,Legs,Machine leg curl,3,35,8, -2024-11-21,Secondary,Shoulders,Shrug,3,40,8, -2024-11-21,Core,Core,Swiss-ball crunch,3,0,20, -2024-11-21,Primary,Legs,Machine leg curl,4,35,8, -2024-11-21,Secondary,Shoulders,Shrug,4,40,8, -2024-11-21,Core,Core,Swiss-ball crunch,4,0,20, diff --git a/zed_workouts/tracker/templates/tracker/index.html b/zed_workouts/tracker/templates/tracker/index.html index 8a1c693..b5290b0 100644 --- a/zed_workouts/tracker/templates/tracker/index.html +++ b/zed_workouts/tracker/templates/tracker/index.html @@ -70,7 +70,7 @@ width: 15%; } .col-nt { - width: 20%; + width: 10%; } .btn { @@ -164,7 +164,7 @@