feat: add Phase 5 Progression & Analytics — smart suggestions, dashboard, schedule
Add auto-progression engine (ProgressionService) with rep increase, weight increase, deload, and felt-easy acceleration rules. Add AnalyticsService for user stats, exercise progress charts, and volume-by-day data. New dashboard and schedule routes with Chart.js visualizations. Progression badges shown inline on workout day view. Navigation updated with Dashboard and Schedule links. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,7 @@ from app.models.user import User
|
||||
from app.models.user_exercise_program import UserExerciseProgram
|
||||
from app.services.exercise_service import ExerciseService
|
||||
from app.services.log_service import LogService
|
||||
from app.services.progression_service import ProgressionService
|
||||
from app.services.workout_session_service import WorkoutSessionService
|
||||
from app.utils.auth import get_current_admin_user, get_active_profile_id
|
||||
|
||||
@@ -99,6 +100,15 @@ async def workout_day_detail(
|
||||
workout_day_id = d.id
|
||||
break
|
||||
|
||||
# Get progression suggestions for each exercise
|
||||
suggestions = {}
|
||||
if active_profile_id:
|
||||
progression = ProgressionService(session)
|
||||
for exercise in exercises:
|
||||
suggestions[exercise.id] = progression.get_suggestion(
|
||||
active_profile_id, exercise.id,
|
||||
)
|
||||
|
||||
# Load existing logs for today's session (if any)
|
||||
if active_profile_id and workout_day_id:
|
||||
ws_service = WorkoutSessionService(session)
|
||||
@@ -121,6 +131,7 @@ async def workout_day_detail(
|
||||
"programs": programs,
|
||||
"active_profile": active_profile,
|
||||
"existing_logs": existing_logs,
|
||||
"suggestions": suggestions,
|
||||
"workout_day_id": workout_day_id,
|
||||
"admin": admin,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user