Skip to content

lafaCodes/Qre8

Repository files navigation

QRe8 - QR Code Generator

A beautiful, fast, and privacy-first QR code generator PWA built with Next.js and shadcn/ui.

QRe8 = QR + Cr8 (Create) β€” say it out loud! 🎀

Deploy to Cloudflare Pages License: MIT

✨ Features

  • ⚑ Instant Generation - Real-time QR code preview
  • 🎨 Customizable - Colors, size & error correction
  • πŸ“± PWA Ready - Install on any device, works offline
  • πŸ”’ Privacy First - All QR generation happens locally
  • πŸ›‘οΈ Bot Protection - Cloudflare Turnstile integration
  • πŸŒ™ Dark Mode - System theme detection + manual toggle
  • πŸ“₯ Download - Export as PNG with custom size

πŸ“Š QR Code Types

Type Description
URL/Text Any URL or plain text
WiFi Auto-connect network credentials
vCard Contact cards with name, phone, email
Email Pre-filled email compose
SMS Pre-filled text message
Phone Click-to-call phone number
Geo GPS coordinates / location
Event Calendar event (iCal format)

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        QRe8 System                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚   Frontend PWA  β”‚ HTTPS   β”‚   Backend API           β”‚   β”‚
β”‚  β”‚   (This Repo)   │◄───────►│   (Private Repo)        β”‚   β”‚
β”‚  β”‚                 β”‚         β”‚                         β”‚   β”‚
β”‚  β”‚  β€’ Next.js 16   β”‚         β”‚  β€’ Hono.js              β”‚   β”‚
β”‚  β”‚  β€’ shadcn/ui    β”‚         β”‚  β€’ PostgreSQL           β”‚   β”‚
β”‚  β”‚  β€’ Tailwind CSS β”‚         β”‚  β€’ SMTP2GO              β”‚   β”‚
β”‚  β”‚  β€’ Static PWA   β”‚         β”‚  β€’ OTP Auth             β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚           β”‚                                                 β”‚
β”‚           β–Ό                                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                       β”‚
β”‚  β”‚ Cloudflare      β”‚                                       β”‚
β”‚  β”‚ β€’ Pages         β”‚                                       β”‚
β”‚  β”‚ β€’ Turnstile     β”‚                                       β”‚
β”‚  β”‚ β€’ WAF           β”‚                                       β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                       β”‚
β”‚                                                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Frontend (This Repository)

  • Framework: Next.js 16 (App Router, Static Export)
  • UI: shadcn/ui + Tailwind CSS
  • Hosting: Cloudflare Pages
  • Features: PWA, offline support, theme switching

Backend (Private Repository)

  • Framework: Hono.js (TypeScript)
  • Database: PostgreSQL
  • Email: SMTP2GO (OTP verification)
  • Auth: OTP-based, JWT tokens
  • Hosting: Cloudflare Workers / Tunnel

πŸ› οΈ Tech Stack

Layer Technology
Framework Next.js 16
UI Components shadcn/ui
Styling Tailwind CSS
QR Generation qrcode
Bot Protection Cloudflare Turnstile
Validation Zod
Theming next-themes

πŸš€ Getting Started

Prerequisites

  • Node.js 20+
  • npm or yarn

Installation

# Clone the repository
git clone https://github.com/lafaCodes/Qre8.git
cd Qre8

# Install dependencies
npm install

# Run development server
npm run dev

Open http://localhost:3000

Environment Variables

Create a .env.local file:

# Cloudflare Turnstile (use test key for local dev)
NEXT_PUBLIC_TURNSTILE_SITE_KEY=1x00000000000000000000AA

# Backend API URL (when backend is ready)
# NEXT_PUBLIC_API_URL=https://api.qre8.changa.tech

πŸ“¦ Deployment

Branch Strategy

Branch Environment URL
dev Staging qre8-dev.pages.dev
main Production qre8.changa.tech

Cloudflare Pages

This project uses static export for Cloudflare Pages.

Required GitHub Secrets:

Secret Description
CLOUDFLARE_API_TOKEN API token with Pages permissions
CLOUDFLARE_ACCOUNT_ID Your Cloudflare account ID
NEXT_PUBLIC_TURNSTILE_SITE_KEY Turnstile site key

CI/CD Pipeline

  1. Push to dev β†’ Auto-deploys to staging
  2. Push to main β†’ Auto-deploys to production
  3. PRs run build check only (no deployment)

πŸ” Security

  • All QR generation is client-side (no data sent to server)
  • Cloudflare Turnstile prevents bot abuse
  • Content Security Policy headers configured
  • Rate limiting on API endpoints (when backend enabled)
  • See SECURITY.md for Cloudflare WAF setup

πŸ“– Development

Project Structure

qr-code-generator/
β”œβ”€β”€ app/                  # Next.js App Router
β”‚   β”œβ”€β”€ globals.css       # Global styles + splash screen
β”‚   β”œβ”€β”€ layout.tsx        # Root layout + providers
β”‚   └── page.tsx          # Main QR generator page
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/       # React components
β”‚   β”‚   β”œβ”€β”€ forms/        # QR type input forms
β”‚   β”‚   └── ui/           # shadcn/ui components
β”‚   └── lib/              # Utilities & QR logic
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ _headers          # Cloudflare security headers
β”‚   β”œβ”€β”€ manifest.json     # PWA manifest
β”‚   └── sw.js             # Service worker
└── .github/
    β”œβ”€β”€ workflows/        # CI/CD pipelines
    └── copilot-instructions.md  # AI assistant guidelines

Version Tracking

  • Version info logged to console on page load
  • Press Cmd+Shift+V (Mac) / Ctrl+Shift+V (Win) to view version
  • Inspect #app-version element in DevTools

🀝 Contributing

  1. Fork the repository
  2. Create feature branch from dev: git checkout -b features/my-feature
  3. Commit changes: git commit -m "feat: add my feature"
  4. Push and create PR to dev

See .github/copilot-instructions.md for coding guidelines.


πŸ“„ License

MIT Β© CHANGA.tech


πŸ”— Links

About

QRe8 = QR + Cr8 (Create) β€” say it out loud! 🎀

Resources

Security policy

Stars

Watchers

Forks

Contributors