- Removed all unused/deprecated deployment scripts
- Created single unified deploy.sh script
- Added comprehensive DEPLOYMENT.md guide
- Updated README.md for Supabase migration
- Script prompts for project directory or uses current
- Auto-detects web server (Nginx/Apache/CloudSticks)
- Fully automated deployment process
- Creates separate config file in /etc/nginx-cs/conf.d/
- Avoids modifying main nginx.conf
- Simpler and safer approach
- Complete server block with SSL and proxy rules
- Hardcoded /etc/nginx-cs/ path for CloudSticks
- No user input required
- Auto-detects SSL server block
- Backs up config before changes
- Tests and reloads Nginx
- Starts Node.js if needed
- Tests both local and production endpoints
- Created setup-nginx.sh automated setup script
- Added NGINX_SETUP.md with manual instructions
- Replaces Apache config (CloudSticks uses Nginx)
- Configures proxy for /api and /socket.io
- Includes WebSocket support for multiplayer
- Created setup-apache.sh for one-command configuration
- Auto-detects Apache config file
- Enables required modules
- Adds proxy rules
- Backs up original config
- Tests and restarts Apache
- Verifies Node.js server is running
- Tests API endpoint
- Created apache-config.conf with proxy rules
- Added APACHE_FIX.md with step-by-step instructions
- Fixes 404 errors on /api and /socket.io endpoints
- Enables WebSocket support for multiplayer
- Created deploy-cloudsticks.sh for CloudSticks environment
- Works with systemd, PM2, or direct node execution
- Added CLOUDSTICKS_DEPLOY.md with specific instructions
- Handles case where PM2 is not installed
- Created automated deploy-production.sh script
- Added comprehensive PRODUCTION_DEPLOY.md guide
- Includes troubleshooting and Apache configuration
- Ready for production deployment
- Created storage.js wrapper with IndexedDB support
- Automatic fallback to localStorage if IndexedDB unavailable
- Updated all username storage calls to use async API
- Better performance and more storage capacity
- Improved PWA compatibility
Benefits:
- 50MB+ storage vs 5-10MB localStorage
- Async API doesn't block main thread
- Better for future features (game history, stats, etc.)
- Add polling mechanism to wait for window.game initialization
- Disable multiplayer button until game is fully initialized
- Enable button in DOMContentLoaded after game creation
- Prevents 'Game instance not found' error on production
This fixes the critical issue where clicking Multiplayer too quickly
would fail because window.game wasn't ready yet.
- Set up all socket listeners BEFORE connection completes
- Remove nested 'connect' listener that caused race condition
- Add comprehensive logging for registration flow
- Update all listeners to use socket parameter
- Fix window.multiplayerClient reference in retry link
This fixes the 'Registering...' stuck state issue.