22 Commits

Author SHA1 Message Date
empty
a89d844f7b fix: add missing poolTag to default prize config
The default configuration was missing poolTag for all rounds,
causing the lottery to draw from all participants instead of
filtering by generation/zodiac tags when prizes.json fails to load.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 17:35:49 +08:00
2b34d14e96 Merge pull request #1
fix: production deployment improvements and configuration fixes
2026-01-26 17:21:38 +08:00
1e1563c5f5 Merge branch 'main' into fix/production-deployment-improvements 2026-01-26 17:17:51 +08:00
371f117064 fix: production deployment improvements and configuration fixes
## 主要改动

### 1. 修复二维码地址硬编码问题
- 将 MainDisplay.vue 中硬编码的移动端 URL 改为环境变量配置
- 添加 VITE_MOBILE_URL 环境变量支持
- 支持通过 .env 文件动态配置移动端地址

### 2. 修复音频文件路径问题
- 修正 display.ts 中音频文件路径,添加 /screen 前缀
- 修复 BGM、抽奖音效、胜利音效的加载路径

### 3. 修复 Docker 构建问题
- 添加中国 npm 镜像配置,解决构建超时问题
- 修复缺失的 tsconfig.base.json 文件拷贝
- 修复 Redis 环境变量配置(REDIS_HOST/REDIS_PORT)
- 添加 Lua 脚本文件拷贝到生产容器

### 4. 修复前端路由和资源加载
- 添加 Vite base path 配置 (/screen/)
- 修复 Vue Router base path 配置
- 修正 Caddyfile 路由顺序,确保 /screen 路径优先匹配

### 5. 修复 TypeScript 编译错误
- LuckyDrawView.vue: 添加 round 属性类型定义
- ProgramCard.vue: 添加非空断言处理

### 6. 修复 SCSS 变量问题
- 替换未定义的 SCSS 变量为硬编码颜色值
- 修复 VoteView、ConnectionStatus、HomeView、ScanLoginView 中的样式问题

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-26 16:59:02 +08:00
empty
5290141fda docs: add comprehensive README.md
- Project overview and features
- Tech stack documentation
- Project structure
- Quick start guide
- Deployment instructions
- Design specifications

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 01:13:29 +08:00
empty
4d621b5901 feat: replace Nginx with Caddy for automatic SSL management
- Add Caddyfile with automatic HTTPS configuration
- Add Dockerfile.caddy for frontend build with Caddy
- Update docker-compose.yml to use Caddy service
- Update DEPLOY.md with simplified deployment instructions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 00:28:15 +08:00
empty
11e5754d05 feat: add audio files for lottery and BGM
- bgm.mp3 - background music
- lottery.mp3 - lottery spinning music
- fanfare.mp3 - winner celebration sound

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 00:26:01 +08:00
empty
d4289825aa feat: add Docker deployment configuration
- Add server Dockerfile with multi-stage build
- Add frontend Dockerfile with Nginx
- Add docker-compose.yml for orchestration
- Add Nginx config with SSL support
- Add deployment documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 00:23:25 +08:00
empty
7073591ebd feat: auto music control for lottery phases
- Auto-play lottery music when storm starts
- Auto-play fanfare when winners revealed
- Auto-stop music when lottery completes
- Add EventEmitter to broadcast async state changes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 23:54:42 +08:00
empty
7ba92c81e9 fix: add audio unlock overlay for browser autoplay policy
- Add click-to-unlock overlay on big screen
- Play silent audio to unlock browser audio context
- Show unlock prompt before allowing audio playback

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 22:35:50 +08:00
empty
4eb2814391 feat: add BGM playback control for big screen display
- Add audio player to display store with play/stop functions
- Listen for music state changes from AdminState sync
- Support bgm, lottery, and fanfare audio tracks
- Create audio directory structure

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 22:05:30 +08:00
empty
7dc77da939 feat: add participant data persistence display and mobile responsive fixes
- Add getStats() method to participantService for tag distribution
- Update participants API to return tagDistribution statistics
- Load existing participants on AdminControl mount
- Add mobile responsive styles for import section

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 22:02:12 +08:00
empty
96b428e64a chore: add data files to .gitignore
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 21:47:44 +08:00
empty
f4736b6ebd feat: implement QR code scan login system with admin control
- Add scan login service with Redis-based token management
- Add scan login API routes for token generation and validation
- Add QRCodeLogin component for PC-side QR code display
- Add EntryQRCode component for mass login scenarios
- Add ScanLoginView for mobile-side login form
- Add localStorage persistence for user identity
- Add logout functionality to mobile client
- Add auto-redirect for logged-in users
- Add admin console control for QR code display on big screen
- Add socket event forwarding from admin to screen display

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 21:44:52 +08:00
empty
75570af8bc test: add comprehensive test suite for server
- Add load testing with Artillery (smoke, standard, peak, stress)
- Add functional tests: voting, lottery, admin (18 tests)
- Add fault tolerance tests (14 tests)
- Add network tests for WebSocket (7 tests)
- Add compatibility tests (15 tests)
- Add security tests: anti-fraud, auth, data integrity (10 tests)
- Fix optional callback handling in socket handlers
- Total: 64 test cases, all passing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 19:53:16 +08:00
empty
22141c9263 feat: festive Chinese red background and prize config unification
- Change all big screen backgrounds to pure Chinese red (#c41230)
- Remove vignette effect for consistent display on different screens
- Unify all prize data to match prizes.json configuration
- Add demo participants fallback when no data imported
- Fix particle visibility reset in startGalaxy()

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 16:33:21 +08:00
empty
a442d050e4 feat: enhance lottery system with participant import and prize config
- Fix ES module import issue in admin.service.ts (require -> import)
- Fix lottery reveal ghosting by hiding name particles on complete
- Add participant import from Excel with tag calculation
- Add prize configuration service with JSON persistence
- Constrain winners overlay to scroll area dimensions
- Fix macOS lsof syntax in stop script
- Add HorseRace view and renderer (WIP)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 12:20:45 +08:00
empty
35d77cbb22 feat: enhance AdminControl and VoteResultsView
- Update AdminControl.vue with improved controls
- Enhance VoteResultsView.vue with better display

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 15:57:52 +08:00
empty
623617ecc1 fix: update PostcardItem stamp image import
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 15:32:28 +08:00
empty
84be8c4b5c feat: redesign Big Screen voting view with philatelic postcard UI
- Add PostcardItem.vue component with Chinese postal aesthetics
- Add PostcardGrid.vue container with 4x2 CSS Grid layout
- Add Postmark.vue component for real-time vote stamp visualization
- Update LiveVotingView.vue with cream paper theme (#FDFBF7)
- Add Year of the Horse 2026 stamp image
- Add responsive breakpoints for different screen sizes
- Enhance admin service with program voting control
- Add vote stamp accumulation for big screen display

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 15:15:17 +08:00
empty
30cd29d45d feat: add Admin Control Panel, voting status check, and router security
Admin Control Panel:
- Add full AdminControl.vue with 3 sections (Voting, Lottery, Global)
- Add AdminLogin.vue with access code gate (20268888)
- Add admin.ts store with state persistence
- Add admin.types.ts with state machine types
- Add router guards for /admin/director-console

Voting System Fixes:
- Add voting status check before accepting votes (VOTING_CLOSED error)
- Fix client to display server error messages
- Fix button disabled logic to prevent ambiguity in paused state
- Auto-generate userId on connect to fix UNAUTHORIZED error

Big Screen Enhancements:
- Add LiveVotingView.vue with particle system
- Add LotteryMachine.ts with 3-stage animation (Galaxy/Storm/Reveal)
- Add useSocketClient.ts composable
- Fix MainDisplay.vue SCSS syntax error
- Add admin state sync listener in display store

Server Updates:
- Add admin.service.ts for state management
- Add isVotingOpen() and getVotingStatus() methods
- Add admin socket event handlers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 15:34:37 +08:00
empty
e7397d22a9 feat: initialize Annual Gala Interactive System monorepo
- Set up pnpm workspace with 4 packages: shared, server, client-mobile, client-screen
- Implement Redis atomic voting with Lua scripts (HINCRBY + distributed lock)
- Add optimistic UI with IndexedDB queue for offline resilience
- Configure Socket.io with auto-reconnection (infinite retries)
- Separate mobile (Vant) and big screen (Pixi.js) dependencies

Tech stack:
- Frontend Mobile: Vue 3 + Vant + Socket.io-client
- Frontend Screen: Vue 3 + Pixi.js + GSAP
- Backend: Express + Socket.io + Redis + Prisma/MySQL

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 01:19:36 +08:00