diff --git a/.gitignore b/.gitignore index 0c0db58..7a7c633 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ node_modules/ dist/ build/ *.tsbuildinfo +apps/admin/dist-print/ # Generated types (regenerate with `npm run db:types`) packages/shared/src/database.types.ts @@ -15,6 +16,10 @@ packages/shared/src/database.types.ts !.env.example SMTP.md +# Printer Pi: filled setup (station token) + exported worker image +apps/printer/pi/setup.local.sh +apps/printer/pi/*.tar.gz + # Supabase CLI local state (generated on `supabase start`) supabase/.temp/ supabase/.branches/ @@ -37,3 +42,7 @@ e2e/node_modules/ e2e/reports/ e2e/test-results/ test-results/ + +# Python bytecode +__pycache__/ +*.pyc diff --git a/apps/admin/package-lock.json b/apps/admin/package-lock.json index a058587..3c716e0 100644 --- a/apps/admin/package-lock.json +++ b/apps/admin/package-lock.json @@ -16,6 +16,11 @@ "react-dom": "^18.3.1" }, "devDependencies": { + "@fontsource/arimo": "^5.3.0", + "@fontsource/cousine": "^5.3.0", + "@fontsource/gelasio": "^5.3.0", + "@fontsource/open-sans": "^5.3.0", + "@fontsource/tinos": "^5.3.0", "@types/canvas-confetti": "1.6.4", "@types/react": "^18.3.5", "@types/react-dom": "^18.3.0", @@ -697,6 +702,56 @@ "node": ">=12" } }, + "node_modules/@fontsource/arimo": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@fontsource/arimo/-/arimo-5.3.0.tgz", + "integrity": "sha512-nhxZ2sTVZYX8DJBgLuyX360B5vE4mxqpmjlKTRfucIqfcWRVx9vOYzWBc1IgEX0ist48VMC10PRKbFyH+4QFvQ==", + "dev": true, + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, + "node_modules/@fontsource/cousine": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@fontsource/cousine/-/cousine-5.3.0.tgz", + "integrity": "sha512-EhVes1KpHrmPwGVCoVxYpdiIi/L2LRGxbAuv07m3TdY76f9Vmwyhd/TNqi2RC0NOvMCNt2FtYPJcAfFfkK9DoQ==", + "dev": true, + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, + "node_modules/@fontsource/gelasio": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@fontsource/gelasio/-/gelasio-5.3.0.tgz", + "integrity": "sha512-V95Jr9GxtSCkigiWKEDTIqajefhJHk8251aQYrMBmrdSeYnjgbKRYxLjGpr3/NjpOAf2bejIiZPwtzJ9Bcpsgw==", + "dev": true, + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, + "node_modules/@fontsource/open-sans": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@fontsource/open-sans/-/open-sans-5.3.0.tgz", + "integrity": "sha512-V1bdMlGNyZrJwzrdusshMOw2YR0aqYDL7kOo9dkxUEKl8dFv66A9HLckOOXl572sG/7ohhDQrCrTFGSn9LZcSw==", + "dev": true, + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, + "node_modules/@fontsource/tinos": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/@fontsource/tinos/-/tinos-5.3.0.tgz", + "integrity": "sha512-VVDyyZdbcsLKxo/W7rClAvacD/7DsGc7J5xzzp51Tndib8kDkEe/0bqbb3Xb3iH6+IUjt07aRsvtQ9MGeGGi4w==", + "dev": true, + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.13", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", diff --git a/apps/admin/package.json b/apps/admin/package.json index 3627bdc..db5a14e 100644 --- a/apps/admin/package.json +++ b/apps/admin/package.json @@ -6,6 +6,7 @@ "scripts": { "dev": "vite", "build": "tsc -b && vite build", + "build:print": "vite build --config vite.print.config.ts", "preview": "vite preview" }, "dependencies": { @@ -17,6 +18,11 @@ "react-dom": "^18.3.1" }, "devDependencies": { + "@fontsource/arimo": "^5.3.0", + "@fontsource/cousine": "^5.3.0", + "@fontsource/gelasio": "^5.3.0", + "@fontsource/open-sans": "^5.3.0", + "@fontsource/tinos": "^5.3.0", "@types/canvas-confetti": "1.6.4", "@types/react": "^18.3.5", "@types/react-dom": "^18.3.0", diff --git a/apps/admin/print.html b/apps/admin/print.html new file mode 100644 index 0000000..a11268b --- /dev/null +++ b/apps/admin/print.html @@ -0,0 +1,18 @@ + + + + + + Convivo badge print renderer + + + +
+ + + diff --git a/apps/admin/src/App.tsx b/apps/admin/src/App.tsx index 0b852e9..c9510d9 100644 --- a/apps/admin/src/App.tsx +++ b/apps/admin/src/App.tsx @@ -10,12 +10,15 @@ import { Schedule } from './views/Schedule'; import { Activity } from './views/Activity'; import { Raffle } from './views/Raffle'; import { BadgeEditor } from './views/BadgeEditor'; +import { Printing } from './views/Printing'; import { Events } from './views/Events'; import { Interfaces } from './views/Interfaces'; import { Reports } from './views/Reports'; import { Settings } from './views/Settings'; import { Settings as SettingsIcon } from 'lucide-react'; import { Spinner } from './components/ui'; +import { PrinterStatusPill } from './components/PrinterStatusPill'; +import { PrintStatusProvider } from './lib/printStatus'; export type View = | 'dashboard' @@ -26,6 +29,7 @@ export type View = | 'activity' | 'raffle' | 'badges' + | 'printing' | 'events' | 'interfaces' | 'reports' @@ -40,6 +44,7 @@ const NAV: { id: View; label: string; ico: string }[] = [ { id: 'activity', label: 'Activity', ico: '⚡' }, { id: 'raffle', label: 'Raffle', ico: '🎯' }, { id: 'badges', label: 'Badges', ico: '🎫' }, + { id: 'printing', label: 'Printing', ico: '🖨️' }, { id: 'events', label: 'Events', ico: '📅' }, { id: 'interfaces', label: 'Interfaces', ico: '🔌' }, { id: 'reports', label: 'Reports', ico: '📤' }, @@ -61,6 +66,7 @@ function Shell() { if (!contact) return ; return ( +