Commit Graph

770 Commits

Author SHA1 Message Date
João Vitória Silva
54c6b6aefa Add assertions for num_records and page_number in pagination tests
Updated health_sleep, health_steps, and health_weight router pagination tests to assert num_records and page_number in response data, improving test coverage for pagination metadata.
2025-12-09 10:18:40 +00:00
João Vitória Silva
362b848364 Add pagination metadata to health API list responses
Updated the list response schemas and routers for health_sleep, health_steps, and health_weight to include num_records and page_number fields. This provides clients with additional pagination metadata alongside the total count and records.
2025-12-08 22:58:06 +00:00
João Vitória Silva
e829153ad3 Support SMTP_PASSWORD as Docker secret
Updated the application to read SMTP_PASSWORD using the read_secret method, enabling support for Docker secrets via SMTP_PASSWORD_FILE. Documentation was updated to reflect this new option for configuring SMTP credentials.
2025-12-08 22:52:35 +00:00
João Vitória Silva
5a3597b3e6 Fix wrong column types on v0.16.0 migration 2025-12-08 22:36:03 +00:00
João Vitória Silva
b0c5b5f90d Dependency bump 2025-12-07 15:32:23 +00:00
João Vitória Silva
7d62434da2 Add sleep scoring system and refactor health sleep fields
Introduces a comprehensive sleep scoring module with detailed calculation logic and integration into health sleep creation and editing endpoints. Refactors HealthSleep model and schema to use integer types for heart rate, SpO2, respiration, and sleep stress fields. Updates related tests and documentation to reflect the new scoring system and data type changes.
2025-12-07 15:21:25 +00:00
João Vitória Silva
9bdbefca90 Refactor sleep metrics to use integer types
Changed heart rate, SpO2, respiration, and stress level fields from Decimal to Integer in backend models and schemas for consistency. Updated frontend modal to support unmeasurable sleep and removed nap time, aligning form fields and API payloads with backend changes. Adjusted data processing and validation logic to match new types and constraints.
2025-12-05 22:27:41 +00:00
João Vitória Silva
a4d52a8e03 health_sleep API add tests and route for create and delete
Added comprehensive unit tests for health_sleep CRUD, models, and router. Added route for creating and deleting sleep entries
2025-12-05 14:19:29 +00:00
João Vitória Silva
73f2bc3588 Refactor health_sleep API
Refactored backend health_sleep CRUD, models, router and schema for improved type safety, docstrings, and response structure. Added HealthSleepListResponse for paginated and total-count responses. Updated router endpoints to return total counts and records, and improved error handling. Added new route and CRUD function for deleting sleep and added frontend support for it. Simplified array update on update and delete actions for steps, weight and sleep on HealthView.vue alongisde i18n translations for new strings
2025-12-05 13:58:20 +00:00
João Vitória Silva
f748a395d9 Refactor health_targets API and add tests
Refactored backend health_targets CRUD, models, router and schema for improved type safety, docstrings, and response structure. Added comprehensive unit tests for health_targets CRUD, models, and router. Added missing emit in HealthSleepZone.vue
2025-12-05 13:12:30 +00:00
João Vitória Silva
086efd85bb Refactor health_steps API and add tests
Refactored backend health_steps CRUD, models, router, schema, and utils for improved type safety, docstrings, and response structure. Added HealthStepsListResponse for paginated and total-count responses. Updated router endpoints to return total counts and records, and improved error handling. Added comprehensive unit tests for health_steps CRUD, models, and router. Updated frontend service and view to match new API response format.
2025-12-05 12:58:05 +00:00
João Vitória Silva
99396433f5 Refactor health_weight API and add tests
Refactored backend health_weight CRUD, models, router, schema, and utils for improved type safety, docstrings, and response structure. Added HealthWeightListResponse for paginated and total-count responses. Updated router endpoints to return total counts and records, and improved error handling. Added comprehensive unit tests for health_weight CRUD, models, and router. Updated frontend service and view to match new API response format.
2025-12-05 12:01:36 +00:00
João Vitória Silva
5fbd9052d3 Refactor bulk import to use thread pool executor
Replaces FastAPI BackgroundTasks with a ThreadPoolExecutor for bulk activity import, queuing all files for processing in a single thread pool task. Adds process_all_files_sync to handle sequential file processing and database session management, improving scalability and resource usage. #399
2025-12-04 11:51:13 +00:00
João Vitória Silva
b526b0386d Update dependencies and remove unused peer fields
Added max_heart_rate to authStore.js #390
Upgraded several backend Python packages (anyio, garminconnect, joserfc, psycopg, psycopg-binary, psycopg-pool, trove-classifiers) and frontend npm packages (@asamuzakjp/dom-selector, @csstools/css-syntax-patches-for-csstree, @eslint/eslintrc). Also removed unused 'peer' fields from multiple entries in package-lock.json for cleaner dependency management.
2025-12-03 22:05:00 +00:00
João Vitória Silva
3f63345d36 Merge branch 'pr/390' into 0.16.0 2025-12-03 21:55:53 +00:00
João Vitória Silva
a6a53e513a Update config paths and docs for environment variables
Changed DATA_DIR to use BACKEND_DIR for consistency in config.py and removed unused import in fit/utils.py. Added documentation for FRONTEND_DIR, BACKEND_DIR, DATA_DIR, and LOGS_DIR environment variables in advanced-started.md to clarify their usage.
2025-12-03 16:18:13 +00:00
João Vitória Silva
0bc50fefff Add FIT file_id parsing and tracker info extraction
Introduces parsing of the FIT file_id frame to extract manufacturer, product, serial number, and creation time. Updates activity object creation to include tracker manufacturer and model, and propagates file_id data through parsing and splitting functions for improved device metadata handling.
2025-12-03 14:30:52 +00:00
João Vitória Silva
05f6602fae Fix swimming pace calculation for missing data
Updates the pace calculation logic to handle cases where split_summary and lengths are missing for lap swimming activities, defaulting to the standard pace calculation.
2025-12-02 17:54:19 +00:00
João Vitória Silva
1b7c7da4de Add support for swimming lengths in FIT file parsing
Introduces parsing and handling of 'length' frames from FIT files, storing their data in a new 'lengths' array. Updates relevant functions to include and utilize 'lengths', particularly for more accurate swimming pace calculations based on active lengths.
2025-12-02 17:23:21 +00:00
João Vitória Silva
7b9b393c7f Merge branch 'pr/427' into 0.16.0 2025-12-02 16:48:34 +00:00
João Vitória Silva
823549a902 Improve sleep and weight data handling and chart display
Refactored backend Garmin sleep processing to robustly handle enum validation and avoid errors from unknown values. Updated frontend sleep list to conditionally render the timeline chart only if sleep stages exist. Reverted change to HealthWeightLineChartComponent.vue
2025-11-28 14:42:01 +00:00
João Vitória Silva
5159d5f246 Enhance health weight chart with more metrics
Expanded the HealthWeightLineChartComponent to display additional metrics (BMI, body fat, body water, bone mass, muscle mass) alongside weight, each with its own dataset and axis. Improved tooltip formatting and axis labeling. Also refactored and cleaned up UsersListComponent markup for readability, and improved type annotations in UsersListComponent. Backend health_utils.py now includes stricter validation for Garmin data fields to prevent errors from invalid or missing values.
2025-11-28 14:14:18 +00:00
João Vitória Silva
331cc9762c Enhance health dashboard and sleep details UI
Added new cards for sleep, resting heart rate, and skin temperature deviation to the health dashboard. Expanded HealthSleepListTabsComponent with detailed tabs for heart rate, SpO2, respiratory rate, and additional sleep metrics, including improved handling of missing data. Updated i18n files for new labels and units, and adjusted HealthSideBarComponent navigation order. Minor backend and script fixes for field naming and test data.
2025-11-27 18:17:16 +00:00
Lev Aronsky
cf30b410ab Ignore time_active for swimming activities without splits
When no `split_summary` is provided, treat `lap_swimming` activities active throughout the whole activity (thus, use the same calculation for pace as for other activity types).
2025-11-27 15:44:13 +02:00
João Vitória Silva
836060d176 Inline health_sleep migration into main v0.16.0 migration
Moved the creation and removal of the health_sleep table from a separate migration file into the main v0_16_0_migration.py. Deleted the now-redundant v0_16_0_migration_health_sleep.py migration file to consolidate schema changes.
2025-11-26 22:40:00 +00:00
João Vitória Silva
8f36be66c8 Add sleep stress fields to HealthSleep model and schema
Introduces avg_sleep_stress and sleep_stress_score fields to the HealthSleep database model, schema, and migration. Updates health_utils to process and store these new sleep stress metrics from Garmin data.
2025-11-26 22:36:23 +00:00
João Vitória Silva
4cf4733e5e Add detailed sleep metrics and UI tabs for health sleep
Extended backend models, schema, and migration to support new sleep metrics such as HRV status, resting heart rate, skin temperature deviation, and sleep score breakdowns. Updated Garmin health utils to process and store these new fields. On the frontend, refactored HealthSleepListComponent to use a new HealthSleepListTabsComponent for tabbed sleep details, updated prop names for clarity, and added new i18n resources for the updated UI.
2025-11-26 22:22:23 +00:00
João Vitória Silva
087ca1f6a8 Add health sleep tracking feature to backend and frontend
Introduces health sleep tracking with new backend API endpoints, database schema updates, and CRUD logic. Adds frontend components for displaying, listing, and visualizing sleep data, including bar and timeline charts. Updates i18n resources and refactors health steps and weight components for consistency. Adds chartjs-adapter-date-fns and date-fns dependencies for improved chart date handling.
2025-11-26 11:50:28 +00:00
João Vitória Silva
3a9a77007d Add health sleep tracking support and models
Introduces backend support for health sleep data, including new models, CRUD operations, and schema in the health_sleep module. Adds Alembic migration for sleep data, updates Garmin health utilities, and integrates sleep data retrieval in aux_gc_getbcstats.py. Frontend sidebar and i18n files updated to reflect new health sleep features.
2025-11-25 16:36:31 +00:00
João Vitória Silva
e3f021094d Bump dependencies 2025-11-25 15:24:41 +00:00
João Vitória Silva
15f1278942 Add weight target editing to health section
Introduces the ability for users to set and update their weight target. Adds a new modal for weight target input, updates the backend API with a PUT endpoint for health targets, and connects the frontend to this endpoint. Also includes related i18n updates and minor UI improvements for integration modals.
2025-11-25 12:45:42 +00:00
João Vitória Silva
2cc06345e6 Unify health data models and migrations for steps and weight
Consolidates Alembic migrations for health_steps and health_weight into a single migration, removing redundant migration files. Refactors models and schemas to use a unified 'source' field (replacing garminconnect_body_composition_id) for both health_steps and health_weight, and updates related backend and frontend code to use this new field. Adds 'steps' to health_targets and updates enum usage for source fields. Frontend components now check 'source' for Garmin integration display.
2025-11-25 11:45:37 +00:00
João Vitória Silva
8d804477e1 Add health steps tracking feature
Implemented full CRUD API endpoints for health steps in the backend, including create, update, and delete operations. Added new frontend components for managing, displaying, and visualizing health steps, including modals, bar chart, and list components. Updated dashboard and i18n files to support the new health steps feature. Also improved weight input UI and refactored some frontend scripts to use <script setup>. #404
2025-11-25 11:17:19 +00:00
João Vitória Silva
c26f8321be Add health steps tracking and UI integration
Introduces backend models, CRUD, API routes, and Alembic migration for health steps tracking. Updates Garmin data processing to include daily steps, and adds frontend services, dashboard, and sidebar components for displaying and managing step data. Also refines health weight deletion, improves i18n, and updates related logic for better health data management.
2025-11-24 23:19:38 +00:00
João Vitória Silva
646b3d954b Refactor health_data to health_weight module
Migrates all health data functionality to a new health_weight module, including models, CRUD, utils, and API routes. Updates database schema and Alembic migration to use health_weight, removes the old health_data files, and updates all references throughout the backend and frontend. Adjusts API endpoints, i18n, and services to reflect the new health_weight naming and structure.
2025-11-24 15:20:41 +00:00
João Vitória Silva
e86f45bdbc Bump dependencies 2025-11-19 12:33:25 +00:00
João Vitória Silva
a27e9ec701 Merge branch 'master' into 0.16.0 2025-11-19 12:27:34 +00:00
João Vitória Silva
43b182b3ee Bump dependencies 2025-11-19 11:00:30 +00:00
João Vitória Silva
5c7bb699f7 Add body composition fields to HealthData model
Uncommented and integrated body composition fields (body_fat, body_water, bone_mass, muscle_mass, physique_rating, visceral_fat, metabolic_age) in the HealthData schema and processing logic. Updated backend to handle these fields and adjusted frontend to handle possible null BMI values. #401
2025-11-17 22:58:29 +00:00
João Vitória Silva
a5906171dd Add support for Inline Skating activity type
Introduces 'Inline skating' as a new activity type (ID 45) across backend and frontend. Updates schemas, utility mappings, i18n files, UI components, and search functionality to handle inline skating activities. #411
2025-11-17 22:33:56 +00:00
João Vitória Silva
cef1d45a30 Add support for snow shoeing activity type (44)
Introduces 'Snow shoeing' as a new activity type (ID 44) across backend and frontend. Updates schema, activity mappings, goal calculations, developer documentation, i18n files, activity utilities, and UI components to support the new activity. Ensures snow shoeing is selectable, filterable, and properly displayed throughout the application. #411
2025-11-17 22:07:40 +00:00
João Vitória Silva
98bc4fefa9 Add Sailing activity type support across app
Introduces Sailing (type 43) as a supported activity throughout the backend and frontend. Updates activity mappings, i18n files, UI dropdowns, and utility functions to include Sailing. Adjusts search and filtering logic to handle the new activity type and corrects some error message keys in SearchView. #411
2025-11-17 21:54:04 +00:00
João Vitória Silva
2e19ec19b0 Add kayaking activity type (42) across app
Introduces kayaking as a new activity type (ID 42) in backend and frontend. Updates activity mappings, i18n labels, UI components, and search logic to support kayaking alongside rowing where appropriate. #411
2025-11-17 21:34:33 +00:00
João Vitória Silva
77bc227470 Bump to v0.15.9 2025-11-17 17:09:47 +00:00
João Vitória Silva
9e89661746 Bump version to 0.15.8 2025-11-16 22:49:08 +00:00
João Vitória Silva
31a851250d Add activity name support to file parsing functions
Introduces an optional activity_name parameter to GPX, TCX, and FIT file parsing utilities, allowing the activity name to be set from external sources (such as Garmin Connect). Updates related function signatures and usages throughout the codebase to propagate this parameter. Also adds windsurf to ActivityDistances schema and improves type annotations and error handling in activity utilities.
2025-11-16 22:48:37 +00:00
João Vitória Silva
cf56bc3a82 Bump dependencies + added missing variable default declaration 2025-11-15 23:09:35 +00:00
João Vitória Silva
78c8e02bc1 Merge branch 'master' into 0.16.0 2025-11-15 23:01:25 +00:00
João Vitória Silva
877292ea59 Bump dependencies 2025-11-15 22:07:24 +00:00
João Vitória Silva
22bfd3767e Fix issue where user old photo might not be deleted from filesystem
Fix issue where user old photo might not be deleted from filesystem
2025-11-15 22:03:22 +00:00