Back to projects

Project Details

ScameterPlus Lucky Draw CMS (Scameter Lucky Draw)

A two-system lucky-draw platform: Winter CMS admin operations plus a production-style Express API for device-based auth, scoring, tickets, weighted prize draws, and queued winner notifications.

completedLast updated Feb 8, 2026

What It Does

  • Runs campaign operations end-to-end with admin tooling for competitions, tickets, vouchers, and reporting.
  • Exposes secure REST APIs for user onboarding, Q&A verification, scoring, ticket earning, and prize draw workflows.
  • Supports delayed winner email delivery, optional QR codes, and anti-abuse controls across registrations and ticket issuance.

Architecture Highlights

  • Two-system architecture separates campaign administration (Winter CMS) from transactional/public APIs (Express).
  • CMS side uses pluginized MVC modules plus console automation for time-based campaign operations.
  • API side uses idempotent draw/ticket workflows and DB-backed queueing for delayed notification processing.
  • Voucher inventory and winner tracking are enforced at the data layer to preserve draw integrity.

Key Features

CMS Admin System (Winter CMS)

  • Users, Competitions, Questions & Options, Passcodes, Tickets, Scores, Feedbacks, Prizes/Vouchers, and Prize Records
  • Ticket import/export, campaign-phase reset scheduling, and dashboard widgets for ticket/page-view reporting
  • Console commands, factories/seeders, and EasyAudit tracking for settings/template changes

Backend API System (Express + MySQL)

  • Device-based JWT auth using `device_info.unique_id` with token validation flows
  • Input validation/sanitization for name, title, HK ID, phone, and email
  • Registration anti-abuse limits across identity tuple and email

Quiz, Scoring, and Ticket Engine

  • Competition/question fetch and server-side answer verification (`/verify-answer`)
  • Score creation/read with optional evidence upload (JPG/PDF via multer)
  • Weekly-limited ticket earning from Q&A, passcodes, and token-claim actions (download/report/search/share)

Prize Draw + Voucher Inventory

  • Consumes unused tickets and draws from enabled vouchers with active date windows and available voucher codes
  • Supports award-once-only constraints across accounts sharing personal info
  • Claims voucher code, records win, and returns prize payload

Notification + Feedback APIs

  • Winner email jobs queued in DB with configurable delay and optional QR code embedding
  • API-key protected prize-email endpoint and single-feedback-per-user enforcement

Tech Stack

System 1 (CMS Admin)

  • PHP 8.x
  • Winter CMS 1.2 (Laravel 9.1)
  • MySQL
  • Winter backend modules
  • Custom plugin architecture

System 2 (Backend API)

  • Node.js
  • Express
  • MySQL
  • Sequelize (mysql2)
  • jsonwebtoken
  • multer
  • nodemailer
  • moment-timezone
  • qrcode
  • winston

Deployment

  • Alibaba Cloud Function Compute (custom runtime, HTTP trigger)

Data Model

  • Users, Competitions, Questions, Options, Scores, Tickets, Passcodes
  • Vouchers, VoucherCodes, UserVouchers, SystemSetting
  • EmailQueue, MailLog, UserFeedback

Performance & Product Notes

  • Ticket seeding pipeline supports 1,000,000+ records using batched transactions.
  • Cron-scheduled ticket pool resets run per campaign timing in Hong Kong timezone.
  • Serverless deployment model supports burst campaign traffic with operationally simple scaling.
  • Validation, JWT auth, and API-key protected endpoints reduce abuse risk in prize and notification flows.