Prerequisites
Before starting, ensure you have the following installed:- Node.js (v14 or higher)
- npm (Node Package Manager)
- A modern web browser (Chrome, Firefox, or Safari)
- A code editor (VS Code recommended)
Understanding CORS in Development
When developing locally (e.g.,http://localhost:5500), browsers block requests to the audio stream due to CORS policy:
This issue only occurs in development. In production (https://laurban.cl), CORS works correctly because:
- The domain matches the CORS headers configured on the server
- HTTPS to HTTPS has no mixed content issues
- The server already has
Access-Control-Allow-Origin: *configured
Setup Methods
Option 1: Local Proxy Server (Recommended)
This is the most reliable method for local development. It creates a proxy that handles CORS issues transparently.Option 2: Browser Extension (Quick but Less Secure)
Install a CORS extension in your browser:- CORS Unblock for Chrome
- Allow CORS for Chrome
Option 3: Chrome with CORS Disabled
Run Chrome with a temporary profile without CORS restrictions:- Windows
- macOS
- Linux
Option 4: Firefox with Relaxed CORS
- Open Firefox and navigate to
about:config - Search for
security.fileuri.strict_origin_policy - Set it to
false
Development Workflow
File Structure
Testing Without Audio
If you need to test UI components (like the volume popup) without audio playback:Enable mobile emulation
Click the device toolbar icon or press
Ctrl+Shift+M (Windows/Linux) or Cmd+Shift+M (Mac)Testing Checklist
Before committing changes, verify:- Volume popup appears on screens β€400px width
- Horizontal volume slider is hidden on mobile devices
- Player width is responsive (90vw on mobile)
- Buttons stack vertically on mobile
- Carousel/marquee displays without cuts
- Audio plays correctly (with proxy or in production)
- Lyrics synchronize properly
- Theme changes (day/night) work correctly
- No console errors appear
Environment Detection
The application automatically detects the environment:- Development mode: All console logs are visible
- Production mode: Only warnings and errors are shown
Hot Reload Setup
For a better development experience, you can use a live server:Using VS Code Live Server
- Install the βLive Serverβ extension in VS Code
- Right-click on
index.html - Select βOpen with Live Serverβ
- The page will auto-reload on file changes
Using Python
http://localhost:8000
Troubleshooting
Audio Not Playing
- Check browser console for CORS errors
- Verify proxy server is running (if using Option 1)
- Ensure stream URL is correct in
CONFIGobject - Check network tab to see if requests are being made
Styles Not Loading
- Clear browser cache
- Check file paths in
index.html - Verify CSS files exist in the correct location
JavaScript Errors
- Check console for error messages
- Ensure all script files load in correct order:
logger.js(first)cache-manager.jslyrics.jsindex.js(last)
Next Steps
Once your development environment is set up:- Read the Architecture guide to understand the codebase structure
- Learn about Mobile Optimization for mobile-specific features
- Review the CORS Setup and Streaming Configuration guides
