Commit Graph

25 Commits

Author SHA1 Message Date
João Vitória Silva
4168642d6e Refactor WebSocket manager and authentication flow
Replaces websocket.schema with websocket.manager for managing WebSocket connections, introducing a singleton WebSocketManager and updating all imports and usages accordingly. Adds token-based authentication for WebSocket connections, requiring access_token as a query parameter and validating it server-side. Updates FastAPI WebSocket endpoint to use authenticated user ID, and modifies frontend to connect using the access token. Removes obsolete schema.py and improves error handling and logging for WebSocket events.
2026-01-06 23:32:31 +00:00
João Vitória Silva
dd63e29f2b Refactor Strava activity function naming and usage
Renamed get_user_garminconnect_activities_by_dates to get_user_strava_activities_by_dates and updated all references in backend code for clarity and correctness. This improves code readability and ensures the correct function is used for Strava activity retrieval. #445
Fix issue when model was not being showed #432
2025-12-20 11:42:12 +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
78c8e02bc1 Merge branch 'master' into 0.16.0 2025-11-15 23:01:25 +00:00
João Vitória Silva
35acae06c7 Improve activity filtering
Filters out None values from the activities list and returns None if the list is empty #395
2025-11-14 22:47:55 +00:00
João Vitória Silva
113ce35b46 Refactor auth and identity provider modules
Moved authentication and identity provider logic from 'session' and 'identity_providers' modules into a new 'auth' package. Updated all relevant imports and references throughout the backend to use the new structure. Added language-specific coding standards files for Python and JavaScript/TypeScript in .github/instructions/. Minor bugfixes and code style improvements in Alembic migrations and routers. Profile export and import logic now also includes notifications and user idps info
2025-10-29 13:16:18 +00:00
João Vitória Silva
f9e3101156 Refactor session token handling and router dependencies
Replaces get_user_id_from_access_token/refresh_token with get_sub_from_access_token/refresh_token and introduces get_sid_from_access_token/refresh_token for session ID extraction. Updates all router dependencies to use new methods, refactors session CRUD to use session ID instead of hashed refresh token, and improves token creation and validation logic for more robust session management. Also updates session_utils and token_manager to support new session ID claim and token structure.
2025-10-06 13:29:29 +01:00
João Vitória Silva
c3ba952f9f Refactor security scope checks to use check_scopes
Replaces all usage of session_security.check_scope with session_security.check_scopes across routers and dependencies, updating parameter names from _check_scope to _check_scopes for consistency. Also renames TokenManager.get_token_scopes to get_token_scope and updates related docstrings and claim validation logic. This improves clarity and standardizes scope checking throughout the backend.
2025-10-06 10:37:49 +01:00
João Vitória Silva
52f95e0ae3 Refactor scope handling and update session token logic
Renames all 'scopes' references to 'scope' throughout the backend, including router dependencies, session security, and token manager logic. Updates session constants to use singular 'scope' variables and dictionary names. Adds support for longer refresh tokens in the database and Alembic migration. Refactors token manager to handle scope extraction and token creation with new logic. Updates CORS and config to use ENDURAIN_HOST from core_config. This improves consistency and prepares for more granular scope management.
2025-10-05 22:56:43 +01:00
Marc @PDev1 server
d1b6ecf957 Clarifying log messages during bulk import in router.py. 2025-07-30 18:17:57 +00:00
João Vitória Silva
0b67696a2c Merge branch 'pr/240' into 0.13.0 2025-07-14 17:24:36 +01:00
João Vitória Silva
b7bfe21fcf Add activity hidden flag, push notifications & websocket support
[backend] add notification on create activity based if is hidden or not
[backend] add websocket logic to create activity in order to send new notification to frontend
[backend] add logic to get activity based on start time
[backend] on followers logic the get activities logic will not return hidden or Strava originated activities
[backend] add new is_hidden column to activities table
[backend] moved logic to notify frontend with websockets to notifications.utils
[backend] add validation to validate notification id
[backend] add new route to get notification by id
[backend] fixed encode JWT
[backend] bump dependencies
[frontend] bump dependencies
[frontend] add is_hidden field to EditActivityModalComponent
[frontend] add push notifications to NavbarNotificationsComponent
[frontend] add logic to listen to backend notifications via websocket
[frontend] add NewActivityDuplicateStartTimeNotificationComponent
[frontend] moved to composition API in some files
[frontend] add i18n to new logic
[frontend] add border and pill to activity on home view if it is hidden
[frontend] add alert to activity page if activity is hidden
2025-07-14 16:02:33 +01:00
Marc @PDev1 server
06f0a273f0 Check for legal file extensions during bulk import. 2025-07-09 06:38:40 +00:00
João Vitória Silva
d15c0ed4fd Add private notes, frontend activity naming & improve notifications
[backend] on activity creation if activity has no average, max and normalized power define it should define it if power is set
[backend] added column private_notes to activity table
[backend] added validation to only retrieve private notes if user is owner of activity
[backend] removed activity name definition from backend
[frontend] added activity name definition done by the frontend
[frontend] fix ele not being showed on cycling activities on activity summary
[frontend] continued notifications logic. Added button to show more notifications if applicable (next page)
2025-07-07 14:56:46 +01:00
João Vitória Silva
ce214ba204 Add gear components for shoes/racquets, fix alembic & UI
[backend] return 0 when activities are None on read_activities_gear_activities_number
[backend] fix alembic migrations because of v0.12.5
[backend] added docs to gear dependencies
[backend] gear_components validate_gear_component_type now checks if component is valid for gear_type
[backend] added support for gear_components to shoes and racquets
[frontend] added support for gear_components to shoes and racquets
[frontend] added avatars for components of shoes and racquets
[frontend] disabled add component button if gear type not compatible with components
[frontend] adapt gear component types based on gear type
[frontend] fix new gear component not being added to list automatically after creation
2025-07-01 13:36:18 +01:00
João Vitória Silva
811a6d19ec Merge branch 'master' into feature-gear-components 2025-06-30 16:42:01 +01:00
João Vitória Silva
f3206d8331 Refactor file path usage to use config constants
[backend] replaced hardcoded file and directory paths throughout the backend with constants defined in core.config for better maintainability and configurability. Updated all relevant modules, including activity, profile, server settings, and user utilities
[backend] improved the export profile data logic
[backend] add user image if available to export logic
[frontend] added a beta tag to the export data section in the frontend.
2025-06-26 12:30:59 +01:00
João Vitória Silva
35ef39a458 Add gear activities pagination & fix UI issues
[backend] added pagination logic to activities gears
[frontend] fixed background for user sessions list
[frontend] reverted some badges changes done on previous commit
[frontend] added activities pagination logic to gear page
2025-06-21 22:31:18 +01:00
João Vitória Silva
cc23016823 Simplified mounting volumes
[backend] simplified mounting volumes with volume config where it goes everything except logs
2025-06-17 09:25:27 +01:00
João Vitória Silva
c1a1b15a97 Refactor gear logic to new folder, start components
[backend] added gear logic to new folder gear inside of gears
[backend] started gear components logic
2025-06-09 23:03:54 +01:00
João Vitória Silva
093714fd76 Add pace privacy controls & edit modal support
[backend] add hide_pace column to user_privacy_settings table
[backend] add hide_pace column to activities table
[backend] add logic for hide_pace column
[backend] add logic to only return activity values hidden if user_id = token_user_id
[frontend] add AlertComponent
[frontend] add pace column
[frontend] change US translations from "Velocity" to "Speed"
[frontend] added ability to change activity privacy settings on edit modal
2025-06-03 22:59:08 +01:00
Maks Mržek
f6c51cdb5b Add .dockerignore and update .gitignore; fix Garmin activities retrieval 2025-05-28 15:51:00 +02:00
João Vitória Silva
6763cb420d Readd refresh activities on home 2025-05-17 22:12:51 +01:00
João Vitória Silva
5180b94fe9 Moved all user logic to new users folder
[backend] moved all user logic to new users folder
[backend] fixed minor issue on v0.10.0 alembic migration
2025-05-12 17:40:04 +01:00
João Vitória Silva
af565ddf42 Moved all activity logic to new activites folder 2025-05-12 17:20:49 +01:00