A live score overlay application with image management and real-time updates via WebSockets.
- Live score display with customizable parameters
- Image upload and management via Cloudinary
- Real-time updates using WebSockets
- Authentication system for management access
- Rate limiting and security features
- Helmet.js: Security headers for XSS, clickjacking protection
- CORS: Configurable cross-origin resource sharing
- Rate Limiting: Protection against abuse and DDoS
- Input Validation: Proper validation for all inputs
- Session Security: Secure session configuration
- Environment Variables: All sensitive data in environment variables
-
Install Dependencies
npm install
-
Environment Configuration
- Copy
.env.exampleto.env - Fill in your Cloudinary credentials
- Set a strong password and session secret
- Copy
-
Required Environment Variables
CLOUDINARY_CLOUD_NAME=your_cloud_name CLOUDINARY_API_KEY=your_api_key CLOUDINARY_API_SECRET=your_api_secret PASSWORD=your_secure_password SESSION_SECRET=your_very_secure_session_secret -
Start the Application
npm start
For development with auto-restart:
npm run dev
GET /- Display pageGET /params- Get current parametersGET /images- Get all imagesGET /health- Health checkPOST /authenticate- Login
GET /manage- Management pagePOST /upload- Upload imageDELETE /images/:public_id- Delete imagePOST /update-params- Update parametersPOST /logout- Logout
| Variable | Required | Default | Description |
|---|---|---|---|
CLOUDINARY_CLOUD_NAME |
Yes | - | Cloudinary cloud name |
CLOUDINARY_API_KEY |
Yes | - | Cloudinary API key |
CLOUDINARY_API_SECRET |
Yes | - | Cloudinary API secret |
PORT |
No | 3000 | Server port |
NODE_ENV |
No | development | Environment |
PASSWORD |
No | 1234 | Admin password |
SESSION_SECRET |
No | - | Session secret key |
DEFAULT_PID |
No | 1023506 | Default player ID |
DEFAULT_WNR |
No | 92204 | Default winner ID |
ALLOWED_ORIGINS |
No | - | CORS allowed origins |
- General requests: 100 per 15 minutes per IP
- Upload requests: 10 per 15 minutes per IP
- Maximum file size: 10MB
- Allowed types: Images only
- Storage: Cloudinary cloud storage
- Input Validation: All inputs are validated and sanitized
- Authentication: Session-based authentication for admin functions
- Rate Limiting: Prevents abuse and DDoS attacks
- CORS Protection: Configurable cross-origin policies
- Security Headers: Helmet.js for security headers
- Error Handling: Comprehensive error handling with proper status codes
refresh- Triggers clients to reload parameters and images
- Set
NODE_ENV=production - Use a strong
SESSION_SECRET - Configure HTTPS for secure cookies
- Set appropriate
ALLOWED_ORIGINSfor CORS - Consider using a reverse proxy (nginx)
- Monitor logs and set up proper logging
- Missing Environment Variables: Check that all required environment variables are set
- Cloudinary Issues: Verify your Cloudinary credentials
- Upload Failures: Check file size (max 10MB) and file type (images only)
- WebSocket Connection Issues: Ensure your reverse proxy supports WebSocket upgrades
The application logs important events including:
- Authentication attempts
- File uploads/deletions
- WebSocket connections
- Errors and exceptions