Commit graph

296 commits

Author SHA1 Message Date
senke
a9b95368a2 [FE-COMP-010] fe-comp: Add track upload component improvements 2025-12-25 11:47:22 +01:00
senke
a90338a4e9 [FE-COMP-009] fe-comp: Add avatar upload component 2025-12-25 11:44:36 +01:00
senke
0adc9081b4 [FE-COMP-008] fe-comp: Add search bar component 2025-12-25 11:41:20 +01:00
senke
48c72bd702 [FE-COMP-007] fe-comp: Add filter and sort UI components 2025-12-25 11:38:41 +01:00
senke
6bc366678c [FE-COMP-006] fe-comp: Add pagination component to all list views 2025-12-25 11:36:48 +01:00
senke
18d409e4e1 [FE-COMP-005] fe-comp: Add toast notifications for all user actions 2025-12-25 11:32:53 +01:00
senke
91d810f21c [FE-PAGE-018] fe-page: Improve error pages (404, 500) 2025-12-25 11:30:50 +01:00
senke
a3b06a46e8 [FE-PAGE-017] fe-page: Add Admin dashboard page 2025-12-25 11:29:27 +01:00
senke
64f0e3892a [FE-PAGE-016] fe-page: Add Webhooks management page 2025-12-25 11:27:17 +01:00
senke
1ebbb06315 [FE-PAGE-015] fe-page: Add Analytics page 2025-12-25 11:25:06 +01:00
senke
cd663c2226 [FE-API-007] fe-api: Add webhook service integration 2025-12-25 11:20:45 +01:00
senke
54a03a6490 [FE-API-006] fe-api: Add API request/response logging 2025-12-25 11:18:27 +01:00
senke
241ea2fe24 [FE-API-005] fe-api: Add request cancellation support 2025-12-25 11:14:03 +01:00
senke
44046a2b50 [FE-API-004] fe-api: Add retry logic to API client 2025-12-25 11:11:54 +01:00
senke
e532b342d4 [FE-API-003] fe-api: Fix API client response unwrapping 2025-12-25 11:09:19 +01:00
senke
77fa6c483c [DOC-007] doc: Write contributing guide 2025-12-25 11:06:54 +01:00
senke
f3475ca04f [DOC-006] doc: Write troubleshooting guide 2025-12-25 11:02:37 +01:00
senke
34a11721e0 [DOC-005] doc: Write user guide 2025-12-25 10:56:24 +01:00
senke
c4f19754a8 [DOC-004] doc: Write architecture documentation 2025-12-25 02:57:10 +01:00
senke
ee3ad8e2f5 [DOC-003] doc: Write development setup guide 2025-12-25 02:54:47 +01:00
senke
58bf432f41 [DOC-002] doc: Write deployment guide 2025-12-25 02:52:14 +01:00
senke
aef5bcbdb4 [DOC-001] doc: Write API documentation 2025-12-25 02:48:06 +01:00
senke
0ee7232592 [BE-TEST-025] test: Add tests for marketplace flow 2025-12-25 02:39:56 +01:00
senke
33841c9337 [BE-TEST-024] test: Add tests for analytics endpoints 2025-12-25 02:36:50 +01:00
senke
83ded8ab05 [BE-TEST-023] test: Add tests for search functionality 2025-12-25 02:34:17 +01:00
senke
e4946db347 [BE-TEST-022] be-test: Add tests for 2FA flow
- Created comprehensive 2FA flow test suite
- Tests cover 2FA setup (secret generation, QR code, recovery codes)
- Tests cover verification and activation with TOTP codes
- Tests cover login flow with 2FA requirement
- Tests cover status checking and TOTP code validation
- Tests cover complete end-to-end flow (setup -> verify -> login)
- Tests handle SQLite compatibility (GORM for EnableTwoFactor)
- Tests verify error cases (already enabled, invalid codes)
- Tests verify recovery codes generation

Phase: PHASE-5
Priority: P2
Progress: 143/267 (53.56%)
2025-12-25 02:21:16 +01:00
senke
b3735c9e16 [BE-TEST-021] be-test: Add tests for webhook delivery
- Created comprehensive webhook delivery and retry test suite
- Tests cover webhook delivery success with proper headers
- Tests cover retry logic for network errors with exponential backoff
- Tests cover max retries exceeded scenario
- Tests cover signature verification (HMAC-SHA256)
- Tests cover worker retry logic
- Tests for TriggerEvent skipped for SQLite (PostgreSQL array operators not supported)
- Tests verify webhook payload structure and headers (X-Veza-Signature, X-Veza-Event, X-Veza-Timestamp)

Phase: PHASE-5
Priority: P2
Progress: 142/267 (53.18%)
2025-12-25 02:13:27 +01:00
senke
eea79884b9 [BE-TEST-020] be-test: Add tests for filtering and sorting
- Created comprehensive filtering and sorting test suite
- Tests cover tracks endpoints: filtering by user_id, genre, format, combined filters
- Tests cover tracks endpoints: sorting by created_at (asc/desc), title, default sort
- Tests cover users endpoints: filtering by role, is_active, is_verified, search
- Tests cover users endpoints: sorting by created_at, username
- Tests cover playlists endpoints: filtering by user_id
- Tests verify invalid sort fields and orders are handled gracefully
- Tests verify combined filtering and sorting work together
- Note: User search test skipped for SQLite (does not support ILIKE operator)

Phase: PHASE-5
Priority: P2
Progress: 141/267 (52.81%)
2025-12-25 02:09:45 +01:00
senke
096da76c09 [BE-TEST-019] be-test: Add tests for pagination
- Created comprehensive pagination test suite for all list endpoints
- Tests cover tracks, users, and playlists endpoints
- Tests verify default pagination (page=1, limit=20)
- Tests verify custom pagination parameters
- Tests verify invalid parameter validation and correction
- Tests verify pagination metadata (total, total_pages, has_next, has_prev)
- Tests verify navigation between pages
- Tests verify edge cases (empty query, large page numbers, max limit)
- Tests verify total count accuracy
- Tests verify consistency across all endpoints

Phase: PHASE-5
Priority: P2
Progress: 140/267 (52.43%)
2025-12-25 02:05:58 +01:00
senke
1f574bec10 [BE-TEST-018] be-test: Add tests for error handling
- Created comprehensive error handling test suite
- Tests verify error response format standardization
- Tests cover all error types (validation, not found, unauthorized, forbidden, internal, database, conflict, rate limit, quota)
- Tests verify error recovery and retry logic
- Tests verify validation error details
- Tests verify HTTP status code mapping
- Tests verify error response consistency

Phase: PHASE-5
Priority: P2
Progress: 139/267 (52.06%)
2025-12-25 02:02:54 +01:00
senke
f8aa42df20 [BE-TEST-017] be-test: Add security tests for authorization
- Created comprehensive authorization test suite
- Tests verify unauthorized access is blocked (401/403)
- Tests cover: no token, invalid token, expired token
- Tests verify role-based access control (admin, creator, regular user)
- Tests verify ownership checks and admin override
- Tests verify token version mismatch protection

Phase: PHASE-5
Priority: P2
Progress: 138/267 (51.69%)
2025-12-25 02:00:56 +01:00
senke
6e4a3578c9 [BE-TEST-016] be-test: Add security tests for injection attacks
- Created comprehensive security test suite for SQL injection, XSS, and command injection
- Added 30+ SQL injection test payloads
- Added 50+ XSS test payloads
- Added 30+ command injection test payloads
- Tests verify GORM parameterized queries protection
- Tests verify input sanitization utilities
- Added README documentation for security tests

Phase: PHASE-5
Priority: P2
Progress: 137/267 (51.31%)
2025-12-25 01:57:59 +01:00
senke
f71d6add4b [BE-TEST-015] be-test: Add load tests for upload endpoints
- Created k6 load test script for concurrent and chunked uploads
- Added Go performance tests for upload endpoints
- Updated README with usage instructions for upload load tests
- Tests cover simple upload, chunked upload (initiate/chunk/complete), and batch upload
- Performance thresholds defined for upload operations

Phase: PHASE-5
Priority: P2
Progress: 136/267 (50.94%)
2025-12-25 01:55:22 +01:00
senke
05c3d12478 [BE-TEST-015] test: Add load tests for upload endpoints
- Added comprehensive load tests for upload endpoints:
  * Concurrent simple uploads (20 concurrent uploads)
  * Concurrent chunked uploads (5 uploads with 10 chunks each)
  * Chunked upload stress test (10 uploads with 20 chunks each)
  * Upload status polling under load (50 concurrent polls)
- All tests measure throughput, success rates, and response times
- Tests use in-memory SQLite and Redis (if available) for fast execution
- All tests tagged with load build tag
2025-12-25 01:52:22 +01:00
senke
b805ddf9d9 [BE-TEST-014] test: Add performance tests for critical endpoints
- Added comprehensive performance tests for critical endpoints:
  * Health check endpoints (/health, /readyz) - threshold: 10ms
  * Authentication endpoints (login: 100ms, register: 200ms)
  * Track endpoints (list: 50ms, get: 30ms, create: 500ms)
  * Playlist endpoints (list: 50ms, create: 200ms)
  * User endpoints (list: 50ms, get: 30ms)
- Includes both performance tests (measuring response times against thresholds)
- Includes benchmarks using Go benchmark framework
- All tests tagged with performance build tag
- Tests use in-memory SQLite for fast execution
2025-12-25 01:48:38 +01:00
senke
0602d481e7 [BE-TEST-013] test: Add integration tests for CSRF protection
- Added comprehensive integration tests for CSRF protection middleware:
  * GET/HEAD/OPTIONS pass without token (safe methods)
  * POST/PUT/DELETE require valid CSRF token
  * Requests without token are rejected (403)
  * Requests with invalid token are rejected (403)
  * Requests with valid token pass
  * CSRF token generation endpoint
  * Unauthenticated users are not blocked by CSRF
  * Public endpoints are not blocked
  * Each user has their own token
  * Same token can be used multiple times
- Tests use Redis for token storage and validation
- All tests tagged with integration build tag
2025-12-25 01:46:01 +01:00
senke
81fa492c9d [BE-TEST-012] test: Add integration tests for rate limiting
- Added comprehensive integration tests for rate limiting middleware:
  * Global rate limiting (IP-based, 5 requests/minute)
  * Endpoint-specific rate limiting (login: 3 attempts, register: 2 attempts)
  * Different IPs have separate limits
  * Rate limit headers presence and correctness
  * Endpoint-specific headers (X-LoginLimit-*, etc.)
  * Unauthenticated rate limiting
  * Multiple endpoints with separate limits
- Tests use SimpleRateLimiter and EndpointLimiter without Redis for integration testing
- All tests tagged with integration build tag
2025-12-25 01:43:20 +01:00
senke
582dc1c1ea [BE-TEST-011] test: Add integration tests for ownership checks
- Added comprehensive integration tests for ownership middleware:
  * Track owner access (should succeed)
  * Track non-owner access (should be forbidden)
  * Track admin access (should succeed with override)
  * Playlist owner access (should succeed)
  * Playlist non-owner access (should be forbidden)
  * Resource not found (should return 404)
  * Unauthenticated access (should return 401)
  * Complete flow with multiple resources
- Tests use real services and in-memory database for end-to-end testing
- All tests tagged with integration build tag
2025-12-25 01:41:42 +01:00
senke
7a44395625 [BE-TEST-010] test: Add integration tests for playlist collaboration
- Enhanced existing integration tests for playlist collaboration
- Added tests for CreateShareLink endpoint:
  * Create share link as owner
  * Create share link as non-owner (should fail)
  * Create share link for non-existent playlist (should fail)
  * Create share link as admin collaborator
- Existing tests already covered:
  * AddCollaborator (with different permissions)
  * RemoveCollaborator
  * UpdateCollaboratorPermission
  * GetCollaborators
  * CheckPermission
  * CompleteFlow
- All tests use real services and in-memory database for end-to-end testing
2025-12-25 01:39:43 +01:00
senke
c6fcbd966d [BE-TEST-009] test: Add integration tests for track upload flow
- Added comprehensive integration tests for complete track upload flow:
  * Simple upload (multipart form with metadata)
  * Chunked upload (Initiate -> Upload chunks -> Complete)
  * Get upload status
  * Get upload quota
  * Resume interrupted upload
- Tests use real services and in-memory database for end-to-end testing
- All tests tagged with integration build tag
2025-12-25 01:38:54 +01:00
senke
8ab3db364d [BE-TEST-008] test: Add integration tests for auth flow
- Added comprehensive integration tests for complete authentication flow:
  * Complete flow: Register -> Login -> Refresh -> Logout
  * Email verification flow: Register -> Login fails -> Verify -> Login succeeds
  * Username availability checking
  * Resend verification email
  * Invalid refresh token handling
  * Duplicate registration handling
- Tests use real services and in-memory database for end-to-end testing
- All tests tagged with integration build tag
2025-12-25 01:35:38 +01:00
senke
97069a2bf4 [BE-TEST-007] test: Add unit tests for webhook handlers
- Added comprehensive unit tests for all webhook handler methods:
  * RegisterWebhook (success, invalid URL, no events, unauthorized)
  * ListWebhooks (success)
  * DeleteWebhook (success, not found, invalid ID)
  * GetWebhookStats (success)
  * TestWebhook (success, not found)
  * RegenerateAPIKey (success, not found, invalid ID)
- Fixed validation bug in BindAndValidateJSON to properly return errors for binding validation failures
- Fixed compilation errors in profile_handler_test.go and room_handler_test.go
- All tests passing
2025-12-25 01:32:54 +01:00
senke
8de077d647 [BE-TEST-006] test: Add unit tests for marketplace handlers
- Created marketplace_test.go with comprehensive unit tests
- Tests cover CreateProduct, ListProducts, UpdateProduct
- Tests cover CreateOrder, ListOrders, GetOrder, GetDownloadURL
- Tests include success scenarios, error cases (not found, invalid IDs, no license)
- Uses in-memory SQLite database with real services for realistic testing
- All tests compile successfully

Phase: PHASE-5
Priority: P2
Progress: 126/267 (47.2%)
2025-12-25 01:30:25 +01:00
senke
20a8b4df77 [BE-TEST-005] test: Add unit tests for chat handlers
- Enhanced chat_handler_test.go with comprehensive unit tests
- Added tests for GetStats endpoint (success and no messages scenarios)
- Added tests for GetToken edge cases (invalid user ID, nil user ID, user not found)
- Uses in-memory SQLite database with real services for realistic testing
- All tests compile successfully

Phase: PHASE-5
Priority: P2
Progress: 125/267 (46.8%)
2025-12-25 01:28:36 +01:00
senke
f7d274e4ce [BE-TEST-004] test: Add unit tests for user/profile handlers
- Created profile_handler_test.go with comprehensive unit tests
- Tests cover GetProfile, GetProfileByUsername, ListUsers, SearchUsers
- Tests cover UpdateProfile, DeleteUser, GetProfileCompletion
- Tests cover FollowUser, UnfollowUser, BlockUser, UnblockUser
- Uses in-memory SQLite database with real services for realistic testing
- All tests compile successfully

Phase: PHASE-5
Priority: P2
Progress: 124/267 (46.4%)
2025-12-25 01:27:38 +01:00
senke
0bbd970653 [BE-TEST-003] test: Add unit tests for playlist handlers
- Created playlist_handler_test.go with comprehensive unit tests
- Tests cover CreatePlaylist, GetPlaylist, GetPlaylists, UpdatePlaylist, DeletePlaylist
- Tests cover AddTrack, RemoveTrack, AddCollaborator, GetCollaborators, RemoveCollaborator
- Uses in-memory SQLite database with real services for realistic testing
- All tests compile successfully

Phase: PHASE-5
Priority: P2
Progress: 123/267 (46.1%)
2025-12-25 01:25:33 +01:00
senke
537da5076c [BE-TEST-002] test: Add unit tests for track handlers
- Created handler_test.go with comprehensive unit tests
- Tests cover GetTrack, ListTracks, UpdateTrack, DeleteTrack, LikeTrack, SearchTracks
- Uses in-memory SQLite database with real services for realistic testing
- All tests pass successfully

Phase: PHASE-5
Priority: P2
Progress: 122/267 (45.7%)
2025-12-24 18:19:34 +01:00
senke
dce5ff3484 [BE-TEST-001] be-test: Add unit tests for auth handlers
- Created comprehensive unit tests for all authentication handlers
- Tests cover Login, Register, Refresh, Logout, VerifyEmail, ResendVerification, CheckUsername, and GetMe
- Tests use real AuthService with in-memory SQLite database for realistic testing
- All handlers tested with success cases, error cases, and edge cases
- Fixed ExpiresIn calculation in Login and Refresh handlers to handle TokenPair.ExpiresIn
- Test coverage includes:
  - Login: success, invalid credentials, email not verified, requires 2FA, invalid request
  - Register: success, user already exists, invalid email, weak password, invalid request
  - Refresh: invalid request (token validation tested via integration tests)
  - Logout: success, unauthorized
  - VerifyEmail: missing token
  - ResendVerification: success
  - CheckUsername: available, taken, missing username
  - GetMe: success, unauthorized

Phase: PHASE-5
Priority: P2
Progress: 121/267 (45.32%)
2025-12-24 18:14:31 +01:00
senke
49dd584d67 [BE-SEC-015] be-sec: Implement dependency vulnerability scanning
- Verified existing vulnerability scanning implementation
- Workflow .github/workflows/vulnerability-scan.yml uses govulncheck for Go dependencies
- Workflow uses Trivy for Docker image scanning
- Makefile includes vulncheck target for local scanning
- System automatically blocks PRs if HIGH/CRITICAL vulnerabilities found
- Documentation exists in docs/VULNERABILITY_SCANNING.md
- Scanning works correctly (verified with make vulncheck)

Phase: PHASE-4
Priority: P2
Progress: 120/267 (44.94%)
2025-12-24 18:05:15 +01:00
senke
3cfefaa24c [BE-SEC-012] be-sec: Implement API key authentication for webhooks
- Added APIKey field to Webhook model with unique index
- Implemented GenerateAPIKey() method using crypto/rand for secure key generation
- Implemented ValidateAPIKey() method to authenticate webhook requests
- Implemented RegenerateAPIKey() method to rotate API keys
- Created WebhookAPIKeyMiddleware for validating API keys in requests
- Middleware supports X-API-Key header and Authorization: Bearer format
- Added endpoint POST /api/v1/webhooks/:id/regenerate-key
- API keys are prefixed with 'whk_' for identification
- Comprehensive unit tests for all API key functionality
- Inactive webhooks cannot authenticate with their API keys

Phase: PHASE-4
Priority: P2
Progress: 119/267 (44.57%)
2025-12-24 18:03:52 +01:00
senke
b8adaf8935 [BE-SVC-022] be-svc: Implement data export service
- Created DataExportService for comprehensive user data export (GDPR compliance)
- Exports all user data: profile, settings, tracks, playlists, comments, likes, analytics, federated identities, roles
- Added ExportUserData method to retrieve all user data from database
- Added ExportUserDataAsJSON method to export as downloadable JSON file
- Added endpoint GET /api/v1/users/me/export that returns JSON file download
- Comprehensive unit tests for export service
- Proper error handling and logging

Phase: PHASE-6
Priority: P2
Progress: 118/267 (44.19%)
2025-12-24 18:01:00 +01:00
senke
250d243fb8 [BE-SVC-021] be-svc: Implement error recovery mechanisms
- Created recovery package with comprehensive retry logic
- Implemented Retry and RetryWithResult with configurable strategies
- Added exponential backoff with jitter support
- Created multiple recovery strategies:
  - RetryRecoveryStrategy: retry with backoff
  - FallbackRecoveryStrategy: fallback function
  - CircuitBreakerRecoveryStrategy: wait for circuit breaker
  - CompositeRecoveryStrategy: combine multiple strategies
- Added helper functions: IsRetryableError, IsTemporaryError, IsPermanentError
- Support for context cancellation and timeout
- Comprehensive unit tests for all recovery mechanisms

Phase: PHASE-6
Priority: P2
Progress: 117/267 (43.82%)
2025-12-24 17:52:53 +01:00
senke
fe7cf7fc04 [BE-SVC-020] be-svc: Implement request validation improvements
- Enhanced error messages in validator with more descriptive and contextual messages
- Added custom validations: slug, phone, date_iso, not_empty
- Created QueryParamValidation middleware for query parameter validation
- Support for validation rules: numeric, integer, min, max, oneof, email, uuid, url
- Improved error messages for all validation tags (40+ tags supported)
- Comprehensive unit tests for query parameter validation
- Better error context and user-friendly messages

Phase: PHASE-6
Priority: P2
Progress: 116/267 (43.45%)
2025-12-24 17:09:54 +01:00
senke
7bafb85e22 [BE-SVC-019] be-svc: Implement API versioning strategy
- Created VersionManager for managing API versions
- Added VersionMiddleware for automatic version detection:
  - X-API-Version header
  - Accept header (application/vnd.veza.v1+json)
  - URL path (/api/v1/...)
- Added support for deprecated versions with sunset dates
- Added /api/versions endpoint for version information
- Added helpers: GetAPIVersion, GetAPIVersionInfo
- Comprehensive unit tests for versioning system
- Integrated version manager in APIRouter

Phase: PHASE-6
Priority: P2
Progress: 115/267 (43.07%)
2025-12-24 17:07:30 +01:00
senke
0ac3b82962 [BE-SVC-018] be-svc: Implement request tracing
- Created TraceContext struct for distributed tracing
- Implemented W3C Trace Context format support (traceparent header)
- Added backward compatibility with legacy X-Trace-ID and X-Span-ID headers
- Created HTTPClientWithTracing for automatic trace propagation in outgoing requests
- Enhanced Tracing middleware to use new trace context system
- Added context propagation helpers (WithTraceContext, FromContext)
- Added child span creation for nested operations
- Comprehensive unit tests for trace context and HTTP client

Phase: PHASE-6
Priority: P2
Progress: 114/267 (42.70%)
2025-12-24 17:05:32 +01:00
senke
965633ef89 [BE-SVC-017] be-svc: Implement graceful shutdown
- Created ShutdownManager for coordinated graceful shutdown of all services
- Added Shutdowner interface for services that need graceful shutdown
- Implemented parallel shutdown with individual timeouts (10s per service)
- Added global shutdown timeout (30s total)
- Integrated shutdown manager in main.go for:
  - HTTP server shutdown
  - JobWorker cancellation
  - Config.Close() (DB, Redis, RabbitMQ)
  - Logger sync
  - Sentry flush
- Added comprehensive unit tests for shutdown manager
- Prevents registration of new services during shutdown

Phase: PHASE-6
Priority: P2
Progress: 113/267 (42.32%)
2025-12-24 17:03:11 +01:00
senke
2f2c8a032c [BE-SVC-016] be-svc: Implement health check improvements
- Enhanced HealthCheck struct with Details field for additional metrics
- Added detailed database pool statistics (open connections, in use, idle, wait counts)
- Added health checks for S3 storage service (if enabled)
- Added health checks for Job Worker with job queue statistics
- Added health checks for Email Sender (SMTP configuration)
- Updated HealthHandler to accept additional services
- Updated router to pass S3, JobWorker, and EmailSender to health handler

Phase: PHASE-6
Priority: P2
Progress: 112/267 (41.95%)
2025-12-24 17:00:53 +01:00
senke
e1cf8472b6 [BE-SVC-015] be-svc: Implement logging aggregation
- Added HTTP writer for centralized log collection (Loki-compatible)
- Created AggregationConfig with batch processing and flush intervals
- Integrated with existing zap logger using multi-core approach
- Added environment variables for configuration (LOG_AGGREGATION_ENABLED, LOG_AGGREGATION_ENDPOINT, etc.)
- Added unit tests for aggregation functionality
- Updated config.go to initialize logger with aggregation if enabled

Phase: PHASE-6
Priority: P2
Progress: 111/267 (41.57%)
2025-12-24 16:58:58 +01:00
senke
f5d8486caa [BE-SVC-014] be-svc: Implement monitoring and alerting
- Created monitoring and alerting service with Prometheus integration
- Support for alert rules with thresholds and severities
- Alert firing and resolution tracking
- Notification callbacks for alert events
- Continuous monitoring with configurable intervals
- Default alert rules for common scenarios
- Prometheus query evaluation and threshold checking
- Comprehensive unit tests for core functionality
2025-12-24 16:54:19 +01:00
senke
03f35dbb7c [BE-SVC-013] be-svc: Implement CDN integration
- Created CDN service with support for multiple providers
- Support for CloudFront, Cloudflare, and generic CDN
- URL generation for assets, audio, HLS streams, and images
- Cache invalidation with batch support
- Signed URL generation for private content
- Cache headers configuration
- Provider abstraction for easy switching
- Comprehensive unit tests for all functionality
2025-12-24 16:52:06 +01:00
senke
0090fdfb8b [BE-SVC-012] be-svc: Implement HLS streaming service
- Enhanced HLS streaming service with additional features
- Stream validation and health checks
- URL generation for master and quality playlists
- Stream cleanup and management
- Statistics and monitoring
- Stream listing with filtering and pagination
- Status updates and existence checks
- Comprehensive unit tests for core functionality
2025-12-24 16:49:57 +01:00
senke
d52efd811e [BE-SVC-011] be-svc: Implement audio transcoding service
- Created AudioTranscodeService with FFmpeg support
- Support for multiple audio formats (MP3, AAC, FLAC, OGG, WAV, M4A)
- Configurable bitrates and quality presets (low, medium, high, lossless)
- Sample rate and channel configuration
- Timeout handling and error management
- Transcode and TranscodeMultiple methods
- FFmpeg availability checking
- Audio metadata extraction using ffprobe
- Format validation and codec selection
- Comprehensive unit tests for core functionality
2025-12-24 16:47:48 +01:00
senke
dee331c5ff [BE-SVC-010] be-svc: Implement image processing service
- Enhanced image processing service with multiple features
- Support for multiple image sizes (thumbnail, small, medium, large)
- Multiple output formats (JPEG, PNG, WebP)
- Configurable quality settings and processing options
- ProcessImage with customizable options
- ProcessAvatar for optimized avatar processing
- ProcessImageMultipleSizes for batch processing
- OptimizeImage for target file size optimization
- Image format conversion and validation
- Comprehensive unit tests for core functions
2025-12-24 16:44:58 +01:00
senke
5ed6929aa9 [BE-SVC-009] be-svc: Implement notification service
- Created Notification model for GORM with proper relationships
- Enhanced NotificationService with GORM-based implementation
- Features: pagination, filtering by type/read status, batch creation
- Mark as read (single and all), deletion (single and all read)
- Unread count and notification types listing
- Comprehensive unit tests for all operations
- Better error handling and logging
2025-12-24 16:41:11 +01:00
senke
597607bf01 [BE-SVC-008] be-svc: Implement analytics aggregation service
- Created AnalyticsAggregationService for analytics_events table
- Aggregation by event type and time period (hour, day, week, month)
- Support for filtering by event names and user ID
- Features: event counts, unique users, average per user, payload summary
- Top events ranking and user activity counts
- Uses PostgreSQL date_trunc and to_char for period grouping
- Added unit tests for service validation and helper functions
2025-12-24 16:38:09 +01:00
senke
6e4590d493 [BE-SVC-007] be-svc: Implement recommendation engine
- Created TrackRecommendationService with ML-based algorithms
- Collaborative filtering (40%) using similar users' preferences
- Content-based filtering (30%) using track metadata (genre, artist, year)
- Popularity scoring (20%) based on play_count and like_count
- Recency scoring (10%) for recently uploaded tracks
- Support for seed tracks, genre filtering, and track exclusion
- Added unit tests for scoring algorithms
- Combines multiple algorithms for personalized recommendations
2025-12-24 16:34:17 +01:00
senke
301370ad1a [BE-SVC-006] be-svc: Implement search service
- Created FullTextSearchService using PostgreSQL tsvector/tsquery
- Supports full-text search for tracks, users, and playlists
- Uses GIN indexes from migration 048_search_indexes.sql
- Features relevance scoring with ts_rank_cd
- Weighted search (title/name weighted higher than description)
- Pagination and minimum relevance score filtering
- Unified search across all types and individual search methods
- Added unit tests for service validation and query preparation
2025-12-24 16:31:40 +01:00
senke
4c652150c5 [BE-SVC-005] be-svc: Implement file storage abstraction
- Added AWS SDK v2 dependency for S3 support
- Created S3StorageService implementing S3Service interface
- Support for AWS S3 and MinIO (S3-compatible storage)
- Added S3 configuration in config.go with environment variables
- Implemented upload, delete, presigned URL, and public URL methods
- Added unit tests for service validation and URL generation
- Service integrates with existing TrackStorageService
2025-12-24 16:28:51 +01:00
senke
1cf863a78b [BE-SVC-004] be-svc: Implement email service 2025-12-24 16:11:02 +01:00
senke
64d764c16f [BE-SVC-003] be-svc: Implement background job queue 2025-12-24 16:08:51 +01:00
senke
dc4fd2f3e1 [BE-SVC-002] be-svc: Implement rate limiting per user 2025-12-24 16:04:36 +01:00
senke
a11e1820b6 [BE-SVC-001] be-svc: Implement caching layer for frequently accessed data 2025-12-24 16:02:16 +01:00
senke
80ce04e8c6 [BE-DB-018] be-db: Add database performance monitoring 2025-12-24 15:58:48 +01:00
senke
e23a701d7b [BE-DB-017] be-db: Add database migration rollback tests 2025-12-24 15:57:19 +01:00
senke
96d9065066 [BE-DB-016] be-db: Add database backup strategy 2025-12-24 15:55:46 +01:00
senke
0bc1192ee4 [BE-DB-015] be-db: Optimize database connection pooling 2025-12-24 15:53:19 +01:00
senke
3ab31d9c5c [BE-DB-014] be-db: Add database triggers for audit logging 2025-12-24 15:47:38 +01:00
senke
8007d9e387 [BE-DB-013] be-db: Add database views for common queries 2025-12-24 15:46:29 +01:00
senke
783ff06f13 [BE-DB-012] be-db: Create migration for analytics_events table (already exists) 2025-12-24 15:45:17 +01:00
senke
15618c3d98 [BE-DB-011] be-db: Add database constraints for data validation 2025-12-24 15:43:52 +01:00
senke
530f170ef9 [BE-DB-010] be-db: Add composite indexes for common queries 2025-12-24 15:14:17 +01:00
senke
caab043970 [BE-DB-009] be-db: Add indexes for search queries 2025-12-24 15:13:03 +01:00
senke
974ef31a9c [BE-DB-008] be-db: Create migration for notifications table 2025-12-24 15:12:11 +01:00
senke
5c8a49d4f5 [BE-DB-007] be-db: Create migration for user_blocks table 2025-12-24 15:11:32 +01:00
senke
c1f6e93c95 [BE-DB-006] be-db: Create migration for user_follows table 2025-12-24 15:10:34 +01:00
senke
d0e25a3924 [BE-DB-005] be-db: Create migration for playlist_share_link table 2025-12-24 15:09:44 +01:00
senke
b646243bdf [BE-DB-004] be-db: Add created_at and updated_at timestamps to all models 2025-12-24 15:08:43 +01:00
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
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
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
senke
78a25f63f7 [BE-API-032] be-api: Implement upload stats endpoint
- Added GetUploadStats method in TrackUploadService to calculate statistics from tracks table
- Standardized GetUploadStats handler to use RespondSuccess/RespondWithAppError
- Replaced c.Get with GetUserIDUUID helper
- Handler retrieves statistics: total_uploads, total_size, audio_files, image_files, video_files
- Updated UploadHandler to include TrackUploadService dependency
- Updated router to pass TrackUploadService to UploadHandler

Phase: PHASE-2
Priority: P2
Progress: 39/267 (14.6%)
2025-12-24 11:52:49 +01:00
senke
325c496254 chore: Update BE-API-031 completion status 2025-12-24 11:48:54 +01:00
senke
d294245761 [BE-API-031] be-api: Implement session stats endpoint
- Standardized GetSessionStats handler to use RespondSuccess/RespondWithAppError
- Replaced c.Get with GetUserIDUUID helper
- Handler retrieves session statistics via SessionService.GetSessionStats
- Handler returns total_active sessions and unique_users count
- Handler uses standard API response format

Phase: PHASE-2
Priority: P2
Progress: 38/267 (14.2%)
2025-12-24 11:48:43 +01:00
senke
7724d28325 chore: Update BE-API-030 completion status 2025-12-24 11:47:25 +01:00
senke
5886fba2ec [BE-API-030] be-api: Implement session refresh endpoint validation
- Standardized RefreshSession handler to use RespondSuccess/RespondWithAppError
- Replaced c.Get with GetUserIDUUID helper
- Handler validates Authorization header and extracts Bearer token
- Handler extends session timeout to 24 hours via SessionService.RefreshSession
- Handler properly handles errors (session not found, expired, internal errors)
- Handler returns message, expires_in, and expires_at
- Handler uses standard API response format

Phase: PHASE-2
Priority: P1
Progress: 37/267 (13.9%)
2025-12-24 11:47:15 +01:00
senke
f9fde5e45b chore: Update BE-API-029 completion status 2025-12-24 11:45:41 +01:00
senke
4af22ab1c2 [BE-API-029] be-api: Implement shared track access endpoint validation
- Standardized GetSharedTrack handler to use RespondSuccess/RespondWithAppError
- Handler validates share token via TrackShareService.ValidateShareToken
- Handler retrieves track by share.TrackID
- Handler properly handles errors (share not found, expired, track not found)
- Handler returns track and share information
- Handler uses standard API response format
- Endpoint is public (no authentication required)

Phase: PHASE-2
Priority: P1
Progress: 36/267 (13.5%)
2025-12-24 11:45:27 +01:00
senke
fb31c6ceb8 chore: Update BE-API-028 completion status 2025-12-24 11:43:47 +01:00
senke
3a38b23381 [BE-API-028] be-api: Implement track share revoke endpoint validation
- Standardized RevokeShare handler to use RespondSuccess/RespondWithAppError
- Handler validates share ID and checks ownership
- Handler revokes share link via TrackShareService.RevokeShare
- Handler properly handles errors (share not found, forbidden, internal errors)
- Handler uses standard API response format

Phase: PHASE-2
Priority: P1
Progress: 35/267 (13.1%)
2025-12-24 11:43:31 +01:00
senke
0024b5320e chore: Update BE-API-027 completion status 2025-12-24 11:42:12 +01:00
senke
5bc2498744 [BE-API-027] be-api: Implement user liked tracks endpoint
- Standardized GetUserLikedTracks handler to use RespondSuccess/RespondWithAppError
- Added limit validation (max 100)
- Moved route from setupTrackRoutes to setupUserRoutes in protected group
- Handler uses existing TrackLikeService methods
- Handler returns paginated results with tracks, total, limit, and offset
- Handler uses standard API response format

Phase: PHASE-2
Priority: P1
Progress: 34/267 (12.7%)
2025-12-24 11:41:50 +01:00
senke
cabe17b1f2 chore: Update BE-API-024 completion status 2025-12-24 11:39:30 +01:00
senke
dc9e52ae7c [BE-API-024] be-api: Implement track batch operations validation
- Standardized BatchDeleteTracks and BatchUpdateTracks handlers
- Handlers use RespondSuccess and RespondWithAppError
- BatchDeleteTracks validates IDs, checks ownership, deletes in batch
- BatchUpdateTracks validates IDs and updates, checks ownership, updates in batch
- Both handlers return results with successful and failed operations
- Handlers use standard API response format

Phase: PHASE-2
Priority: P2
Progress: 33/267 (12.4%)
2025-12-24 11:39:21 +01:00
senke
f4dd60e230 chore: Update BE-API-023 completion status 2025-12-24 11:37:59 +01:00
senke
ea97662e63 [BE-API-023] be-api: Implement user completion endpoint validation
- Standardized GetProfileCompletion handler to use GetUserIDUUID
- Added validation to ensure completion percentage is between 0 and 100
- Handler already existed and was working correctly
- Endpoint returns correct completion percentage (0-100) and missing fields
- Handler uses standard API response format

Phase: PHASE-2
Priority: P1
Progress: 32/267 (12.0%)
2025-12-24 11:37:51 +01:00
senke
030905a1b2 chore: Update BE-API-022 completion status 2025-12-24 11:36:27 +01:00
senke
48734f8526 [BE-API-022] be-api: Implement avatar delete endpoint
- DeleteAvatar handler was already implemented and standardized
- Added route: DELETE /users/:userId/avatar
- Handler validates user authentication and ownership
- Handler deletes avatar file from storage and updates database
- Handler uses standard API response format

Phase: PHASE-2
Priority: P1
Progress: 31/267 (11.6%)
2025-12-24 11:36:15 +01:00
senke
e5ecaa7a3b chore: Update BE-API-021 completion status 2025-12-24 11:34:51 +01:00