A comprehensive Flask web application and CLI toolkit providing QR code generation and Confluence URL shortening services.
- Generate QR codes for any text or URL
- Multiple export formats (PNG, SVG)
- Customizable styling options:
- Module shapes: Square, Rounded, Circle
- Color masks: Solid, Radial Gradient, Square Gradient
- Logo embedding support
- Web interface and CLI access
- Convert long Confluence URLs to short links
- Automatic base URL detection
- Custom base URL support
- Web interface and CLI access
-
Clone the repository
git clone <repository-url> cd utildocker
-
Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
Start the Flask development server:
python app.pyThe application will be available at http://localhost:8888
- QR Code Generator: Enter text/URL, customize styling, optionally add a logo
- URL Shortener: Enter Confluence URL, get shortened version
- Responsive Design: Works on desktop and mobile devices
The CLI provides command-line access to all features:
# Basic QR code
python cli.py qr --data "Hello World" --output qr.png
# QR code with logo and custom styling
python cli.py qr --data "https://example.com" --logo logo.png --output qr.png --style rounded --color radial
# SVG output
python cli.py qr --data "https://example.com" --output qr.svg --format svg# Basic URL shortening
python cli.py shorten --url "https://confluence.example.com/pages/123456"
# With custom base URL
python cli.py shorten --url "https://conf.example.com/pages/123" --base "https://short.example.com"The original URL shortener CLI is still available:
python tiny_url_wm.py --full-url "https://confluence.example.com/pages/123456"utildocker/
├── app.py # Main Flask application
├── cli.py # Command-line interface
├── tiny_url_wm.py # Legacy URL shortener CLI
├── requirements.txt # Python dependencies
├── README.md # This file
├── CLAUDE.md # Claude Code guidance
├── src/
│ ├── utils/
│ │ ├── __init__.py
│ │ ├── qr_generator.py # QR code generation logic
│ │ └── url_shortener.py # URL shortening logic
│ ├── templates/
│ │ └── index.html # Main web interface
│ └── static/
│ ├── css/
│ │ └── style.css # Styling
│ ├── js/
│ │ └── script.js # JavaScript functionality
│ └── images/ # Example images
├── tests/ # Test files (future)
├── docs/ # Documentation (future)
└── venv/ # Virtual environment
The application supports these environment variables:
SECRET_KEY: Flask secret key (default: dev key)PORT: Port number (default: 8888)DEBUG: Debug mode (default: True)
For production deployment:
-
Set environment variables:
export SECRET_KEY="your-secure-secret-key" export DEBUG="False" export PORT="80"
-
Use a production WSGI server:
pip install gunicorn gunicorn app:app
GET /- Main page with both toolsPOST /generate-qr- Generate QR codePOST /shorten-url- Shorten URL
- Flask 3.1.1 - Web framework
- Pillow 11.3.0 - Image processing
- qrcode 8.2 - QR code generation
# Tests will be added in future versions
python -m pytest tests/src/utils/qr_generator.py- QR code generation logicsrc/utils/url_shortener.py- URL shortening logicsrc/templates/index.html- Web interface templatesrc/static/- CSS, JavaScript, and images
This project is provided as-is for utility purposes.
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
- Integrated QR code generator and URL shortener into single Flask app
- Added modern web interface with responsive design
- Created modular code structure
- Added CLI interface for both tools
- Improved error handling and user feedback