A cross-platform desktop application for generating custom QR codes from text or URLs. Built with Electron (Chromium + Node.js), this app provides a simple GUI to create and save QR codes on Windows, macOS, and Linux. It also includes a command-line interface for batch generation.
- Real-time Generation: Enter text or a URL and instantly see the QR code preview.
- Customizable Output: Adjust the QR code size and error-correction level (L, M, Q, H).
- Export as Image: Save the generated QR code as a PNG (or other supported formats).
- Offline Usage: Works entirely on your machine without an internet connection but not generate QR Codes.
- CLI Support: Includes a command-line script (
convert.js) for batch QR code generation.
- Electron & Node.js: Build a native desktop app using web technologies. Electron embeds Chromium and Node.js, enabling HTML/CSS/JS to run as a desktop application.
- Frontend: Standard HTML5, CSS3, and JavaScript for the user interface.
- QR Code Library: Utilizes a Node.js library (e.g.,
qrcodeorqr-image) to encode input data into QR code images. - Build Tools: Uses electron-builder for packaging and distribution, creating native installers for Windows, macOS, and Linux.
# Clone the repository
git clone https://github.com/DahamSathmina/qr-code-generator.git
cd qr-code-generator
# Install dependencies
npm install # or yarn install
# Run the application
npm start # or yarn startThis will launch the Electron app. The main window will appear with an input field and a live-updating QR code preview.
- Launch the app.
- Type or paste text/URL into the input field.
- The QR code is generated automatically.
- Click Save to export the QR code as an image file.
Use the included convert.js script for terminal-based QR code generation:
node convert.js "Hello, world!" hello.pngThis generates hello.png containing the QR code for "Hello, world!". Use --help to see all options.
To create distributable installers:
-
Install electron-builder:
npm install --save-dev electron-builder
-
Add the following to your
package.json:"scripts": { "dist": "electron-builder" }, "build": { "appId": "com.dahamsathmina.qrcodegenerator", "productName": "QR Code Generator", "files": ["**/*"], "mac": { "target": "dmg" }, "win": { "target": "nsis" }, "linux": { "target": ["AppImage", "deb"] } }
-
Run the packaging script:
npm run dist # or yarn dist
Installers will be generated in the dist/ folder.
Contributions are welcome! To contribute:
- Fork the repository.
- Create a branch:
git checkout -b feature/YourFeature. - Make your changes and commit:
git commit -m "Add YourFeature". - Push:
git push origin feature/YourFeature. - Open a Pull Request to merge into
main.
Please follow the existing code style and include tests or screenshots for UI changes.
This project is licensed under the GNU General Public License v3.0 (GPLv3). See the LICENSE file for details. Learn more about GPLv3: https://www.gnu.org/licenses/gpl-3.0.en.html