Skip to content

Code-X-SL/Qr-Code-Studio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

QR Code Generator | Kawdhitha Nirmal

QR Code Generator

Advanced QR Code Generator with Custom Logos, Shapes, and Styles

Live Demo API Documentation Features Installation


Overview

QR Code Generator is a modern, feature-rich web application built with Next.js that allows you to create customized QR codes with advanced styling options, custom logos, and multiple error correction levels. Perfect for marketing campaigns, product packaging, and digital content sharing.

Built by: Kawdhitha Nirmal | CodeXDeveloper


Features

Core Features

  • ✨ Real-time QR Code Generation - Instant preview as you customize
  • 🎨 Custom Styling - Choose from multiple dot shapes and corner styles
  • πŸ–ΌοΈ Logo Support - Add custom logos to the center of QR codes
  • 🎯 Error Correction Levels - Easy, Medium, and Hard (default: Easy)
  • πŸ“± Responsive Design - Works seamlessly on desktop and mobile
  • 🌐 Glassmorphism UI - Modern, elegant interface with liquid glass effects

QR Customization

  • Dot Shapes: Square, Circle, Rounded, Diamond
  • Corner Styles: Square, Rounded, Circle
  • Color Control: Custom QR code and background colors
  • Size Options: Adjustable QR code dimensions
  • Logo Sizing: Control logo proportion in QR code

API Features

  • πŸš€ RESTful API - Generate QR codes programmatically
  • πŸ“Š Multiple Formats - Support for URLs, emails, phone numbers, WiFi
  • πŸ”— Shareable Links - Generate and share QR code configurations
  • πŸ“₯ Logo Upload - Add logos via URL parameter
  • πŸ’Ύ Direct Image Output - Returns PNG images directly

Usage

Web Interface

  1. Enter Content: Type or paste your URL, email, phone number, or text
  2. Customize: Select dot shapes, corner styles, colors, and error level
  3. Add Logo (Optional): Upload a logo to display in the center
  4. Generate: Click "Generate QR Code"
  5. Download: Save the QR code as PNG
  6. Share: Copy the shareable link to recreate the same QR code

API Usage

Basic QR Code Generation

Simple text QR code

curl "https://qr.kawwa.site/api/generate-qr?data=Hello%20World"

URL QR code

curl "https://qr.kawwa.site/api/generate-qr?data=https://example.com"

With Custom Logo

QR code with logo

curl "https://qr.kawwa.site/api/generate-qr?data=https://example.com&logo=https://example.com/logo.png"

With Error Correction Level

Easy error correction (default)

curl "https://qr.kawwa.site/api/generate-qr?data=text&errorLevel=easy"

Medium error correction

curl "https://qr.kawwa.site/api/generate-qr?data=text&errorLevel=medium"

Hard error correction

curl "https://qr.kawwa.site/api/generate-qr?data=text&errorLevel=hard"

With Dot and Corner Shapes

Custom shapes

curl "https://qr.kawwa.site/api/generate-qr?data=text&dotShape=circle&cornerShape=rounded"

Complete Example

curl "https://qr.kawwa.site/api/generate-qr?data=https://example.com&logo=https://example.com/logo.png&errorLevel=medium&dotShape=circle&cornerShape=rounded"

API Documentation

Endpoint

GET /api/generate-qr
POST /api/generate-qr

Query Parameters

Parameter Type Default Description
data string required Content to encode (URL, email, phone, text)
logo string optional URL to logo image to overlay on QR code
errorLevel string easy Error correction level: easy, medium, hard
dotShape string square QR dot shape: square, circle, rounded, diamond
cornerShape string square Corner marker shape: square, rounded, circle
size number 300 QR code size in pixels (100-1000)
margin number 10 Margin around QR code in pixels
darkColor string #000000 QR code color (hex format)
lightColor string #ffffff Background color (hex format)

Response

  • Content-Type: image/png
  • Body: PNG image of the generated QR code

Error Correction Levels

Level Recovery Use Case
Easy ~7% General use, clean environments
Medium ~15% Standard use, some potential damage
Hard ~30% Harsh environments, high durability needed

JavaScript Example

#javascript // Generate QR code

const qrUrl = 'https://qr.kawwa.site/api/generate-qr?data=https://example.com&errorLevel=medium';

// Display in image tag const img = document.createElement('img'); img.src = qrUrl; document.body.appendChild(img);

// Download QR code const link = document.createElement('a'); link.href = qrUrl; link.download = 'qrcode.png'; link.click(); ```

cURL Example

Generate and save QR code

curl "https://qr.kawwa.site/api/generate-qr?data=https://example.com" -o qrcode.png

With logo

curl "https://qr.kawwa.site/api/generate-qr?data=https://example.com&logo=https://example.com/logo.png" -o qrcode-with-logo.png

Python Example

python
import requests
from PIL import Image
from io import BytesIO

# Generate QR code
url = 'https://qr.kawwa.site/api/generate-qr'
params = {
    'data': 'https://example.com',
    'errorLevel': 'medium',
    'dotShape': 'circle'
}

response = requests.get(url, params=params)
img = Image.open(BytesIO(response.content))
img.save('qrcode.png')

Shareable Links

After generating a QR code, you can share the configuration using the shareable link format:

https://qr.kawwa.site?data=https://example.com&errorLevel=medium&dotShape=circle

This link will recreate the exact same QR code when opened in the application.


Technology Stack

  • Frontend: Next.js 15, React 19, TypeScript
  • Styling: Tailwind CSS v4, Glassmorphism effects
  • QR Generation: qrcode library
  • Image Processing: Sharp
  • UI Components: Radix UI, shadcn/ui
  • Deployment: Vercel

Project Structure

qr-code-generator/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   └── generate-qr/
β”‚   β”‚       └── route.ts          # QR generation API endpoint
β”‚   β”œβ”€β”€ docs/
β”‚   β”‚   └── page.tsx              # API documentation page
β”‚   β”œβ”€β”€ layout.tsx                # Root layout with meta tags
β”‚   β”œβ”€β”€ page.tsx                  # Home page
β”‚   └── globals.css               # Global styles
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ qr-generator.tsx          # Main QR generator component
β”‚   └── ui/                       # shadcn/ui components
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ favicon.ico               # Favicon
β”‚   └── qr-dot-shapes/            # QR dot shape examples
β”œβ”€β”€ lib/
β”‚   └── utils.ts                  # Utility functions
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── README.md

Features in Detail

QR Dot Shapes

Choose from 4 different dot shape styles:

  • Square: Classic QR code appearance
  • Circle: Modern, rounded dots
  • Rounded: Slightly rounded square dots
  • Diamond: Diamond-shaped dots for unique look

Corner Styles

Customize the position markers (corners) of your QR code:

  • Square: Traditional square corners
  • Rounded: Rounded square corners
  • Circle: Circular corner markers

Error Correction

QR codes can recover from damage:

  • Easy (7%): Suitable for clean, protected environments
  • Medium (15%): Standard choice for most applications
  • Hard (30%): For outdoor or high-wear environments

License

This project is open source and available under the MIT License.


Support

For support, questions, or feedback:


Author

Kawdhitha Nirmal | CodeXDeveloper

Website Email Telegram GitHub


QR Code Studio β€’ Build with ❀️ by Kawdhitha Nirmal
CodeX Developers CodeX Developers tg

About

⚑ Generate stylish QR codes in seconds! ✨ Built with Next.js, optimized for βš™οΈ speed, and perfect for your πŸš€ projects.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors