A comprehensive Frappe app for generating short URLs and QR codes with advanced webform integration and dynamic field mapping.
- URL Shortening: Convert long URLs into short, shareable links
- QR Code Generation: Create styled QR codes with custom logos and designs
- Webform Integration: Dynamic field mapping from Frappe webforms
- Offline Support: Generate QR codes without internet connectivity
- Frappe Framework (v14+)
- Python 3.8+
- PIL/Pillow for image processing
- qrcode library for QR generation
# Navigate to your bench directory
cd $PATH_TO_YOUR_BENCH
# Get the app from repository
bench get-app https://github.com/dhwani-ris/frappe_shortnr.git --branch develop
# Install the app
bench install-app shortnr
# Migrate database
bench migrate# Clone the repository
git clone https://github.com/dhwani-ris/frappe_shortnr.git apps/shortnr
# Install dependencies
cd apps/shortnr
pip install -r requirements.txt
# Install the app
bench install-app shortnr- Navigate to QR Code Generator doctype
- Select Type as "URL Shortener"
- Enter your Long URL
- Click Save to generate short URL
- Copy the generated Short URL
- Select Type as "QR Code"
- Enter the data to encode
- Click Save to generate QR code
- View the QR Preview
- Upload a Logo image
- The QR code will automatically include your logo
- Custom styling includes:
- Radial gradient color masks
- Gapped square module drawers
- Square eye drawers
- Select Type as "Webform"
- Choose your Webform from the dropdown
- The app automatically fetches webform fields
- Fields are organized into:
- Complex Fields: Text areas, tables, file uploads (2-column layout)
- Simple Fields: Input fields, selects, dates (4-column layout)
- Fields are automatically categorized by type
- Complex fields get more space in 2-column layout
- Simple fields are efficiently arranged in 4-column layout
- Fixed-width columns with justified alignment
- Responsive design for mobile devices
The app uses the following default QR code settings:
- Version: 7 (supports up to 1,816 characters)
- Box Size: 6 pixels
- Border: 3 modules
- Error Correction: High (30% error recovery)
Generates a styled QR code with optional logo embedding.
Parameters:
input_data(str): Data to encode in QR codelogo(str, optional): Path to logo image
Returns:
- Base64 encoded PNG image data URL
Fetches webform fields for dynamic rendering.
Parameters:
webform(str): Webform name
Returns:
- List of field dictionaries with fieldname, label, fieldtype, options
- Check if PIL/Pillow is installed:
pip install Pillow - Verify qrcode library:
pip install qrcode[pil] - Check file permissions for logo uploads
- Ensure webform exists and is published
- Check field permissions in webform
- Verify webform field types are supported
- Clear browser cache
- Check for JavaScript console errors
- Verify CSS classes are not conflicting
This project is licensed under the MIT License - see the LICENSE file for details.
Made with β€οΈ by the Dhwani RIS team