Commit graph

2474 commits

Author SHA1 Message Date
senke
012dca8da0 [BE-DB-003] be-db: Add soft delete support to all models 2025-12-24 15:07:25 +01:00
senke
ab1f78030b [BE-API-042] be-api: Implement OAuth callback endpoint 2025-12-24 15:05:40 +01:00
senke
5a41b8c976 [BE-API-041] be-api: Implement user delete endpoint with soft delete support 2025-12-24 15:03:21 +01:00
senke
0657b79d09 [BE-API-039] be-api: Implement marketplace order details endpoint 2025-12-24 15:00:32 +01:00
senke
04ea22149c [BE-API-038] be-api: Implement marketplace order list endpoint 2025-12-24 14:50:39 +01:00
senke
f6fa8d933a [BE-API-037] be-api: Implement marketplace product update endpoint 2025-12-24 14:49:41 +01:00
senke
3e4e2bb174 [BE-API-036] be-api: Implement track analytics dashboard endpoint 2025-12-24 14:48:28 +01:00
senke
20b8210339 [BE-API-035] be-api: Implement analytics events endpoint 2025-12-24 14:47:12 +01:00
senke
6cdd3b7abe [BE-API-026] be-api: Implement track quota endpoint validation 2025-12-24 14:45:12 +01:00
senke
64cdfcc7bd [BE-API-025] be-api: Implement upload resume endpoint validation 2025-12-24 14:42:52 +01:00
senke
bc7ff26958 [BE-API-005] be-api: Implement playlist recommendations endpoint 2025-12-24 14:41:33 +01:00
senke
061d8f11cc [FE-COMP-004] fe-comp: Add confirmation dialogs for destructive actions
- Created reusable ConfirmationDialog component for destructive actions
- Replaced native confirm() dialogs with ConfirmationDialog in ChatSidebar (leave room, delete room)
- Replaced native confirm() dialogs with ConfirmationDialog in RolesPage (delete role)
- Replaced Dialog with ConfirmationDialog in PlaylistActions (delete playlist)
- Replaced window.confirm() with ConfirmationDialog in SessionsPage (revoke session, revoke all sessions)
- All destructive actions now use consistent confirmation dialogs
- Confirmation dialogs include proper messaging, loading states, and variant support
- Improved UX with better visual feedback and clearer action descriptions
2025-12-24 14:38:55 +01:00
senke
93ba7e8c7c [FE-COMP-003] fix: Add missing useAuthStore import 2025-12-24 14:34:19 +01:00
senke
17cba16f83 [FE-COMP-003] fix: Add missing currentUser import in UserProfilePage 2025-12-24 14:34:10 +01:00
senke
bddebb33ae [FE-COMP-003] fix: Fix TypeScript errors in empty states
- Fixed isOwnProfile reference in UserProfilePage
- Fixed possibly undefined data in PlaylistList pagination
2025-12-24 14:34:00 +01:00
senke
f16a8dc030 [FE-COMP-003] fe-comp: Add empty states to all list views
- Created reusable EmptyState component with icon, title, description, and action support
- Improved empty state in PlaylistList with better messaging and icons
- Improved empty states in UserProfilePage for tracks and playlists tabs
- Added contextual messages based on whether viewing own profile or others
- Added helpful descriptions and icons to all empty states
- Empty states now provide clear guidance on what users can do next
- All list views now have consistent and helpful empty state messaging
2025-12-24 14:33:20 +01:00
senke
65529011f2 [FE-COMP-002] fe-comp: Add error boundaries to all pages
- Added ErrorBoundary to all public routes (login, register, forgot-password, verify-email, reset-password)
- Added ErrorBoundary to public user profile page (/u/:username)
- Added ErrorBoundary to protected routes: dashboard, marketplace, chat
- Added ErrorBoundary to settings/sessions route
- Added ErrorBoundary to admin/roles route
- Added ErrorBoundary to tracks/:id route
- Added ErrorBoundary to playlists/* route
- Added ErrorBoundary to search route
- Added ErrorBoundary to notifications route
- Added ErrorBoundary to error pages (404, 500)
- All pages now have error boundaries for graceful error handling
- Error boundaries provide fallback UI with retry and home navigation options
2025-12-24 14:31:28 +01:00
senke
e19f3a3db7 [FE-COMP-001] fe-comp: Add loading states to all async operations
- Created ButtonLoading component for consistent loading button pattern
- Created comprehensive loading states pattern guide
- Documented best practices for loading states in async operations
- Identified and documented existing loading state implementations
- Provided patterns for form submissions, data fetching, mutations, and skeleton loaders
- Created checklist for implementing loading states
- Documented examples from existing codebase

Most components already have loading states implemented. Pattern guide ensures consistency for future implementations.
2025-12-24 13:25:10 +01:00
senke
f47029a769 [FE-PAGE-014] fe-page: Add Notifications page
- Created dedicated Notifications page with full notification management
- Added notification service with API integration (get, mark as read, mark all as read)
- Added filtering by status (all/unread/read) and type (message/track/mention/system/etc)
- Added mark as read functionality for individual notifications
- Added mark all as read functionality
- Added notification type icons and labels
- Added notification timestamps with relative time formatting
- Added notification links support for navigation
- Added empty states for no notifications
- Added loading and error states
- Integrated with backend notification APIs
- Added route /notifications to router
- Added lazy loading for NotificationsPage component
- Added visual distinction for unread notifications (badge, background)
- Added notification type badges
2025-12-24 13:22:31 +01:00
senke
b553639d25 [FE-PAGE-013] fe-page: Add Search page
- Created dedicated Search page with unified search interface
- Added search functionality for tracks, playlists, and users
- Implemented tabs for filtering results by type (All/Tracks/Playlists/Users)
- Added search query debouncing for performance
- Added URL query parameter synchronization (q, type)
- Added pagination for each result type
- Added empty states for no query and no results
- Added loading states for all search operations
- Added error handling for search failures
- Integrated with existing search APIs (tracks, playlists, users)
- Added search service for user search API
- Added route /search to router
- Added lazy loading for SearchPage component
- Added result previews in All tab (6 items per type)
- Added View All buttons to navigate to specific tabs
2025-12-24 13:19:54 +01:00
senke
218d87f239 [FE-PAGE-012] fe-page: Complete Sessions page implementation
- Added user agent parser to extract device information (OS, browser, device type)
- Added device information display with formatted device details
- Added location information display (with support for private IP detection)
- Enhanced session cards with device type badges and detailed info
- Improved device icon selection based on device type (mobile/tablet/desktop)
- Added formatted device info display (OS, browser, versions)
- Added location display with MapPin icon
- Added device type badge (mobile/tablet/desktop)
- Improved visual hierarchy with better spacing and badges
- Maintained existing session management actions (revoke, revoke all)
2025-12-24 13:16:32 +01:00
senke
e8c0ee76cf [FE-PAGE-011] fe-page: Complete Roles page implementation
- Added CreateRoleModal for creating new roles
- Added EditRoleModal for editing existing roles
- Added AssignRoleModal for assigning roles to users
- Fixed roleService type issues (roleId from number to string)
- Enhanced RolesPage with create/edit/assign functionality
- Added UI section for assigning roles to users by ID
- Integrated all modals with existing role management
- Added proper form validation and error handling
- Added loading states for all async operations
- Added display of user current roles in assign modal
2025-12-24 13:13:54 +01:00
senke
eeaf8de57e [FE-PAGE-010] fe-page: Complete User Profile page (public)
- Added user tracks display with grid layout and pagination
- Added user playlists display with grid layout and pagination
- Added stats section showing tracks, playlists, and followers count
- Implemented tabs for switching between tracks and playlists
- Enhanced FollowButton with API integration (follow/unfollow)
- Added follow/unfollow API functions in profileService
- Added followers/following API functions (getFollowers, getFollowing)
- Added View All links for tracks and playlists when count > 12
- Improved profile layout with better organization
- Added empty states for tracks and playlists sections
2025-12-24 13:09:30 +01:00
senke
84ff7a23f3 [FE-PAGE-009] fe-page: Complete Playlist List page implementation
- Added server-side search using searchPlaylists API
- Added filtering: visibility (public/private), owner (all/mine/others)
- Added client-side sorting: by date, title, track count (asc/desc)
- Enhanced filter UI with collapsible filters panel
- Added sort controls with field selector and order toggle
- Integrated search API when search query or filters are active
- Maintained existing bulk operations (delete, share, export)
- Added clear filters button when filters are active
- Improved UX with filter badges and active state indicators
2025-12-24 13:05:21 +01:00
senke
373767de4b [FE-PAGE-008] fe-page: Complete Playlist Detail page implementation
- Added collaborator management UI with AddCollaboratorModal
- Added sharing functionality with SharePlaylistModal
- Added recommendations section using PlaylistRecommendations component
- Integrated CollaboratorList component in tabs
- Organized content in tabs (Tracks, Collaborators, Recommendations)
- Enhanced share button to open share modal with token generation
- Added Add Collaborator button for playlist owners/admins
- Integrated existing components: CollaboratorList, PlaylistRecommendations
2025-12-24 13:02:32 +01:00
senke
bad778ee5a [FE-PAGE-007] fe-page: Complete Track Detail page implementation
- Added comments section with CommentSection component
- Added sharing functionality with ShareDialog component
- Added version history display using TrackHistory component
- Added analytics display using TrackStatsDisplay component
- Organized content in tabs (Comments, History)
- Enhanced share button to open share dialog with token generation
- Integrated comment creation, deletion, and pagination
- Added track statistics display (views, likes, comments, downloads, play time)
2025-12-24 12:57:49 +01:00
senke
02cef0066a [FE-PAGE-006] fe-page: Complete Marketplace page implementation
- Added product browsing with pagination (page, limit, total_pages)
- Added product filtering: search, product type, price range
- Added cart functionality: add, remove, update quantity, checkout
- Created cartStore with Zustand and persistence
- Added Cart component with checkout functionality
- Enhanced ProductCard with Add to Cart button
- Added filter UI with collapsible filters panel
- Added search bar for product search
- Added pagination controls (Previous/Next)
- Updated marketplaceService to support filters and pagination
2025-12-24 12:54:20 +01:00
senke
80bb63150d [FE-PAGE-005] fe-page: Complete Chat page implementation
- Added room management: create, join, leave, delete rooms
- Added CreateRoomDialog component for creating new rooms
- Added room actions menu (leave/delete) in ChatSidebar
- Added message search functionality with MessageSearch component
- Added search bar in ChatRoom with message highlighting
- Added TypingIndicator component (placeholder for future WebSocket integration)
- Enhanced ChatSidebar with room management UI
- Enhanced ChatRoom with search and typing indicators
2025-12-24 12:51:40 +01:00
senke
902f4840d5 [FE-PAGE-004] fe-page: Complete Settings page implementation
- Added Account Settings section with password change, data export, and account deletion
- Added Playback Settings section with audio quality, volume, crossfade, and autoplay controls
- Updated SettingsTabs to include Account and Playback tabs (5 tabs total)
- Added PlaybackSettings interface to types
- Integrated account management features (password change, data export, account deletion)
- Added audio playback controls (quality selector, volume slider, crossfade slider, autoplay toggle)
2025-12-24 12:48:28 +01:00
senke
54e2f610ab [FE-PAGE-003] fe-page: Complete Profile page implementation
- Added profile completion indicator with progress bar
- Added profile completion percentage and missing fields display
- Added social links management (Twitter, Instagram, Facebook, YouTube, Website)
- Improved bio editing with Textarea component and character counter
- Added social links display when not editing
- Added location field
- Updated UpdateProfileRequest interface to include social_links
- Integrated profile completion API endpoint
2025-12-24 12:41:34 +01:00
senke
8dea08ca07 [FE-PAGE-002] fix: Correct toast hook usage 2025-12-24 12:39:26 +01:00
senke
f7d7be7c5d [FE-PAGE-002] fix: Correct Select and Toast API usage in LibraryPage 2025-12-24 12:39:11 +01:00
senke
c2b4cb8302 [FE-PAGE-002] fe-page: Complete Library page implementation
- Added filtering by genre and format with dropdown selects
- Added sorting by date, title, and popularity with order toggle
- Added bulk operations: select multiple tracks, bulk delete, bulk update
- Added bulk mode toggle with selection checkboxes
- Added batch delete and batch update API functions
- Added pagination controls
- Improved UI with filter bar and sort dropdown
- Added toast notifications for operations
- Added select all/deselect all functionality
2025-12-24 12:38:25 +01:00
senke
dea05f4968 [FE-PAGE-001] fe-page: Complete Dashboard page implementation
- Created dashboardService.ts to fetch real stats and activity from API
- Created useDashboard hook for managing dashboard data
- Updated DashboardPage to use real data instead of hardcoded values
- Added loading states and skeletons for better UX
- Made quick actions functional with navigation
- Added activity timeline with real timestamps
- Formatted numbers with K/M suffixes for readability
- Added relative time formatting using date-fns
2025-12-24 12:35:38 +01:00
senke
f6ebb9d40e [BE-SEC-014] be-sec: Implement secrets management
- Enhanced secrets management with environment-aware defaults
- Fixed RabbitMQ URL: no default credentials in production
- Added getRabbitMQURL with environment-aware logic
- Added ValidateRequiredSecrets to validate required secrets
- Added RequiredSecretKeys listing production-required secrets
- Added validation for RabbitMQ URL in production
- All secrets properly managed via environment variables
- No hardcoded secrets in production code
2025-12-24 12:30:18 +01:00
senke
1394660da3 [BE-SEC-013] be-sec: Implement audit logging for security events
- Added comprehensive audit logging methods for security events
- LogPasswordChange, LogPasswordResetRequest, LogPasswordReset
- LogTwoFactorEnabled, LogTwoFactorDisabled, LogTwoFactorVerification
- LogAccessDenied, LogRoleChange, LogAccountLocked
- LogSecurityEvent for generic security events
- Integrated audit logging in password reset handlers
- All security events logged with IP, user agent, and metadata
2025-12-24 12:27:39 +01:00
senke
0366b87d94 [BE-SEC-011] be-sec: Implement security headers
- Enhanced security headers middleware with additional headers
- Added X-Permitted-Cross-Domain-Policies: none
- Added Cross-Origin-Embedder-Policy: require-corp
- Added Cross-Origin-Opener-Policy: same-origin
- Added Cross-Origin-Resource-Policy: same-origin
- Enhanced Permissions-Policy with additional restrictions
- Enhanced CSP with frame-ancestors directive
- HSTS now only set in production (not in development)
- Updated tests to verify all new headers
2025-12-24 12:24:54 +01:00
senke
03cb70ef41 [BE-SEC-010] be-sec: Implement file upload validation
- Enhanced file validation with robust magic bytes checking
- Added validateMagicBytes to prevent file type spoofing
- Added validateAudioMagicBytes (MP3, FLAC, WAV, OGG, AAC/M4A)
- Added validateImageMagicBytes (JPEG, PNG, GIF, WebP, SVG)
- Added validateVideoMagicBytes (MP4, WebM, OGG, AVI)
- Magic bytes validation runs before MIME type validation
- Existing validations: MIME type, file size, extension, ClamAV scanning
2025-12-24 12:17:06 +01:00
senke
d3bcfd8e60 [BE-SEC-009] be-sec: Implement input sanitization
- Created comprehensive sanitization utility functions
- SanitizeInput, SanitizeText, SanitizeHTML, SanitizeURL, SanitizeEmail, SanitizeUsername
- Applied sanitization to profile handler (username, bio, names, search)
- Applied sanitization to social posts content
- Applied sanitization to comment content
- Applied sanitization to playlist titles and descriptions
- All functions prevent XSS via HTML escaping and remove dangerous URL schemes
- Removes control characters and limits input length to prevent DoS
2025-12-24 12:15:25 +01:00
senke
d2fc79d0fe [BE-SEC-008] be-sec: Implement session timeout and refresh
- Added automatic session refresh mechanism in auth middleware
- Sessions are refreshed when they reach 25% of lifetime remaining
- Refresh happens asynchronously to avoid blocking requests
- Applied to both RequireAuth and OptionalAuth middlewares
- Session timeout enforced through ValidateSession checks
2025-12-24 12:12:29 +01:00
senke
44517da6f6 [BE-SEC-007] security: Implement account lockout after failed login attempts
- Created AccountLockoutService to track failed login attempts
- Accounts are locked after 5 failed attempts within 15 minutes
- Lockout duration: 30 minutes (auto-unlock)
- Service uses Redis for persistence (fail-open if Redis unavailable)
- Integrated into AuthService Login method:
  * Check account lockout status before login
  * Record failed attempts (even for non-existent users to prevent enumeration)
  * Reset failed attempts counter on successful login
  * Auto-unlock expired accounts
- Added SetAccountLockoutService method to AuthService
- Service initialized in router when Redis is available

Phase: PHASE-4
Priority: P1
Progress: 9/267 (3.4%)
2025-12-24 12:10:41 +01:00
senke
616a0ebc9c [BE-SEC-006] security: Implement comprehensive password strength validation
- Enhanced PasswordValidator with additional security checks:
  * Maximum length validation (128 characters)
  * Common password detection (password, 123456, qwerty, etc.)
  * Repetitive pattern detection (aaaa, 1111, etc.)
  * Sequential pattern detection (1234, abcd, qwerty, etc.)
- Added ValidatePasswordChange method to ensure new password is
  sufficiently different from old password (similarity check)
- Updated PasswordService to use enhanced validator consistently
- Replaced utils.ValidatePasswordStrength with validators.PasswordValidator
- All password operations now use the same comprehensive validation rules

Phase: PHASE-4
Priority: P1
Progress: 8/267 (3.0%)
2025-12-24 12:08:03 +01:00
senke
33d1aa988c [BE-SEC-005] security: Implement rate limiting for authentication endpoints
- Applied RegisterRateLimit to POST /auth/register (3 attempts/hour)
- Applied PasswordResetRateLimit to password reset endpoints (3 attempts/hour)
- Added VerifyEmailRateLimit for POST /auth/verify-email (5 attempts/hour)
- Added ResendVerificationRateLimit for POST /auth/resend-verification (3 attempts/hour)
- Login endpoint already had rate limiting (5 attempts/15min)
- All rate limits are IP-based and use Redis for persistence
- Rate limiting disabled in test/e2e environments

Phase: PHASE-4
Priority: P1
Progress: 7/267 (2.6%)
2025-12-24 12:05:35 +01:00
senke
078e512770 [BE-SEC-004] security: Implement CSRF protection for all state-changing endpoints
- Created applyCSRFProtection helper function to apply CSRF middleware
- Applied CSRF protection to all protected routes with POST/PUT/DELETE:
  * Users routes (PUT, POST, DELETE)
  * Tracks routes (POST, PUT, DELETE)
  * Playlists routes (POST, PUT, DELETE)
  * Chat routes (POST)
  * Auth protected routes (POST logout, 2FA)
  * Roles routes (GET only, no state-changing)
  * Marketplace routes (POST)
  * Webhooks routes (POST, DELETE)
  * Comments routes (POST, DELETE)
- CSRF token endpoint (/csrf-token) remains accessible without CSRF check
- Middleware validates X-CSRF-Token header for all state-changing requests
- Protection only applies when Redis is available

Phase: PHASE-4
Priority: P1
Progress: 6/267 (2.2%)
2025-12-24 12:03:27 +01:00
senke
46fb0cc148 [BE-API-040] api: Implement user list endpoint
- Added ListUsers method to UserService with pagination and filtering
- Added ListUsers handler to ProfileHandler
- Registered GET /api/v1/users endpoint in router
- Supports filtering by role, is_active, is_verified, and search
- Supports sorting by created_at, username, email, last_login_at
- Includes pagination metadata (page, limit, total, total_pages, has_next, has_prev)

Phase: PHASE-2
Priority: P1
Progress: 5/267 (1.9%)
2025-12-24 11:59:56 +01:00
senke
58d63f2447 chore: Update BE-API-034 completion status 2025-12-24 11:57:07 +01:00
senke
b7b23ff4da [BE-API-034] be-api: Implement audit log search improvements
- Added additional filters: resource_id, ip_address, user_agent
- Added page-based pagination support in addition to offset-based
- Added CountLogs method to get total count for pagination
- Standardized SearchLogs handler to use RespondSuccess/RespondWithAppError
- Replaced c.Get with GetUserIDUUID helper
- Improved validation for query parameters
- Response includes total count, page, total_pages, and offset metadata

Phase: PHASE-2
Priority: P2
Progress: 41/267 (15.4%)
2025-12-24 11:56:57 +01:00
senke
29c81029bd chore: Update BE-API-033 completion status 2025-12-24 11:54:31 +01:00
senke
2904e7284c [BE-API-033] be-api: Implement webhook stats endpoint validation
- Standardized GetWebhookStats handler to use RespondSuccess/RespondWithAppError
- Replaced c.Get with GetUserIDUUID helper
- Handler retrieves webhook statistics via WebhookWorker.GetStats
- Handler returns queue_size, workers, and max_retries
- Handler uses standard API response format
- Added apperrors import

Phase: PHASE-2
Priority: P2
Progress: 40/267 (15.0%)
2025-12-24 11:54:22 +01:00
senke
31c71bfa89 chore: Update BE-API-032 completion status 2025-12-24 11:52:58 +01:00