Conversation
…CreateExercise component
…from package-lock.json
…ted property for selectedExercise
- Remove treadmill exercises from exercises.data.ts - Remove Cardio muscle group from muscleGroups.data.ts - Update exercise seeder to not include cardio fields - 26 exercises instead of 28 (removed 2 treadmill exercises)
- Split seed logic into separate seeder files - Add README with seed instructions - Improve seed organization and maintainability
- Migration to add activity and activity_log tables - Migration to remove cardio fields from exercises - Support for non-gym activity tracking system
- Activity entity for activity types (running, cycling, etc.) - CRUD operations for managing activity types - REST API endpoints for activity management
- ActivityLog entity for tracking individual activity sessions - CRUD operations with date, duration, distance, calories - REST API endpoints for activity log management
- Register Activity and ActivityLog modules in AppModule - Update user service to count activities in streak calculation - Import necessary modules in auth and user modules
- Activity service for fetching activity types - ActivityLog service for CRUD operations - API integration for activity tracking system
- Remove trackingMode from workoutExercise entity - Remove distance from workoutSessionSet entity - Align with strength-only exercise system
- Add Activity and ActivityLog TypeScript interfaces - Remove cardio fields from workout session interface - Type definitions for activity tracking system
- Pinia store for activities and activityLogs - State management for activity tracking - Actions for fetching and managing activity data
- List view of logged activities - Delete functionality for activity logs - Activity management in settings page
…nd logging form\n- Supports date, duration, distance, calories\n- Integrated with activity store and services
…tyList\n- Add bottom nav item for logging activity\n- Register LogActivity route in router
…y dots on calendar days\n- List recent sessions and activities\n- Improved calendar UI
…not found'\n- Logout and redirect to login\n- Centralized error handling
….km = 'km'\n- Ensure both languages updated
… cleanup\n- Regenerate component and router types
- Remove unit from pace display in SessionList.vue - Update English and Swedish locale files to include 'min/km' translation
…date translations and Vuetify theme colors
… radius and layout
…, DTOs, and services
…ssBar, MyWorkouts, and index pages with new streak info display and responsive design
…omeHeader, and MyWorkouts components, and add new workout translation to localization files
… styling; update title styling and enhance button structure
- Added scheduled session service for API interactions. - Created scheduled session store for state management. - Integrated scheduled sessions into the LogActivity and Session pages. - Enhanced index page to display today's scheduled sessions. - Updated workout session service to handle scheduled session IDs. - Improved user experience with navigation and error handling.
- Implemented Statistics.vue page with overview, exercises, and workouts tabs. - Added fetching and displaying of overview statistics, recent personal records, and most trained muscle groups/exercises. - Integrated exercise and workout quick stats into WorkoutDetails.vue. - Updated routing to include the new statistics page. - Created statistics service and store for managing statistics data. - Enhanced session completion logic to show personal records toasts. - Added navigation to statistics page from the home page.
- Updated ExerciseList.vue to improve layout and filtering options, including a new filter menu for muscle groups and exercise types. - Introduced ChipTextInput.vue for better input handling of muscle groups and exercise types. - Added DraggableTextList.vue for managing lists with drag-and-drop functionality. - Implemented MediaUpload.vue for uploading images and videos associated with exercises. - Expanded Exercise interface to include media handling and additional properties. - Enhanced localization files to support new features and labels. - Refined Settings.vue and Statistics.vue for improved user experience and layout. - Updated exercise service to handle media uploads and reordering.
- Introduced a new WorkoutDetailsOld.vue component to provide a detailed view of workouts, including exercise management, workout statistics, and drag-and-drop functionality for exercises. - Implemented functionality for adding, editing, duplicating, and deleting workouts. - Enhanced workout statistics display with recent session history and average duration. - Updated workout session store to sort exercises by order when populating initial sets. - Added new route for WorkoutDetailsOld in typed-router definitions.
- Implemented AppearanceDialog.vue for managing RPE and weight tracking preferences. - Created GoalsDialog.vue to set weekly workout goals and track weight goals. - Added LanguageDialog.vue for selecting app language (English and Swedish). - Updated localization files for new settings and improved hints. - Refactored Settings.vue to utilize new dialog components, enhancing code organization and readability.
… streaks and time of day feat: create ProgressPhoto interface and service for managing user progress photos feat: implement SessionDetail page to display detailed session information and allow deletion feat: add SessionSummary page for summarizing workout sessions and recording calories burned feat: create progress photo service and store for handling progress photo uploads and deletions
- Refactored card border styles in SessionSummary.vue, Settings.vue, Statistics.vue, WorkoutDetails.vue, and other components to utilize theme colors for better consistency. - Added dark mode support in Settings.vue, allowing users to toggle between light and dark themes. - Enhanced Statistics.vue with new components for displaying statistics, including hero cards, activity heatmaps, and comparison charts. - Introduced new API calls in statistics.service.ts for fetching weekly trends, comparison stats, and activity heatmaps. - Updated app store to persist dark mode preference. - Improved loading states and error handling in statistics store.
…in session components
…passed in frontend build
…r development and production targets fix: improve styling and localization in various components refactor: clean up unused elements in Settings and index pages
- Added copyright notice to the following files: - frontend/src/pages/Onboarding.vue - frontend/src/pages/Register.vue - frontend/src/pages/Session.vue - frontend/src/pages/SessionDetail.vue - frontend/src/pages/SessionSummary.vue - frontend/src/pages/Settings.vue - frontend/src/pages/Statistics.vue - frontend/src/pages/WorkoutDetails.vue - frontend/src/pages/WorkoutDetailsOld.vue - frontend/src/pages/index.vue - frontend/src/plugins/i18n.ts - frontend/src/plugins/index.ts - frontend/src/plugins/vuetify.ts - frontend/src/router/index.ts - frontend/src/services/activity.service.ts - frontend/src/services/activityLog.service.ts - frontend/src/services/exercise.service.ts - frontend/src/services/muscleGroup.service.ts - frontend/src/services/progressPhoto.service.ts - frontend/src/services/scheduledSession.service.ts - frontend/src/services/statistics.service.ts - frontend/src/services/user.service.ts - frontend/src/services/weightLog.service.ts - frontend/src/services/workout.service.ts - frontend/src/services/workoutSession.service.ts - frontend/src/stores/activity.store.ts - frontend/src/stores/app.ts - frontend/src/stores/auth.store.ts - frontend/src/stores/exercise.store.ts - frontend/src/stores/index.ts - frontend/src/stores/muscleGroup.store.ts - frontend/src/stores/progressPhoto.store.ts - frontend/src/stores/scheduledSession.store.ts - frontend/src/stores/statistics.store.ts - frontend/src/stores/weightLog.store.ts - frontend/src/stores/workout.store.ts - frontend/src/stores/workoutSession.store.ts - frontend/src/typed-router.d.ts - frontend/src/utils/exerciseDisplay.ts - frontend/src/utils/fetchWrapper.ts - frontend/src/utils/imageUtils.ts
This pull request introduces comprehensive support for Progressive Web App (PWA) features in the frontend, including service worker registration, update prompts, and optimized asset caching. It also updates Docker and deployment configuration to support these enhancements and upgrades the PostgreSQL version. The most important changes are grouped below: **PWA Integration and Frontend Enhancements:** * Added the `vite-plugin-pwa` to `frontend/package.json` and configured PWA support in `frontend/vite.config.mts`, including manifest details, asset caching strategies, and service worker registration with update prompts. [[1]](diffhunk://#diff-da6498268e99511d9ba0df3c13e439d10556a812881c9d03955b2ef7c6c1c655R54) [[2]](diffhunk://#diff-a68d8061fc7fe2f0194ddf7afab94de0291515e8bb22cd528075a3fdc992e310R10) [[3]](diffhunk://#diff-a68d8061fc7fe2f0194ddf7afab94de0291515e8bb22cd528075a3fdc992e310R61-R148) * Implemented a new `PWAUpdatePrompt` component and a `usePWA` composable to handle service worker updates and notify users when a new version is available, with internationalization support. [[1]](diffhunk://#diff-e27cef782501d9bf0e62ba4830508a049d240d3ad5c1a1f5acba6030006348e1R1-R68) [[2]](diffhunk://#diff-7607dc7488357c7c8a02c387c0d9249fea3a0dabbeb8517c4ec0470436f520d2R1-R59) [[3]](diffhunk://#diff-08bef502d8d33bea18f88fb6f472577fe30ae672500e5429b089c3e9bd686878R19) [[4]](diffhunk://#diff-c608e905edef8611e240ca4ed48d32972655ad12f13ef26722241aed85eb37caR999-R1004) [[5]](diffhunk://#diff-5d22775cd1ca6ea08a72562a4be903484e45014149a02a994720f68fec354f31R991-R996) * Enhanced `frontend/index.html` with meta tags and icons for improved PWA and mobile experience. **Asset and Service Worker Caching:** * Updated the Nginx configuration in `Dockerfile.frontend` to set appropriate cache-control headers for service workers, manifests, runtime chunks, and static assets, ensuring correct caching and update behavior for PWAs. **Deployment and Environment Configuration:** * Upgraded PostgreSQL from version 15-alpine to 17 in `docker-compose.prod.yml` and adjusted the data directory accordingly. [[1]](diffhunk://#diff-4563fbe997bbf18c3b38ad79c596c57c3ad88361f1dccb8c4f39b429382c06d3L1-R3) [[2]](diffhunk://#diff-4563fbe997bbf18c3b38ad79c596c57c3ad88361f1dccb8c4f39b429382c06d3R12) * Passed the `VITE_API_URL` build argument to the frontend service for dynamic API endpoint configuration. * Fixed the Docker Compose volumes syntax for clarity and correctness. These changes collectively enable robust PWA support, improve frontend asset management, and modernize the deployment stack.
There was a problem hiding this comment.
Pull request overview
This PR expands Trainity’s product surface (scheduling, activities, progress photos, weight tracking, statistics) while also modernizing the frontend UX and introducing PWA/Docker/CI improvements, alongside a licensing shift to AGPL-3.0.
Changes:
- Added multiple new backend modules (statistics, scheduled sessions, activities/activity logs, weight logs, progress photos) and extended workout/session schemas.
- Updated frontend navigation/headers, settings dialogs, resume-session UI, and added a PWA update prompt + PWA meta tags.
- Updated Docker workflows (multi-stage frontend build, compose tweaks) and introduced a GitHub Actions build-and-push pipeline; licensing/docs updated.
Reviewed changes
Copilot reviewed 172 out of 266 changed files in this pull request and generated 17 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/components/Settings/LanguageDialog.vue | Adds language selection dialog wired to i18n + app store |
| frontend/src/components/Settings/EditPersonalInfoDialog.vue | Adds editable personal info dialog (email/DOB/weight/height) |
| frontend/src/components/Settings/AppearanceDialog.vue | Adds preference toggles (RPE, weight tracking) with persistence |
| frontend/src/components/Session/WorkoutExerciseCard.vue | Adds menu actions/events and prepend slot support |
| frontend/src/components/Session/TimerDialog.vue | Adds license header (no functional change shown) |
| frontend/src/components/Session/EditSetDialog.vue | Adds license header (no functional change shown) |
| frontend/src/components/PWAUpdatePrompt.vue | Introduces PWA update/offline-ready snackbar UI |
| frontend/src/components/HomeHeader.vue | Updates header styling + dynamic greeting composable |
| frontend/src/components/BottomNavigation.vue | Adds active-route icon coloring; updates nav items |
| frontend/src/components/BackHeader.vue | Adds optional Save button support + layout tweaks |
| frontend/src/App.vue | Adds PWA prompt, improved resume bar logic, theme initialization |
| frontend/package.json | Adds chart/drag/PWA deps; switches license to AGPL-3.0 |
| frontend/index.html | Adds PWA/iOS meta tags and viewport-fit cover |
| frontend/README.md | Rewrites frontend README to project-specific docs |
| frontend/.vscode/settings.json | Switches default formatter to Prettier; adds ESLint working dir |
| docker-compose.yml | Fixes backend watch path; dev-target frontend build + VITE_API_URL arg |
| docker-compose.prod.yml | Updates Postgres image, adds PGDATA, prod frontend target + args |
| backend/src/v1/workoutSession/workoutSessionSet.entity.ts | Makes weight/reps nullable; adds cardio set fields |
| backend/src/v1/workoutSession/workoutSessionExercise.entity.ts | Makes exercise nullable; adds ordering field; removes snapshot |
| backend/src/v1/workoutSession/workoutSession.module.ts | Adds StatisticsModule dependency |
| backend/src/v1/workoutSession/workoutSession.entity.ts | Links to ScheduledSession; adds caloriesBurned |
| backend/src/v1/workoutSession/workoutSession.controller.ts | Adds log-past endpoint; allows scheduledSessionId on create |
| backend/src/v1/workoutSession/dto/updateWorkoutSession.dto.ts | Adds caloriesBurned field validation |
| backend/src/v1/workoutSession/dto/logPastWorkoutSession.dto.ts | New DTO for logging past sessions |
| backend/src/v1/workoutSession/dto/createWorkoutSession.dto.ts | Adds scheduledSessionId to session creation DTO |
| backend/src/v1/workoutSession/dto/addExerciseToSession.dto.ts | Adds license header (no functional change shown) |
| backend/src/v1/workout/workoutExercise.entity.ts | Adds optional distance to workout exercise |
| backend/src/v1/workout/workout.module.ts | Adds MuscleGroup to TypeORM feature imports |
| backend/src/v1/workout/workout.entity.ts | Adds workout type, target muscle groups, soft delete, enum change |
| backend/src/v1/workout/workout.controller.ts | Adds reorder exercises endpoint |
| backend/src/v1/workout/exercise.entity.ts | Adds license header (no functional change shown) |
| backend/src/v1/workout/dto/workoutResponse.dto.ts | Extends response with type + targetMuscleGroups; enum change |
| backend/src/v1/workout/dto/workoutExerciseSnapshot.dto.ts | Adds primary muscle group snapshot to exercise snapshot |
| backend/src/v1/workout/dto/workoutExercise.dto.ts | Adds license header (no functional change shown) |
| backend/src/v1/workout/dto/updateWorkoutExercise.dto.ts | Adds license header (no functional change shown) |
| backend/src/v1/workout/dto/updateWorkout.dto.ts | Adds license header (no functional change shown) |
| backend/src/v1/workout/dto/reorderExercises.dto.ts | New DTO for workout exercise reordering |
| backend/src/v1/workout/dto/createWorkout.dto.ts | Adds workout type + target muscle group IDs; adjusts defaults enum |
| backend/src/v1/workout/dto/addRemoveExercises.dto.ts | Adds license header (no functional change shown) |
| backend/src/v1/weightLog/weightLog.service.ts | New weight log CRUD/stats + sync to user weight |
| backend/src/v1/weightLog/weightLog.module.ts | Registers WeightLog module |
| backend/src/v1/weightLog/weightLog.entity.ts | Defines WeightLog entity |
| backend/src/v1/weightLog/weightLog.controller.ts | Adds authenticated weight log endpoints |
| backend/src/v1/weightLog/dto/weightLogResponse.dto.ts | Defines weight log response + stats DTOs |
| backend/src/v1/weightLog/dto/updateWeightLog.dto.ts | Defines update DTO validation |
| backend/src/v1/weightLog/dto/createWeightLog.dto.ts | Defines create DTO validation |
| backend/src/v1/user/user.module.ts | Adds ActivityLog entity to module’s TypeORM features |
| backend/src/v1/user/user.entity.ts | Adds onboarding/preferences fields (units, body metrics, goals) |
| backend/src/v1/user/user.controller.ts | Adds preferences update endpoint |
| backend/src/v1/user/dto/UpdateUserPreferences.dto.ts | New DTO for onboarding/preferences updates |
| backend/src/v1/user/dto/UpdateUser.dto.ts | Extends update DTO with body/goal fields |
| backend/src/v1/upload/upload.service.ts | Adds exercise media + progress photo processing & validation |
| backend/src/v1/upload/upload.module.ts | Adds license header (no functional change shown) |
| backend/src/v1/types/requestWithUser.type.ts | Adds license header (no functional change shown) |
| backend/src/v1/types/WorkoutStatus.type.ts | Adds license header (no functional change shown) |
| backend/src/v1/strategies/Jwt.strategy.ts | Adds license header (no functional change shown) |
| backend/src/v1/statistics/statistics.module.ts | New statistics module |
| backend/src/v1/statistics/statistics.controller.ts | New statistics endpoints |
| backend/src/v1/statistics/exerciseRecord.entity.ts | New ExerciseRecord entity for PRs/history |
| backend/src/v1/statistics/dto/statistics-query.dto.ts | New query DTOs for stats endpoints |
| backend/src/v1/seed/seeders/users.seeder.ts | Adds user seeder |
| backend/src/v1/seed/seeders/muscleGroups.seeder.ts | Adds muscle groups seeder |
| backend/src/v1/seed/seeders/exercises.seeder.ts | Adds exercises seeder |
| backend/src/v1/seed/seeders/activities.seeder.ts | Adds activities seeder |
| backend/src/v1/seed/data/users.data.ts | Adds seed user data |
| backend/src/v1/seed/data/muscleGroups.data.ts | Adds seed muscle group data |
| backend/src/v1/seed/data/activities.data.ts | Adds seed activity data |
| backend/src/v1/seed/README.md | Documents seeding system |
| backend/src/v1/scheduledSession/scheduledSession.module.ts | New scheduled sessions module |
| backend/src/v1/scheduledSession/scheduledSession.entity.ts | New ScheduledSession entity |
| backend/src/v1/scheduledSession/scheduledSession.controller.ts | New scheduled sessions CRUD endpoints |
| backend/src/v1/scheduledSession/dto/updateScheduledSession.dto.ts | Update DTO (PartialType) |
| backend/src/v1/scheduledSession/dto/deleteScheduledSession.dto.ts | Delete DTO w/ deleteType + occurrenceDate |
| backend/src/v1/scheduledSession/dto/createScheduledSession.dto.ts | Create DTO with recurring/one-time scheduling |
| backend/src/v1/progressPhoto/progressPhoto.service.ts | New progress photo CRUD service |
| backend/src/v1/progressPhoto/progressPhoto.module.ts | New progress photo module |
| backend/src/v1/progressPhoto/progressPhoto.entity.ts | New progress photo entity |
| backend/src/v1/progressPhoto/progressPhoto.controller.ts | New progress photo upload/list/delete endpoints |
| backend/src/v1/progressPhoto/dto/createProgressPhoto.dto.ts | Create DTO for progress photos |
| backend/src/v1/muscleGroup/muscleGroup.service.ts | Adds auto-seeding on startup when table empty |
| backend/src/v1/muscleGroup/muscleGroup.module.ts | Adds license header (no functional change shown) |
| backend/src/v1/muscleGroup/muscleGroup.entity.ts | Adds license header (no functional change shown) |
| backend/src/v1/muscleGroup/muscleGroup.controller.ts | Adds license header (no functional change shown) |
| backend/src/v1/muscleGroup/dto/updateMuscleGroup.dto.ts | Adds license header (no functional change shown) |
| backend/src/v1/muscleGroup/dto/muscleGroupResponse.dto.ts | Adds license header (no functional change shown) |
| backend/src/v1/muscleGroup/dto/createMuscleGroup.dto.ts | Adds license header (no functional change shown) |
| backend/src/v1/migrations/1771600000000-AddCaloriesBurnedToWorkoutSession.ts | Adds caloriesBurned column migration |
| backend/src/v1/migrations/1768900000000-RemoveDefaultSetsRepsPause.ts | Migration to remove deprecated exercise defaults |
| backend/src/v1/migrations/1768837747655-RemoveCardioFromExercises.ts | Removes cardio fields from exercise tables |
| backend/src/v1/migrations/1768754686-AddStreakToUser.ts | Adds license header (no functional change shown) |
| backend/src/v1/main.ts | Adds license header (no functional change shown) |
| backend/src/v1/guards/jwtAuth.guard.ts | Adds license header (no functional change shown) |
| backend/src/v1/globalExercise/globalExercise.service.ts | Removes global exercise service |
| backend/src/v1/globalExercise/globalExercise.module.ts | Removes global exercise module |
| backend/src/v1/globalExercise/globalExercise.entity.ts | Removes global exercise entity |
| backend/src/v1/globalExercise/globalExercise.controller.ts | Removes global exercise controller |
| backend/src/v1/globalExercise/dto/importGlobalExercises.dto.ts | Removes import DTO |
| backend/src/v1/globalExercise/dto/globalExerciseResponse.dto.ts | Removes response DTO |
| backend/src/v1/filters/authException.filter.ts | Adds license header (no functional change shown) |
| backend/src/v1/exercise/exerciseSeed.service.ts | Adds per-user default exercise seeding |
| backend/src/v1/exercise/exerciseMedia.entity.ts | Adds media entity for exercises |
| backend/src/v1/exercise/exercise.service.spec.ts | Adds license header (no functional change shown) |
| backend/src/v1/exercise/exercise.module.ts | Registers ExerciseMedia + ExerciseSeedService; removes GlobalExercise |
| backend/src/v1/exercise/exercise.entity.ts | Revamps exercise schema (types, equipment, instructions, media, soft delete) |
| backend/src/v1/exercise/exercise.controller.ts | Adds exercise media endpoints (upload/delete/reorder) |
| backend/src/v1/exercise/exercise.controller.spec.ts | Adds license header (no functional change shown) |
| backend/src/v1/exercise/dto/updateExercise.dto.ts | Adds license header (no functional change shown) |
| backend/src/v1/exercise/dto/exerciseResponse.dto.ts | Extends exercise response with media + new fields |
| backend/src/v1/exercise/dto/createExercise.dto.ts | Extends exercise creation with primary muscle group + arrays |
| backend/src/v1/dataSource.ts | Updates TypeORM entities list (adds new entities; removes GlobalExercise) |
| backend/src/v1/auth/dto/register.dto.ts | Adds license header (no functional change shown) |
| backend/src/v1/auth/dto/login.dto.ts | Adds license header (no functional change shown) |
| backend/src/v1/auth/dto/UserWithoutPassword.dto.ts | Adds onboarding/preference fields to user DTO |
| backend/src/v1/auth/auth.service.ts | Seeds activities + exercises on user registration |
| backend/src/v1/auth/auth.module.ts | Adds ActivityModule + ExerciseModule deps |
| backend/src/v1/auth/auth.controller.ts | Adds license header (no functional change shown) |
| backend/src/v1/app.service.ts | Adds license header (no functional change shown) |
| backend/src/v1/app.module.ts | Adds new modules; removes GlobalExerciseModule |
| backend/src/v1/app.controller.ts | Adds license header (no functional change shown) |
| backend/src/v1/app.controller.spec.ts | Adds license header (no functional change shown) |
| backend/src/v1/activityLog/dto/updateActivityLog.dto.ts | Adds update DTO for activity logs |
| backend/src/v1/activityLog/dto/createActivityLog.dto.ts | Adds create DTO for activity logs |
| backend/src/v1/activityLog/dto/activityLogResponse.dto.ts | Adds activity log response DTO |
| backend/src/v1/activityLog/activityLog.module.ts | Adds activity log module |
| backend/src/v1/activityLog/activityLog.entity.ts | Adds activity log entity |
| backend/src/v1/activityLog/activityLog.controller.ts | Adds activity log CRUD endpoints |
| backend/src/v1/activity/dto/updateActivity.dto.ts | Adds update DTO for activities |
| backend/src/v1/activity/dto/createActivity.dto.ts | Adds create DTO for activities |
| backend/src/v1/activity/dto/activityResponse.dto.ts | Adds response DTO for activities |
| backend/src/v1/activity/activity.service.ts | Adds activities CRUD service |
| backend/src/v1/activity/activity.module.ts | Adds activities module |
| backend/src/v1/activity/activity.entity.ts | Adds Activity entity (soft-delete, flags, unique per user) |
| backend/src/v1/activity/activity.controller.ts | Adds activities CRUD endpoints |
| backend/package.json | Switches license to AGPL-3.0 |
| backend/README.md | Rewrites backend README to Trainity API docs |
| Dockerfile.frontend | Adds multi-stage (dev/build/prod) frontend Dockerfile |
| CONTRIBUTORS.md | Adds contributors + CLA reference |
| CONTRIBUTING.md | Adds contribution guidelines + conventional commits |
| CLA.md | Adds individual contributor license agreement |
| .github/workflows/build.yml | Adds GH Actions workflow to build/push Docker images |
| .dockerignore | Adds dockerignore to reduce build context |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <v-snackbar | ||
| v-model="showUpdateSnackbar" | ||
| :timeout="-1" | ||
| color="cardBg" | ||
| location="bottom" | ||
| class="pwa-update-snackbar" | ||
| > |
There was a problem hiding this comment.
v-model on <v-snackbar> requires a writable ref/computed. showUpdateSnackbar is a read-only computed, so the snackbar won’t be dismissible via model updates and will trigger Vue warnings. Use :model-value=\"needRefresh\" + explicit actions, or change showUpdateSnackbar to a computed with a setter that calls close() when set to false.
| const { offlineReady, needRefresh, updateServiceWorker, close } = usePWA() | ||
| const { t } = useI18n() | ||
|
|
||
| const showUpdateSnackbar = computed(() => needRefresh.value) |
There was a problem hiding this comment.
v-model on <v-snackbar> requires a writable ref/computed. showUpdateSnackbar is a read-only computed, so the snackbar won’t be dismissible via model updates and will trigger Vue warnings. Use :model-value=\"needRefresh\" + explicit actions, or change showUpdateSnackbar to a computed with a setter that calls close() when set to false.
| const showUpdateSnackbar = computed(() => needRefresh.value) | |
| const showUpdateSnackbar = computed({ | |
| get: () => needRefresh.value, | |
| set: (value: boolean) => { | |
| if (!value) { | |
| close() | |
| } | |
| }, | |
| }) |
| class="resume-card d-flex align-center justify-space-between px-5 border-b-md" | ||
| v-if="showResumeBar" | ||
| class="resume-card d-flex align-center justify-space-between px-5 border-t-sm border-b-sm" | ||
| :style="{ borderColor: theme.current.value.colors.primary + ' !important' }" |
There was a problem hiding this comment.
Inline style bindings using an object can’t apply !important (the string becomes an invalid value for the CSSOM setter), so the border color likely won’t be applied. Prefer removing !important and adjusting specificity, or bind a full style string (e.g. :style=\"'border-color: ... !important'\"), or use a class/CSS variable-based approach.
| :style="{ borderColor: theme.current.value.colors.primary + ' !important' }" | |
| :style="`border-color: ${theme.current.value.colors.primary} !important`" |
| @ManyToOne(() => Exercise, { nullable: true }) | ||
| exercise: Exercise; | ||
|
|
||
| @Column({ type: 'jsonb', nullable: true }) | ||
| exerciseSnapshot: { | ||
| name: string; | ||
| description?: string; | ||
| img?: string; | ||
| muscleGroups?: string[]; | ||
| }; | ||
| @Column({ default: 0 }) | ||
| order: number; |
There was a problem hiding this comment.
This entity change alters the database schema (nullable FK + new order column, and the diff also removes exerciseSnapshot). If the project relies on TypeORM migrations (it appears to, given the migrations folder), this needs a corresponding migration to add/drop columns and update constraints; otherwise deployments can fail due to schema mismatch.
| @Column({ nullable: true }) | ||
| weight: number; | ||
|
|
||
| @Column() | ||
| @Column({ nullable: true }) | ||
| reps: number; |
There was a problem hiding this comment.
Making weight/reps nullable and adding cardio fields changes the table schema and should be accompanied by a migration (ALTER COLUMN DROP NOT NULL / ADD COLUMN...). Without it, runtime errors are likely when TypeORM queries assume the updated schema.
| @Post(':id/media') | ||
| @ApiOperation({ summary: 'Upload media (image or video) for an exercise' }) |
There was a problem hiding this comment.
New exercise media endpoints (upload/delete/reorder) introduce non-trivial behavior (file validation, UploadService processing, and ordering). Since this module already has Jest specs, add controller/service tests covering: invalid mimetypes/size, successful addMedia/removeMedia, and reorder behavior (including mismatched IDs).
| ); | ||
| } | ||
|
|
||
| @Delete(':id/media/:mediaId') |
There was a problem hiding this comment.
New exercise media endpoints (upload/delete/reorder) introduce non-trivial behavior (file validation, UploadService processing, and ordering). Since this module already has Jest specs, add controller/service tests covering: invalid mimetypes/size, successful addMedia/removeMedia, and reorder behavior (including mismatched IDs).
| return this.exerciseService.removeMedia(id, mediaId, +req.user.id); | ||
| } | ||
|
|
||
| @Put(':id/media/reorder') |
There was a problem hiding this comment.
New exercise media endpoints (upload/delete/reorder) introduce non-trivial behavior (file validation, UploadService processing, and ordering). Since this module already has Jest specs, add controller/service tests covering: invalid mimetypes/size, successful addMedia/removeMedia, and reorder behavior (including mismatched IDs).
| } | ||
|
|
||
| public async down(queryRunner: QueryRunner): Promise<void> { | ||
| await queryRunner.dropColumn('workout_session', 'caloriesBurned'); |
There was a problem hiding this comment.
up() uses ADD COLUMN IF NOT EXISTS, but down() uses dropColumn() (which will throw if the column doesn’t exist). To keep migrations reversible and robust, mirror the idempotency by using DROP COLUMN IF EXISTS (via queryRunner.query(...)) or otherwise ensure the down migration won’t fail when the schema diverges.
| await queryRunner.dropColumn('workout_session', 'caloriesBurned'); | |
| await queryRunner.query(` | |
| ALTER TABLE "workout_session" | |
| DROP COLUMN IF EXISTS "caloriesBurned" | |
| `); |
| push: | ||
| branches: [main, beta-update-2] |
There was a problem hiding this comment.
PR description says images should build on push to main or beta branches, but the workflow triggers on main and the feature branch name beta-update-2. If beta is the intended long-lived branch, update the trigger to match (beta) rather than a specific feature branch.
This pull request introduces major improvements to project documentation, contribution guidelines, and Docker-based workflows for the Trainity project. It adds clear onboarding and contribution processes, updates the main and backend READMEs for clarity and accuracy, and implements a robust multi-stage Docker build for the frontend. Additionally, it introduces a GitHub Actions workflow for automated Docker builds and pushes, and improves project hygiene with a comprehensive
.dockerignorefile.Documentation and Contribution Process:
CONTRIBUTING.mdfile outlining contribution steps, commit conventions, and code style guidelines.CLA.md(Contributor License Agreement) andCONTRIBUTORS.mdto formalize and track contributor agreements. [1] [2]README.mdto clarify features, tech stack, installation (Docker/manual), project structure, and contribution/license information. [1] [2] [3]README.mdto focus on Trainity API specifics, tech stack, setup, and usage instructions. [1] [2]Docker and CI/CD Improvements:
Dockerfile.frontendfor efficient frontend builds, supporting both development and production (Nginx) environments, with environment variable injection and optimized asset caching..dockerignorefile to reduce build context size and improve Docker build performance..github/workflows/build.yml) to automate building and pushing Docker images for both API and frontend to GitHub Container Registry on push to main or beta branches.These changes greatly enhance the developer experience, streamline onboarding, and lay the foundation for scalable, automated deployments.
References: [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]