Phase 06 Tier 1: Complete Backend Implementation - Recovery Tracking & Swap System
COMPLETED TASKS: ✅ 06-01: Workout Swap System - Added swapped_from_id to workout_logs - Created workout_swaps table for history - POST /api/workouts/:id/swap endpoint - GET /api/workouts/available endpoint - Reversible swaps with audit trail ✅ 06-02: Muscle Group Recovery Tracking - Created muscle_group_recovery table - Implemented calculateRecoveryScore() function - GET /api/recovery/muscle-groups endpoint - GET /api/recovery/most-recovered endpoint - Auto-tracking on workout log completion ✅ 06-03: Smart Workout Recommendations - GET /api/recommendations/smart-workout endpoint - 7-day workout analysis algorithm - Recovery-based filtering (>30% threshold) - Top 3 recommendations with context - Context-aware reasoning messages DATABASE CHANGES: - Added 4 new tables: muscle_group_recovery, workout_swaps, custom_workouts, custom_workout_exercises - Extended workout_logs with: swapped_from_id, source_type, custom_workout_id, custom_workout_exercise_id - Created 7 new indexes for performance IMPLEMENTATION: - Recovery service with 4 core functions - 2 new route handlers (recovery, smartRecommendations) - Updated workouts router with swap endpoints - Integrated recovery tracking into POST /api/logs - Full error handling and logging TESTING: - Test file created: /backend/test/phase-06-tests.js - Ready for E2E and staging validation STATUS: Ready for frontend integration and production review Branch: feature/06-phase-06
This commit is contained in:
@@ -0,0 +1,116 @@
|
||||
{
|
||||
"id": "hypertrophy_ppl",
|
||||
"name": "Hypertrofiprogram PPL",
|
||||
"goal": "muscle",
|
||||
"description": "Push/Pull/Legs split optimerat för muskelbygge. Högre volym och rep-ranges för maximal hypertrofi.",
|
||||
"experience_level": ["intermediate", "advanced"],
|
||||
"duration_weeks": 8,
|
||||
"workouts_per_week": [5, 6],
|
||||
"principles": [
|
||||
"8-12 reps för compound, 12-15 för isolation",
|
||||
"Fokus på mind-muscle connection",
|
||||
"60-90 sek vila för isolation, 2-3 min för compound",
|
||||
"Progressiv överbelastning genom volym ELLER vikt",
|
||||
"Träna nära failure (1-2 RIR)"
|
||||
],
|
||||
"split": {
|
||||
"6_days": {
|
||||
"name": "PPL x2",
|
||||
"rotation": ["push", "pull", "legs", "push", "pull", "legs"],
|
||||
"days": {
|
||||
"push": {
|
||||
"name": "Push (Bröst, Axlar, Triceps)",
|
||||
"exercises": [
|
||||
{ "id": "bench_press", "sets": 4, "reps": "8-10", "rest": "2-3 min" },
|
||||
{ "id": "overhead_press", "sets": 4, "reps": "8-10", "rest": "2 min" },
|
||||
{ "id": "dumbbell_press", "sets": 3, "reps": "10-12", "rest": "90 sek", "note": "Incline" },
|
||||
{ "id": "lateral_raise", "sets": 4, "reps": "12-15", "rest": "60 sek" },
|
||||
{ "id": "cable_fly", "sets": 3, "reps": "12-15", "rest": "60 sek" },
|
||||
{ "id": "tricep_pushdown", "sets": 3, "reps": "12-15", "rest": "60 sek" }
|
||||
]
|
||||
},
|
||||
"pull": {
|
||||
"name": "Pull (Rygg, Biceps)",
|
||||
"exercises": [
|
||||
{ "id": "deadlift", "sets": 3, "reps": "6-8", "rest": "3 min", "note": "Eller RDL" },
|
||||
{ "id": "pull_ups", "sets": 4, "reps": "8-10", "rest": "2 min" },
|
||||
{ "id": "barbell_row", "sets": 4, "reps": "8-10", "rest": "2 min" },
|
||||
{ "id": "lat_pulldown", "sets": 3, "reps": "10-12", "rest": "90 sek" },
|
||||
{ "id": "face_pull", "sets": 3, "reps": "15-20", "rest": "60 sek" },
|
||||
{ "id": "bicep_curl", "sets": 4, "reps": "10-12", "rest": "60 sek" }
|
||||
]
|
||||
},
|
||||
"legs": {
|
||||
"name": "Legs (Ben & Core)",
|
||||
"exercises": [
|
||||
{ "id": "squat", "sets": 4, "reps": "8-10", "rest": "3 min" },
|
||||
{ "id": "romanian_deadlift", "sets": 4, "reps": "10-12", "rest": "2 min" },
|
||||
{ "id": "leg_press", "sets": 3, "reps": "12-15", "rest": "90 sek" },
|
||||
{ "id": "leg_curl", "sets": 4, "reps": "10-12", "rest": "60 sek" },
|
||||
{ "id": "leg_extension", "sets": 3, "reps": "12-15", "rest": "60 sek" },
|
||||
{ "id": "plank", "sets": 3, "reps": "45-60 sek", "rest": "60 sek" }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"5_days": {
|
||||
"name": "Upper/Lower/Push/Pull/Legs",
|
||||
"rotation": ["upper", "lower", "push", "pull", "legs"],
|
||||
"days": {
|
||||
"upper": {
|
||||
"name": "Överkropp (Styrka)",
|
||||
"exercises": [
|
||||
{ "id": "bench_press", "sets": 4, "reps": "6-8", "rest": "3 min" },
|
||||
{ "id": "barbell_row", "sets": 4, "reps": "6-8", "rest": "3 min" },
|
||||
{ "id": "overhead_press", "sets": 3, "reps": "8-10", "rest": "2 min" },
|
||||
{ "id": "pull_ups", "sets": 3, "reps": "8-10", "rest": "2 min" }
|
||||
]
|
||||
},
|
||||
"lower": {
|
||||
"name": "Underkropp (Styrka)",
|
||||
"exercises": [
|
||||
{ "id": "squat", "sets": 4, "reps": "6-8", "rest": "3 min" },
|
||||
{ "id": "deadlift", "sets": 3, "reps": "5-6", "rest": "3 min" },
|
||||
{ "id": "leg_press", "sets": 3, "reps": "10-12", "rest": "2 min" },
|
||||
{ "id": "leg_curl", "sets": 3, "reps": "10-12", "rest": "90 sek" }
|
||||
]
|
||||
},
|
||||
"push": {
|
||||
"name": "Push (Volym)",
|
||||
"exercises": [
|
||||
{ "id": "dumbbell_press", "sets": 4, "reps": "10-12", "rest": "90 sek" },
|
||||
{ "id": "lateral_raise", "sets": 4, "reps": "12-15", "rest": "60 sek" },
|
||||
{ "id": "cable_fly", "sets": 4, "reps": "12-15", "rest": "60 sek" },
|
||||
{ "id": "tricep_pushdown", "sets": 4, "reps": "12-15", "rest": "60 sek" }
|
||||
]
|
||||
},
|
||||
"pull": {
|
||||
"name": "Pull (Volym)",
|
||||
"exercises": [
|
||||
{ "id": "lat_pulldown", "sets": 4, "reps": "10-12", "rest": "90 sek" },
|
||||
{ "id": "barbell_row", "sets": 3, "reps": "10-12", "rest": "90 sek" },
|
||||
{ "id": "face_pull", "sets": 4, "reps": "15-20", "rest": "60 sek" },
|
||||
{ "id": "bicep_curl", "sets": 4, "reps": "12-15", "rest": "60 sek" }
|
||||
]
|
||||
},
|
||||
"legs": {
|
||||
"name": "Ben (Volym)",
|
||||
"exercises": [
|
||||
{ "id": "leg_press", "sets": 4, "reps": "12-15", "rest": "90 sek" },
|
||||
{ "id": "romanian_deadlift", "sets": 4, "reps": "10-12", "rest": "2 min" },
|
||||
{ "id": "leg_extension", "sets": 4, "reps": "12-15", "rest": "60 sek" },
|
||||
{ "id": "leg_curl", "sets": 4, "reps": "12-15", "rest": "60 sek" }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"progression": {
|
||||
"rule": "Öka vikt när du når toppen av rep-range i alla sets",
|
||||
"example": "3x12 reps? Nästa pass: öka vikt, sikta på 3x8, bygg upp till 3x12 igen",
|
||||
"deload": {
|
||||
"when": "Stagnation eller vecka 5",
|
||||
"method": "50% volym, samma intensitet"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user