Commit Graph

166 Commits

Author SHA1 Message Date
Brian O'Reilly 26c516c25d this is kind of a dead patch. clean up working set. 2025-10-11 13:21:38 -04:00
Brian O'Reilly b61e9c891a dep to run music scan in parallel. 2025-10-11 13:20:42 -04:00
Brian O'Reilly a739edc16f update TODO with some UI items. 2025-10-11 13:20:14 -04:00
glenneth 6e82688959 Update documentation authors to Asteroid Radio Development Team 2025-10-10 16:13:29 +03:00
glenneth 925a624bda Documentation cleanup: remove outdated files, add API docs, update core documentation 2025-10-10 16:13:29 +03:00
glenneth da054c1ab9 Updated changes in api-refactoring 2025-10-10 07:27:07 -04:00
glenneth e126426acd Updated TESTING.org 2025-10-10 07:27:07 -04:00
Luis Pereira 549ba8b38f feat: improved navbar in all pages 2025-10-10 07:26:39 -04:00
Luis Pereira 2b6bad3348 feat: improved nav styling 2025-10-10 07:26:39 -04:00
Brian O'Reilly dff2f52f7b Merge branch 'glenneth1-api-refactoring-only' 2025-10-10 07:24:58 -04:00
Glenn Thompson 82785e1da1 Fix frontend JavaScript to work with define-api endpoints
- Update API paths from /asteroid/api/ to /api/asteroid/ in users.js and profile.js
- Add RADIANCE API wrapper handling for icecast-status responses
- Improve error handling in player.js loadTracks function
- All frontend code now properly handles define-api response format
2025-10-09 17:50:20 -04:00
Glenn Thompson 5bc6f27840 Fix frontend JavaScript to work with define-api endpoints
- Update API paths from /asteroid/api/ to /api/asteroid/ in users.js and profile.js
- Add RADIANCE API wrapper handling for icecast-status responses
- Improve error handling in player.js loadTracks function
- All frontend code now properly handles define-api response format
2025-10-08 22:56:54 -04:00
glenneth 5e33d2aafe Add comprehensive automated test suite
- Created test-server.sh with 25+ automated tests
- Tests all API endpoints, HTML pages, and static files
- Color-coded output with detailed pass/fail reporting
- Verbose mode for debugging
- Added TESTING.org documentation with usage guide
- CI/CD ready for integration into workflows

Test coverage:
- 15 API endpoints (all define-api conversions)
- 5 HTML pages (define-page)
- Static file serving
- JSON format validation
- Authentication and authorization

All tests passing except Icecast (expected - containers not running)
2025-10-08 22:56:54 -04:00
glenneth e0c1eac408 Refactor API endpoints to use Radiance's define-api macro
- Converted 15 API endpoints from define-page to define-api
- Added JSON API format configuration for proper JSON responses
- Updated all frontend JavaScript files to use new API URLs
- Maintained define-page for HTML pages and static file serving
- Added comprehensive documentation of changes

Benefits:
- Framework compliance with Radiance best practices
- Automatic routing at /api/asteroid/<name>
- Clean lambda-list parameter handling
- Built-in browser/API dual usage support
- Proper HTTP status codes for errors

All API endpoints tested and working correctly.
2025-10-08 22:56:54 -04:00
glenneth a77b7768c4 Add comprehensive automated test suite
- Created test-server.sh with 25+ automated tests
- Tests all API endpoints, HTML pages, and static files
- Color-coded output with detailed pass/fail reporting
- Verbose mode for debugging
- Added TESTING.org documentation with usage guide
- CI/CD ready for integration into workflows

Test coverage:
- 15 API endpoints (all define-api conversions)
- 5 HTML pages (define-page)
- Static file serving
- JSON format validation
- Authentication and authorization

All tests passing except Icecast (expected - containers not running)
2025-10-08 05:20:56 +03:00
glenneth 5fcb1a06d5 Refactor API endpoints to use Radiance's define-api macro
- Converted 15 API endpoints from define-page to define-api
- Added JSON API format configuration for proper JSON responses
- Updated all frontend JavaScript files to use new API URLs
- Maintained define-page for HTML pages and static file serving
- Added comprehensive documentation of changes

Benefits:
- Framework compliance with Radiance best practices
- Automatic routing at /api/asteroid/<name>
- Clean lambda-list parameter handling
- Built-in browser/API dual usage support
- Proper HTTP status codes for errors

All API endpoints tested and working correctly.
2025-10-08 05:09:50 +03:00
glenneth 19c984b238 Merge remote-tracking branch 'upstream/main' 2025-10-08 04:34:56 +03:00
glenneth dde8027b5c WORKING: API-aware authentication returns JSON for API routes
 Solution:
- require-authentication returns T on success, api-output value on failure
- Endpoints check result: if T, execute body; else return api-output value
- api-output sets response data which gets returned to client

 Results:
- API routes return JSON errors (not HTML redirects)
- Page routes still redirect to login
- Player page handles auth errors gracefully
- Shows 'Error loading tracks' instead of crashing

 Pattern:
  (let ((auth-result (require-authentication)))
    (if (eq auth-result t)
        ;; authenticated - execute endpoint
        ...
        ;; not authenticated - return api-output value
        auth-result))

Thanks to easilokx for the guidance on Radiance patterns!
2025-10-07 18:39:49 -04:00
glenneth dff299923e Fix api-output usage: pass structured data with :status and :message
- Remove handler-case that was catching api-output's condition
- Pass alist data structure instead of JSON string
- Use :status and :message keyword arguments as per Radiance docs
- Detection and formatting work correctly
- Issue: api-output doesn't stop execution from helper function
- Need Radiance-specific pattern (redirect works, api-output doesn't)
2025-10-07 18:39:49 -04:00
glenneth 9ec7848b47 Add API-aware authentication with auto-detection (needs execution flow fix)
 Working:
- Auto-detects API requests from /api/ in URI
- Optional :api keyword parameter for explicit control
- Returns JSON for API requests, redirects for pages
- Page redirects work perfectly (admin page redirects to login)
- API detection logs show correct behavior

 Issue:
- API endpoints still execute after require-authentication returns JSON
- radiance:api-output doesn't stop execution like redirect does
- Need proper Radiance mechanism to halt request processing

Question for easilokx:
What's the correct way to stop execution and return JSON from a helper
function like require-authentication? We tried api-output but execution
continues. How does redirect actually stop execution?
2025-10-07 18:39:49 -04:00
glenneth 707e7aba96 WIP: Add API-aware authentication (detection works, need to fix execution flow)
- Add api-auth-error condition for API authentication failures
- Update require-authentication and require-role to detect /api/ routes
- Add :api keyword parameter for explicit API/page mode
- Auto-detects API requests from URI path
- Returns JSON for API requests, redirects for page requests
- Issue: Execution continues after returning JSON, need Radiance-specific solution
2025-10-07 18:39:49 -04:00
glenneth efb96f950e Fix auth form styling: wider forms (600px) and hidden message boxes
- Increased auth-form max-width from 400px to 600px to match site styling
- Reduced form-group margin-bottom from 3rem to 1.5rem for better spacing
- Added display:none to error/success message boxes by default
- Message boxes now only show when server sets display-error/display-success
2025-10-07 18:39:49 -04:00
glenneth 5d31763e85 Add user registration and authentication UI improvements
- Add registration page with form validation
- Add login/register/logout navigation with conditional display
- Add auth-status API endpoint for session checking
- Add auth-ui.js for dynamic nav based on login state
- Update navigation across all pages (front, admin, profile, player)
- Style logout button with subtle red color
- Auto-login after successful registration
2025-10-07 18:39:49 -04:00
glenneth fa1de1c874 Update profile page to match site-wide layout and styling
- Remove narrow profile-container (600px) in favor of standard container (1200px)
- Replace profile-card divs with admin-section to match admin page styling
- Add consistent h1 header matching other pages
- Remove unused profile-container and profile-card CSS classes
- Keep profile-specific utility styles (profile-info, artist-stats, etc.)
2025-10-07 18:39:49 -04:00
glenneth f7bc30f18c Add user profile page with edit functionality 2025-10-07 18:39:49 -04:00
glenneth 1b1445e25f Add user profile page with clip template styling
- Created profile.chtml template with listening statistics, recent tracks, and top artists
- Added profile.js for dynamic data loading and user interactions
- Extended LASS styles for profile-specific elements (artist stats, track items, activity charts)
- Implemented /profile route with authentication and template rendering
- Added profile API endpoints for user data, stats, recent tracks, and top artists
- Added profile link to main navigation
- Includes placeholder functionality for future listening metrics implementation
2025-10-07 18:39:49 -04:00
Glenn Thompson b31800a7db Fix playlist schema mismatch - use track-ids field consistently
- Fixed field name mismatch: schema uses 'track-ids' not 'tracks'
- Handle Radiance DB storing text fields as lists
- Parse/format comma-separated track IDs properly
- Code is now correct but db:update still doesn't persist (i-lambdalite limitation)
- Requires PostgreSQL for full functionality
2025-10-07 18:39:49 -04:00
Glenn Thompson 8af85afe0e Fix playlist schema mismatch - use track-ids field consistently
- Fixed field name mismatch: schema uses 'track-ids' not 'tracks'
- Handle Radiance DB storing text fields as lists
- Parse/format comma-separated track IDs properly
- Code is now correct but db:update still doesn't persist (i-lambdalite limitation)
- Requires PostgreSQL for full functionality
2025-10-06 04:38:03 +03:00
Luis Pereira ba13777206 fix: use nav styles on front page 2025-10-05 20:48:58 -04:00
Luis Pereira d12fde7248 fix: some sizing of live player 2025-10-05 20:48:58 -04:00
Luis Pereira 82071bb18d fix: pseudo selectors on lass are now working 2025-10-05 20:48:58 -04:00
Luis Pereira d87c1be373 fix: lass rules moved up one level
Some rules were one level deeper and being created inside the btn rule
2025-10-05 20:48:58 -04:00
Luis Pereira d0649a611e fix: move font import to lass file 2025-10-05 20:48:58 -04:00
Luis Pereira 8589b774ed fix: add user management page 2025-10-04 16:10:50 -04:00
Luis Pereira c2e7cfe943 feat: move users javascript code to own file 2025-10-04 16:10:50 -04:00
Luis Pereira bd1b993a03 feat: move player javascript code to own file 2025-10-04 16:10:50 -04:00
Luis Pereira 6edbb5754b feat: move frontpage javascript code to own file 2025-10-04 16:10:50 -04:00
Luis Pereira 35f4c6516b feat: move admin javascript code to own file
Some html element ids and api routes are also fixed here.
2025-10-04 16:10:50 -04:00
Brian O'Reilly cd3c2347ec but, you know, include all the things done. 2025-10-04 14:14:15 -04:00
Brian O'Reilly 14b6904cf5 we provisioned b612.asteroid.radio, update the TODO.org file. 2025-10-04 14:11:44 -04:00
Brian O'Reilly 439da74bb3 remove duplicated code. 2025-10-04 10:31:46 -04:00
Glenn Thompson 803555b8b1 Complete Templates section: CLIP refactoring, user management, pagination, playlists, UI fixes, PostgreSQL setup
 CLIP Template Refactoring:
- Centralized template rendering in template-utils.lisp
- Template caching for performance
- Eliminated code duplication

 User Management:
- Dedicated /admin/users page
- User creation, roles, activation
- Comprehensive API endpoints
- Full test suite

 Track Pagination:
- Admin dashboard: 10/20/50/100 per page
- Web player: 10/20/50 per page
- Smart navigation controls

⚠️ Playlist System (PARTIAL):
- Create empty playlists 
- View playlists 
- Save/load playlists  (database UPDATE fails)
- Audio playback fixed 
- Database limitations documented

 PostgreSQL Setup:
- Docker container configuration
- Complete database schema
- Persistent storage
- Radiance configuration
- Ready for Fade to integrate

 Streaming Infrastructure:
- All 3 streams working (MP3 128k, AAC 96k, MP3 64k)
- Fixed AAC stream (Docker caching issue)
- NAS music mount configured

 UI Fixes:
- Green live stream indicators
- Correct stream quality display
- Now Playing verified working
- Missing API endpoints added

📚 Documentation:
- 6 comprehensive org files
- Complete technical documentation
- Known issues documented

Note: Playlist editing requires PostgreSQL migration (Fade's task)
2025-10-04 09:54:04 -04:00
Glenn Thompson ab7a7c47b5 Complete CLIP template refactoring and all template features
 CLIP Template System:
- Created template-utils.lisp with centralized rendering
- Template caching for performance
- render-template-with-plist for consistent API
- Proper CLIP attribute processors (data-text)
- Documentation in docs/CLIP-REFACTORING.org

 Admin Dashboard Complete:
- System Status: All 4 indicators working (Server, DB, Liquidsoap, Icecast)
- Music Library: Scan, upload, duplicate detection working
- Track Management: Pagination (20/page, configurable 10/20/50/100)
- Player Control: HTML5 audio player with play/pause/stop
- User Management: Moved to separate /admin/users page

 User Management:
- New /admin/users route with dedicated page
- Inline user creation form
- User stats dashboard
- Role management (listener/DJ/admin)
- Activate/deactivate users
- API endpoint /api/users/create
- Tested with curl - all working

 Live Stream & Now Playing:
- Fixed: Green 🟢 LIVE STREAM indicator (was red)
- Fixed: Stream quality display matches selected stream (AAC/MP3)
- Now Playing updates every 10s from Icecast
- No HTML rendering bugs - working correctly

 Track Library:
- Fixed recursive directory scanning bug
- 64 tracks scanned and in database
- Pagination working perfectly

 Front Page & Web Player:
- Station Status shows correct stream quality
- Quality selector updates all displays
- Live stream indicators green
- Now Playing working on all pages

All Templates section items complete [4/4] 
2025-10-04 09:54:04 -04:00
Glenn Thompson b39b54adcb feat: Add live Icecast/Liquidsoap status checks to admin dashboard
- Implement check-icecast-status() to query Icecast API
- Implement check-liquidsoap-status() to check Docker container status
- Update admin page to show real-time streaming infrastructure status
- Note: Auto-scan on startup deferred due to database timing issues
2025-10-04 09:54:04 -04:00
Glenn Thompson 24feeddfa8 feat: Add auto-scan on startup and live Icecast/Liquidsoap status checks
- Auto-scan music library on startup to load existing tracks
- Add check-icecast-status() function to query Icecast API
- Add check-liquidsoap-status() function to check Docker container
- Update admin dashboard to show real-time streaming status
- Eliminates need to manually copy files from incoming on every restart
2025-10-04 09:54:04 -04:00
Brian O'Reilly ce39a0ca1a nullify this duplicate code prior to deletion. 2025-10-03 13:14:04 -04:00
Brian O'Reilly dee883e76e an incomplete todo list of things to fix for launch. 2025-10-03 13:13:37 -04:00
Brian O'Reilly 0fef44225f we get objects and not arrays, return them appropriately. 2025-10-03 10:19:19 -04:00
Brian O'Reilly 3393d2015f javascript _and_ html in one day? Fade's a real programmer now! 2025-10-03 09:54:51 -04:00
Glenn Thompson 62a1a94daa feat: Update color scheme from green to blue theme
- Change color palette: black→grey→green→red to black→bluegrey→cyan→blue
- Primary text: #00ff00 → #00ffff (green to cyan)
- Headers/accents: #ff6600 → #4488ff (orange to blue)
- Panels/borders: #1a1a1a/#333 → #1a2332/#2a3441 (grey to blue-grey)
- Buttons: #333/#555 → #2a3441/#3a4551 (grey to blue-grey)
- Maintains terminal/hacker aesthetic with cooler color palette
- Requested by Fade for improved visual appeal
2025-10-02 23:24:53 -04:00