Editor QR tab now generates a styled, scannable QR with live preview and clean
PNG/SVG export (no frame or text — the owner lays it out).
- Restaurant.qrConfig JSON persists the styling (migration 0003)
- qr-code-styling (MIT) runs client-side in QrTab: preview + WYSIWYG PNG (2048px)
and vector SVG export, avoiding native canvas deps in the alpine image
- Controls: dots color/gradient, background (incl. transparent), corners color,
dot & corner shapes, optional center logo (uploaded via /upload, capped at 20%)
- Scannability: error correction forced to 'H' whenever there's a logo or color;
WCAG contrast check warns on low contrast; persistent 'verify before printing' notice
- Templates inherit the menu palette but every value is independently editable
- QR always targets {APP_BASE_URL}/{slug}
- PATCH /api/[slug]/qr saves config; GET stays as a config-aware server fallback
- i18n (es/en) for the qr namespace; glassmorphism, mobile-first
Verified: build passes; migration 0003 applies; PATCH persists qrConfig; GET
honors saved colors/ECC (png + colored svg); auth guard returns 401.
46 lines
1.1 KiB
JSON
46 lines
1.1 KiB
JSON
{
|
|
"name": "smartmenu-collina",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"scripts": {
|
|
"dev": "next dev",
|
|
"build": "prisma generate && next build",
|
|
"start": "next start",
|
|
"lint": "next lint",
|
|
"prisma:generate": "prisma generate",
|
|
"prisma:migrate": "prisma migrate dev",
|
|
"prisma:deploy": "prisma migrate deploy",
|
|
"db:seed": "tsx prisma/seed.ts"
|
|
},
|
|
"prisma": {
|
|
"seed": "tsx prisma/seed.ts"
|
|
},
|
|
"dependencies": {
|
|
"@anthropic-ai/sdk": "^0.65.0",
|
|
"@prisma/client": "^5.22.0",
|
|
"bcryptjs": "^2.4.3",
|
|
"clsx": "^2.1.1",
|
|
"jose": "^5.9.6",
|
|
"next": "14.2.21",
|
|
"next-intl": "^3.26.3",
|
|
"qr-code-styling": "^1.9.2",
|
|
"qrcode": "^1.5.4",
|
|
"react": "^18.3.1",
|
|
"react-dom": "^18.3.1",
|
|
"xlsx": "^0.18.5"
|
|
},
|
|
"devDependencies": {
|
|
"@types/bcryptjs": "^2.4.6",
|
|
"@types/node": "^20.17.10",
|
|
"@types/qrcode": "^1.5.5",
|
|
"@types/react": "^18.3.18",
|
|
"@types/react-dom": "^18.3.5",
|
|
"autoprefixer": "^10.4.20",
|
|
"postcss": "^8.4.49",
|
|
"prisma": "^5.22.0",
|
|
"tailwindcss": "^3.4.17",
|
|
"tsx": "^4.19.2",
|
|
"typescript": "^5.7.2"
|
|
}
|
|
}
|