Commit Graph

45 Commits

Author SHA1 Message Date
empty
b5fa4c7086 chore: add WeChat MP domain verification file
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 22:00:52 +08:00
empty
9f94f362d4 chore: add wechatMp config for MP OAuth
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 21:38:06 +08:00
empty
7a3b9a3694 chore: add missing auth utils and public routes
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 21:35:04 +08:00
empty
9b11f99fed feat: implement WeChat MP OAuth login
- Add wechat-mp.service.ts for MP web authorization
- Add wechat-mp.routes.ts with /api/mp endpoints
- Update EntryQRCode.vue to show H5 URL QR code
- Update HomeView.vue with WeChat auth detection

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 21:33:32 +08:00
empty
b53e732ffa docs: update documentation for WeChat OAuth login
- README.md: update scan login section to reflect WeChat OAuth flow
- DEPLOY.md: add WeChat environment variables configuration
- 联调测试方案.md: update test case A01 for new login flow

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 17:36:03 +08:00
empty
2cb9032187 feat: update login flow and add firework effects
- Update mobile HomeView to show WeChat scan login instructions
- Remove manual name/department input form from mobile client
- Add firework particle effects to big screen background
- Remove department field from login flow types

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 17:18:03 +08:00
a40c8b6045 Merge pull request 'feat: add WeChat environment variables to docker-compose' (#4) from feat/add-wechat-env-config into main
Reviewed-on: #4
2026-02-03 14:55:34 +08:00
f2161c68da feat: add WeChat environment variables to docker-compose
## Changes

### Docker Compose Configuration
- Add WECHAT_APP_ID environment variable to server service
- Add WECHAT_APP_SECRET environment variable to server service
- Add WECHAT_REDIRECT_URI environment variable to server service

## Purpose
Enable WeChat Open Platform QR code login functionality by passing
WeChat credentials from .env file to the server container.

## Testing
- All containers started successfully
- Server loaded configuration correctly
- WeChat login endpoints are now available

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03 14:48:04 +08:00
empty
3246479643 feat: integrate WeChat Open Platform QR code login
- Add WeChat service for OAuth2 authentication flow
- Add WeChat routes (/api/wechat/login, /api/wechat/callback)
- Add WeChat types for login state and responses
- Update EntryQRCode component to support WeChat login
- Add WeChat config options (appId, appSecret, redirectUri)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 14:38:54 +08:00
5d7bf74101 Merge pull request 'feat: update program configuration with actual program names' (#3) from feat/update-program-names into main
Reviewed-on: #3
2026-02-03 13:45:30 +08:00
197cd7ca29 Merge pull request 'fix/deployment-and-database-integration' (#2) from fix/deployment-and-database-integration into main
Reviewed-on: #2
2026-02-03 13:45:10 +08:00
c09dbfbd3d feat: update program configuration with actual program names
## Changes

### Program Configuration
- Update programs.json with actual program names:
  - 节目一:青苹果乐园
  - 节目二:五百年桑田沧海
  - 节目三:我的中国心
  - 节目四:萍聚
  - 节目五:追光而行,共赴新程
  - 节目六:粉红色的回忆
  - 节目七:敬业狂想曲

### Dockerfile Update
- Add config directory copy to Dockerfile
- Ensure program configuration is included in production build

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 21:56:31 +08:00
84838928e3 feat: update program configuration with actual program names
## Changes

### Program Configuration
- Update programs.json with actual program names:
  - 节目一:青苹果乐园
  - 节目二:五百年桑田沧海
  - 节目三:我的中国心
  - 节目四:萍聚
  - 节目五:追光而行,共赴新程
  - 节目六:粉红色的回忆
  - 节目七:敬业狂想曲

### Dockerfile Update
- Add config directory copy to Dockerfile
- Ensure program configuration is included in production build

## Testing
- Configuration loaded successfully (7 programs, 7 awards)
- Server restarted and verified config loading

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 21:52:03 +08:00
296f6e09f8 fix: add MySQL database and fix deployment issues
## Changes

### Database Integration
- Add MySQL 8.0 service to docker-compose.yml
- Configure DATABASE_URL environment variable for server
- Add health check for MySQL service
- Create mysql_data volume for data persistence

### Dockerfile Improvements
- Generate Prisma Client in builder stage
- Copy Prisma Client from correct pnpm workspace location
- Ensure Prisma Client is available in production container

### Client-Mobile Fixes
- Remove deprecated StampDock.vue component
- Fix voting store API usage in VotingPage.vue
- Add type assertion for userTickets in connection.ts
- Add remark property to AwardConfig interface in voting.ts

## Testing
- All containers start successfully
- Database connection established
- Redis connection working
- 94 participants restored from Redis
- Vote data synced (20 votes)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 21:46:51 +08:00
empty
e211bb2130 feat: add lottery results display page
- Add LOTTERY_RESULTS system phase
- Add /screen/lottery-results route
- Add LotteryResultsView component
- Add database connection management (db.ts)
- Update DrawResult schema to remove User relation
- Add awardIcon field to VoteResultsView

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 02:13:28 +08:00
empty
57cbaa5728 fix: broadcast state change after redraw current round
Add emit('stateChange') to notify frontend clients when
lottery round is redrawn, so UI updates correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 02:05:39 +08:00
empty
5ef68b1264 feat: make award statistics panel collapsible
- Convert stats-section to collapsible details element
- Add expand/collapse indicator (▶/▼)
- Save screen space on mobile devices

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 02:02:15 +08:00
empty
aba96f88df refactor: optimize data cleanup functions in director console
- Add redrawCurrentRound() method to clear current round winners
- Add /api/admin/lottery/redraw API endpoint
- Rename "重置" to "重置本轮" (reset current round state only)
- Add "重抽本轮" button (clear winners and allow re-draw)
- Rename "紧急操作" to "数据管理" with clearer button labels
- Change "高级清理" to collapsible "开发者选项"
- Update confirmation modal text for clarity

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 01:59:13 +08:00
empty
4a2f1e7c8a refactor: 优化导演控制台代码结构和用户体验
高优先级优化:
- 合并 REVEAL/COMPLETE 状态的重复代码模板

中优先级优化:
- 添加防抖函数 (debounce/debounceLeading) 防止按钮重复点击
- 投票控制按钮添加 500ms 防抖
- 抽奖控制按钮添加 500ms 防抖
- 新增 Toast 通知系统替代 alert
- 优化 API 错误反馈:loadPrizeConfig、loadParticipants、
  importParticipants、savePrizeConfig 现在显示 Toast 错误提示

低优先级优化:
- 新增实时奖项统计面板,显示各奖项投票 TOP3
- 添加奖项统计面板响应式样式
- 添加 Toast 动画和样式

其他:
- 添加 getAwardDisplayName 辅助函数
- 优化移动端适配
2026-01-29 00:28:19 +08:00
empty
5c5d0ad85c feat: 优化100人并发投票支持 + 修复奖项名称硬编码问题
服务端优化:
- Socket.IO 配置优化,支持高并发 WebSocket 连接
- 添加 connectTimeout、perMessageDeflate 等参数

压测脚本:
- 新增 vote-real-scenario.yaml 真实场景压测配置
- 支持 100人瞬间爆发、每人7票、不同投票速度模拟
- 添加随机延迟函数模拟真实用户行为
- 强制 WebSocket 传输避免 HTTP 连接限制

前端修复:
- 修复 PostcardItem、PostcardDisplay 奖项名称硬编码问题
- 组件现在从后端 awards 配置动态获取奖项名称
- 修复 LiveVotingView、AdminControl 传递 awards 数据
- 新增 gala 压测命令到 package.json

测试验证:
- 100人并发压测通过,成功率 100%
- P95 延迟 0.7ms,远低于 500ms 阈值
- 系统可稳定支持 3.3 倍现场负载
2026-01-29 00:09:03 +08:00
empty
2f8bf0d755 style: refine mobile voting dock film strip UI with seamless borders and improved text clarity 2026-01-28 22:42:59 +08:00
empty
d090c80e50 修复投票计数与状态同步,完善票据与戳显示
修复投票系统:禁止重复投票、恢复状态、同步大屏

完善投票流程与展示:计数准确、状态可恢复、样式统一
2026-01-28 21:37:05 +08:00
empty
66ca67c137 feat(server): 添加节目配置文件管理
- 新增 programs.json 配置文件
- 新增 ProgramConfigService 服务
- 新增节目配置 API 接口 (GET/PUT /api/admin/programs)
- 修改 AdminService 使用配置服务替代硬编码
- 添加单元测试
2026-01-28 13:55:03 +08:00
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