Digital Broadcasting Display is a comprehensive Flask-based digital signage system designed for managing and displaying multimedia content on digital displays. It features advanced capabilities including live video streaming, token counter systems, remote device management, and real-time content control.
- Repo: https://github.com/MS-Jahan/Digital-Broadcasting-Display
- Live demo: self-hosted only β after Docker start, open http://localhost:8082
Backend: Python 3.11+, Flask, Flask-SocketIO, Flask-Login, Pony ORM Β· Infra: Docker, Docker Compose Β· Realtime: Socket.IO / Eventlet
Primary Python packages (see backend/requirements.txt for pinned versions):
- Flask, Flask-Cors, Flask-Login, Flask-Session, Flask-SocketIO
- Pony ORM, Eventlet, python-socketio / python-engineio
Install locally with:
pip install -r backend/requirements.txt- Docker (20.10+)
- Docker Compose (2.0+)
# Clone the repository
git clone https://github.com/MS-Jahan/Digital-Broadcasting-Display.git
cd Digital-Broadcasting-Display
# Set up and start the application
./scripts/docker-manage.sh setup
./scripts/docker-manage.sh startπ That's it! Access your application at http://localhost:8082
Default credentials: Username: admin, Password: admin (
- Multi-format video support: MP4, AVI, MOV
- Dynamic playlist management with drag-and-drop reordering
- Image notices with customizable duration
- Text notices with full RGBA color and positioning control
- Auto-detection of new videos in the media directory
- Mobile camera streaming (front/back camera switching)
- Screen sharing from mobile devices
- Real-time WebSocket communication
- 10 FPS streaming optimized for reasonable bandwidth
- Configurable positioning and sizing on display
- Bank-style digital counter with large number display
- Increment/Decrement/Reset controls
- Real-time updates via Socket.IO
- Custom backgrounds and animations
- Positioning and styling customization
- Logo management with upload and positioning
- Notice positioning (top, center, bottom)
- RGBA color support for text and backgrounds
- Animation effects for logos and counters
- Responsive design for both admin and viewer interfaces
- System shutdown/restart with safety delays
- Real-time subtitle updates with marquee scrolling
- Cross-origin resource sharing (CORS) enabled
- Session management with 4-year lifetime
- Multi-user admin support (2-3 concurrent users)
- Flask-Login authentication system
- Rate limiting on login and API endpoints
- Secure file uploads with validation
- Non-root container execution
- Security headers via Nginx proxy
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Admin Panel β β Viewer Display β β Mobile Streamer β
β (Material UI) β β (Full-screen) β β (Camera/Screen) β
βββββββββββ¬ββββββββ βββββββββββ¬ββββββββ βββββββββββ¬ββββββββ
β β β
ββββββββββββββββββββββββΌβββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββ
β Flask Backend β
β βββββββββββββββββββββββββββββββ β
β β Socket.IO Hub β β
β β (/video, /admin, /stream) β β
β βββββββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββ β
β β SQLite Database β β
β β (Playlists, Settings, β β
β β Tokens, Streams) β β
β βββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββ
β File Storage β
β Videos | Images | Logos β
β Uploads | Backgrounds β
βββββββββββββββββββββββββββββββ
# 1. Set up environment
./scripts/docker-manage.sh setup
# 2. Edit configuration
vim .env # Update SECRET_KEY, admin credentials, etc.
# 3. Deploy with production services
docker-compose --profile production up -d
# 4. Enable automatic updates (optional)
docker-compose --profile auto-update up -d| Service | Description | Profile |
|---|---|---|
| app | Main Flask application | default |
| db_backup | Automated database backups | default |
| nginx | Reverse proxy with SSL support | production |
| watchtower | Automatic container updates | auto-update |
# Application lifecycle
./scripts/docker-manage.sh start # Start services
./scripts/docker-manage.sh stop # Stop services
./scripts/docker-manage.sh restart # Restart services
./scripts/docker-manage.sh status # Show status
# Maintenance
./scripts/docker-manage.sh logs # View logs
./scripts/docker-manage.sh logs -f # Follow logs
./scripts/docker-manage.sh shell # Open container shell
./scripts/docker-manage.sh backup # Manual backup
./scripts/docker-manage.sh update # Update and restart
./scripts/docker-manage.sh clean # Clean Docker resources
# Development
./scripts/docker-manage.sh build # Build custom image
./scripts/docker-manage.sh reset # β οΈ Reset everything# Clone repository
git clone https://github.com/MS-Jahan/Digital-Broadcasting-Display.git
cd Digital-Broadcasting-Display/backend
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Create videos directory
mkdir -p videos
# Run application
python main.py# Build and run in development mode
docker-compose -f docker-compose.yml up --build
# With file watching (requires volume mounts)
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up- Start the application and ensure it's accessible on your network
- On your mobile device, navigate to
http://YOUR_SERVER_IP:8082/mobile - Log in with admin credentials
- Choose streaming type:
- πΉ Camera: Stream from front/back camera
- π₯οΈ Screen Share: Share your mobile screen
- Configure position via admin panel settings
- Front/back camera switching
- Mirror toggle for selfie mode
- Connection status indicators
- Optimized for mobile browsers
- Automatic reconnection
| Variable | Default | Description |
|---|---|---|
FLASK_ENV |
production |
Flask environment mode |
SECRET_KEY |
secret! |
Flask secret key ( |
ADMIN_USERNAME |
admin |
Default admin username |
ADMIN_PASSWORD |
admin |
Default admin password |
HOST_PORT |
8082 |
External port mapping |
DATABASE_PATH |
/app/data/database.sqlite |
Database file location |
BACKUP_INTERVAL |
86400 |
Backup interval (seconds) |
BACKUP_RETENTION |
7 |
Days to keep backups |
| Volume | Purpose | Persistent |
|---|---|---|
dbd_app_data |
Database and application data | β Yes |
dbd_videos |
Video files | β Yes |
dbd_uploads |
Uploaded images | β Yes |
dbd_logos |
Custom logos | β Yes |
dbd_token_backgrounds |
Token counter backgrounds | β Yes |
dbd_logs |
Application logs | β Yes |
dbd_backups |
Database backups | β Yes |
POST /login- User loginGET /logout- User logout
GET /api/playlist_items- List all itemsGET /api/playlist_item/swap?one=X&another=Y- Reorder itemsPOST /api/playlist_item/upload_video- Upload videoPOST /api/playlist_item/add_notice- Add text noticePOST /api/playlist_item/add_image_notice- Add image notice
GET/POST /api/stream/settings- Stream configurationPOST /api/stream/start- Start streamingPOST /api/stream/stop- Stop streaming
GET/POST /api/token/counter- Counter settingsPOST /api/token/increment- Increment counterPOST /api/token/decrement- Decrement counterPOST /api/token/reset- Reset counter
POST /api/system/shutdown- Remote shutdown (β οΈ Dangerous)POST /api/system/restart- Remote restart (β οΈ Dangerous)POST /api/system/cancel_shutdown- Cancel pending shutdown
POST /api/logo/upload- Upload logoGET/POST /api/logo/settings- Logo configuration
# Check application health
curl -f http://localhost:8082/login
# Check container health
docker ps --filter name=dbd-app --format "table {{.Names}}\t{{.Status}}"
# View detailed container info
docker inspect dbd-app# View all logs
./scripts/docker-manage.sh logs
# Follow specific service
docker-compose logs -f app
# Check log file size
du -h /var/lib/docker/volumes/dbd_logs/_data/# Manual backup
./scripts/docker-manage.sh backup
# List available backups
docker exec dbd-backup ls -la /backups/
# Restore from backup (replace TIMESTAMP)
docker exec -it dbd-app cp /backups/database_backup_TIMESTAMP.sqlite.gz /app/data/
gunzip /app/data/database_backup_TIMESTAMP.sqlite.gz
mv /app/data/database_backup_TIMESTAMP.sqlite /app/data/database.sqlite- Change default admin credentials
- Set secure SECRET_KEY (32+ random characters)
- Enable HTTPS with SSL certificates
- Configure firewall rules
- Regular security updates
- Monitor access logs
- Backup encryption for sensitive data
The included Nginx configuration automatically adds:
X-Frame-Options: DENYX-Content-Type-Options: nosniffX-XSS-Protection: 1; mode=blockReferrer-Policy: no-referrer-when-downgrade
- Corporate lobbies and waiting areas
- Retail stores and restaurants
- Educational institutions
- Healthcare facilities
- Event streaming from mobile devices
- Security monitoring displays
- Conference room presentations
- Remote content management
- Bank token systems
- Hospital queue displays
- Service center management
- Appointment scheduling displays
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open Pull Request
# Clone your fork
git clone https://github.com/YOUR_USERNAME/Digital-Broadcasting-Display.git
# Set up development environment
./scripts/docker-manage.sh setup
# Start in development mode
FLASK_ENV=development ./scripts/docker-manage.sh startPort already in use
# Check what's using the port
sudo netstat -tulpn | grep :8082
# Kill the process or change HOST_PORT in .envPermission denied on uploads
# Fix volume permissions
docker exec -it dbd-app chown -R appuser:appuser /app/videos /app/uploadsDatabase corruption
# Restore from backup
./scripts/docker-manage.sh backup # Create current backup first
# Then restore from previous backup as shown aboveMobile streaming not working
- Ensure both devices are on the same network
- Check firewall settings
- Try using IP address instead of localhost
- Verify camera/microphone permissions in browser
This project is currently under custom licensing terms. Please contact the author before using any of this code in your public or private projects.
- MS-Jahan - Initial work and main development - @MS-Jahan
- Flask and Flask-SocketIO communities
- Docker and containerization ecosystem
- Material Design UI components
- WebRTC and streaming technologies
β Star this repository if you find it useful!
π Issues and suggestions are welcome! Please check the issues page.
