Polkadot treasure hunt game for sub0 events.
npm install
npm run dev- Push to GitHub
- Import in Vercel
- Deploy
- Done!
- Player enters name
- Answers 5 randomly selected Polkadot knowledge puzzles
- Must score 60+ points (3+ correct answers) to win
- Winners get a QR code (scannable) + 6-digit backup code
- Scan QR code or show code to claim prize
- Players scoring < 60 points are encouraged to try again
- Square Layout: Optimized 1:1 aspect ratio for arcade displays
- QR Code Rewards: Winners receive a scannable QR code with backup text code
- Touch-Optimized: Perfect for arcade machine touchscreens
- Responsive: Automatically scales to fit screen (max 1080x1080px)
35+ questions covering:
- Relay Chain & Parachains
- XCM (Cross-Consensus Messaging)
- On-chain Identity & Registrars
- Conviction Voting & OpenGov
- Treasury & Economics
- Substrate & WASM
- NPoS & Consensus (GRANDPA, BABE)
- Smart Contracts (ink!)
- And more...
The game includes a built-in analytics dashboard that tracks:
- Total games, wins, and losses
- Win rates and average scores
- Daily statistics
- Top players and leaderboards
- Player retry attempts
- Recent game activity
Setup: See ANALYTICS_SETUP.md for detailed instructions.
Quick Setup:
- Create a free Neon Postgres database
- Add
DATABASE_URLto.env.local - Run the app and visit
/analytics
View Dashboard: Visit https://your-app.vercel.app/analytics
Reset Database:
npm run reset-db # Interactive CLI with confirmationsOr use the "Reset DB" button in the analytics dashboard.
Chromium/Chrome (Linux):
chromium-browser --kiosk --noerrdialogs YOUR_VERCEL_URLFirefox:
firefox --kiosk YOUR_VERCEL_URLEdge (Windows):
msedge --kiosk YOUR_VERCEL_URLEdit the questions in data/questions.js:
const puzzles = [
{
id: 1,
title: "Your Title",
clue: "Your clue text",
question: "Your question?",
options: [
{ id: 'a', text: "Option A", correct: true },
{ id: 'b', text: "Option B", correct: false },
// ...
],
explanation: "Your explanation",
hint: "Your hint"
},
// ... more puzzles
];Edit puzzle colors in TreasureHunt.jsx:
color: "from-blue-500 to-cyan-600" // Puzzle 1
color: "from-purple-500 to-pink-600" // Puzzle 2Edit points in submitAnswer function:
if (selected && selected.correct) {
setPoints(points + 20); // Change 20 to your desired points
}✅ Square 1:1 layout - Perfect for arcade displays ✅ QR code rewards - Scannable codes with text backup ✅ 35+ educational Polkadot questions with random selection ✅ 60+ point win threshold (encourages learning) ✅ Real-time analytics dashboard ✅ Player tracking and leaderboards ✅ Daily statistics and retry tracking ✅ Touch-optimized interface for arcade machines ✅ Works in any modern browser ✅ Easy to deploy on Vercel ✅ Generates unique 6-digit reward codes ✅ Beautiful gradients and animations ✅ Serverless architecture with Neon Postgres ✅ Auto-refresh analytics (every 30 seconds)
- Deploy app to Vercel
- Configure arcade machine browser to open your URL
- Set browser to fullscreen/kiosk mode
- Participant approaches arcade machine
- Enters their name
- Answers 5 Polkadot puzzles
- Gets a 6-digit code
- Shows code to staff
- Claims reward!
App won't deploy on Vercel
- Check all files are committed to Git
- Verify package.json has all dependencies
- Check Vercel build logs
Arcade machine browser shows blank screen
- Check browser console for errors
- Try different browser
- Verify internet connection
- Hard refresh (Ctrl+F5)
Touch isn't working
- Verify touch drivers installed
- Test with mouse first
- Check CSS
touch-actionproperties
MIT