Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

Keung123/MDP25-Voting-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

扫码进入投票页

每个设备 10 票 + 1 个年度歌曲选择

管理后台能开关投票、清空数据、查看结果

前端带动画、票数反馈、本地缓存

部署在 AWS Lightsail

Caddy 反代 + Node 后端 + Vite 前端 (自动 https)

前端 投票/管理

Vite + React + Tailwind

image image

后端

Node.js + Express + SQLite:

投票时间开关 / 每设备投票记录 / 票数统计 / 投票清空

部署环境

Ubuntu 22 Node 20+ PM2 Caddy(自动 SSL)

API 文档

  1. 获取当前配置 GET /api/config

返回内容: { "success": true, "votingEnabled": true }

  1. 提交投票 POST /api/vote Body: { "deviceId": "xxxxx", "singerVotes": { "1": 2, "3": 3, "6": 5 }, "bestSongId": 302 }

返回(正常): { "success": true }

返回(未开启投票): { "success": false, "code": "VOTING_CLOSED", "message": "投票未开放" }

  1. Admin:获取投票汇总 GET /api/admin/summary?token=xxx

返回示例: { "success": true, "data": { "votingEnabled": true, "totalDevices": 123, "singers": [ { "id": 1, "name": "A", "votes": 88 }, { "id": 2, "name": "B", "votes": 66 } ], "songs": [ { "id": 101, "title": "Song A", "votes": 44 } ] } }

  1. Admin:切换投票开关 POST /api/admin/toggle-voting Body: { "token": "SUPER_ADMIN_12345", "enabled": true }

  2. Admin:清空所有票数 POST /api/admin/reset-votes Body: { "token": "SUPER_ADMIN_12345" }

About

A lightweight mobile-friendly voting app built for MDP 2025. Users scan a QR code to enter, receive 10 votes, and can freely assign them to 6 performers with friendly visual feedback. Includes optional “Best Song” selection and a backend control switch to enable/disable voting.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages