You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enter a topic, AI auto-generates title, description, and options
⚡ Real-time Push
WebSocket-based live updates, no manual refresh needed
📊 Visual Charts
ECharts pie/bar chart toggle with real-time data
🛡️ Anti-spam
MySQL unique key prevents duplicate voting
📋 Batch Fill
Paste title/desc/options line by line with smart parsing
🎯 Quick Templates
One-click templates for common scenarios
🔄 Auto Fallback
WebSocket unavailable → auto switch to 3s polling
🖱️ Multi-choice Limit
Set max selectable options for multi-choice polls
📱 Responsive
Bootstrap 5 for PC / tablet / mobile
📝 Structured Logging
Winston logger with JSON format and rotation
🔒 Security Hardening
Helmet + layered rate limiting
🧪 Unit Testing
Jest test coverage for core controllers (74%+)
🗄️ Redis Cache
Poll results cached for 10s to reduce DB load
🔁 CI/CD
GitHub Actions auto-runs tests on every push
🛠️ Tech Stack
Layer
Technology
Frontend
HTML5 · CSS3 · Bootstrap 5 · jQuery 3.x
Charts
ECharts 5.x
Realtime
Socket.IO
Backend
Node.js · Express 4.x
Database
MySQL 8.x
Cache
Redis 7.x
Auth
JWT · bcryptjs
AI
DeepSeek API (OpenAI SDK)
Logging
Winston
Security
Helmet · express-rate-limit
Testing
Jest · Supertest
Code Style
ESLint · Prettier
Container
Docker Compose (MySQL + Redis)
CI/CD
GitHub Actions
📦 Installation & Running
Prerequisites
Node.js 14+
MySQL 5.7+ / 8.0
Docker (optional, recommended)
Redis (included in Docker Compose)
Option 1: Docker Compose (Recommended)
git clone https://github.com/ZhaoBuyan/E-Vote.git
cd E-Vote
cp .env.example .env
# Edit .env with your config
docker-compose up -d
npm install
npm run dev
Visit http://localhost:3000
Option 2: Local (Manual MySQL)
git clone https://github.com/ZhaoBuyan/E-Vote.git
cd E-Vote
npm install
cp .env.example .env
# Edit .env with your config
mysql -u root -p < sql/init.sql
npm run dev