1.9 KiB
1.9 KiB
K-QR - Rust QR Code Generator
A lightweight, high-performance QR code generator built with Rust, Axum, Maud, and HTMX.
Features
- Blazing Fast: Built with Rust for maximum performance.
- Embedded UI: The web interface is completely embedded in the binary.
- Interactive: Uses HTMX for seamless, single-page-like experience without complex JS frameworks.
- Configurable: Easily customize host, port, and default styles via environment variables.
Tech Stack
- Backend: Rust / Axum
- Templating: Maud (Type-safe HTML)
- Frontend Interactivity: HTMX
- QR Generation:
qrcodecrate
Configuration
The application can be configured using environment variables:
| Variable | Description | Default |
|---|---|---|
SERVER_HOST |
Network interface to bind to | 0.0.0.0 |
SERVER_PORT |
Port to listen on | 3000 |
QR_DEFAULT_COLOR |
Default color for generated QR codes (HEX) | #000000 |
RUST_LOG |
Logging level (debug, info, warn, error) |
qr_generator=debug |
Getting Started
Prerequisites
Local Development
-
Clone the repository:
git clone <repository-url> cd qr-generator -
Run the backend:
cd backend cargo run -
Open your browser at
http://localhost:3000.
Docker Deployment
Use Docker Compose to spin up the application:
docker-compose up --build -d
Or pull the pre-built image:
docker run -d -p 3000:3000 --name k-qr registry.gabrielkaszewski.dev/k-qr:latest
API Usage
You can also generate QR codes directly via the API:
GET /api/qr?data=https://github.com
Parameters:
data(required): The URL or text to encode in the QR code.
License
This project is licensed under the MIT License - see the LICENSE file for details.