A dynamic QR code redirect system built with Next.js 14, optimized for Vercel deployment. Print QR codes once and update destinations anytime without reprinting.
- Permanent QR Codes: Each QR code points to
/tag/[id]
which redirects to configurable URLs - Easy Updates: Change redirect destinations by editing a simple JSON file
- QR Code Generator: Built-in route to generate QR codes in SVG or PNG format
- Admin Dashboard: View all redirects and generate QR codes from one interface
- Vercel Optimized: Serverless functions with appropriate timeouts and caching
-
Deploy to Vercel:
- Click "Deploy to Vercel" button or import this repository
- No environment variables needed
-
Configure Redirects: Edit
public/redirects.json
:{ "001": "https://mydomain.com/resources/chair001-v2.pdf", "002": "https://mydomain.com/resources/chair002-v1.pdf" }
-
Generate QR Codes:
- Visit the home page to see all redirects
- Click "Generate QR" to create a QR code for any tag
- Download as SVG (scalable) or PNG (high resolution)
/
- Admin dashboard showing all redirects/tag/[id]
- Redirect endpoint (what QR codes point to)/generate/[id]
- QR code generator interface/generate/[id]/download?format=png|svg
- Direct QR code download
- QR codes point to permanent URLs like
https://yourproject.vercel.app/tag/001
- When scanned, the
/tag/[id]
route looks up the destination inredirects.json
- Users are redirected (302) to the current destination
- Update
redirects.json
and redeploy to change destinations instantly
npm install
npm run dev
Visit http://localhost:3000
- Edit
redirects.json
to manage your QR code mappings - Modify the home page to match your brand
- Add authentication if needed for the admin interface
- Serverless functions with 10-second timeout
- JSON file cached with
stale-while-revalidate
- Lightweight QR generation using qrcode library