Skip to content
Menu
Portfolio
  • Personal Projects
  • Assignments
  • Algorithms
  • Notes
  • Home
Portfolio

Sweepstakes Marketing

Posted on May 14, 2025June 22, 2025

TRY THE DEMO AT https://luckydraw.hebo.life/

This Raffle module is a pivotal component of the comprehensive Marketing Platform, designed to enhance user engagement through diverse promotional activities such as raffles, point accumulation, redemptions, and rebates.

The following is the Business Process Diagram for the module:


Technical Architecture

  • Architecture Design: Microservices architecture with Domain-Driven Design (DDD) principles, ensuring scalability and maintainability.
  • Core Technologies:
    • Backend: Spring Boot, MyBatis, MySQL, Redis, RabbitMQ
    • Frontend: React, TypeScript

Raffle Module Highlights

  • Versatile Raffle Mechanisms: Supports various raffle types including general raffles, blacklist filtering, targeted user groups, draw times based raffles, and unlockable rewards after multiple draws.
  • Design Patterns Utilized: Incorporates Template, Chain of Responsibility, and Factory patterns to enhance code extensibility and maintainability.
  • Performance Optimization: Engineered to handle high-concurrency scenarios, achieving 500–800 TPS on a 4-core, 16GB RAM server, with response times ranging from 45ms to 100ms.

Core Responsibilities

  • Domain Model Design: Defined comprehensive domain models for the raffle process, segmenting it into pre-draw, in-draw, and post-draw phases, each with extensible behaviors such as user eligibility checks, inventory deduction, and fallback rewards.
  • Database Schema Design: Structured raffle-related tables including strategy, strategy details, rule configurations, and rule action trees to facilitate scalability and flexibility.
  • Process Standardization: Established a standardized raffle process using the Template pattern, integrating the Chain of Responsibility for draw actions and the Composite pattern for dynamic post-draw rule processing.
  • API and Trigger Layer: Developed a unified API standard with a trigger layer encompassing listeners, tasks, HTTP, and RPC modules, treating all actions as triggerable events.
  • Inventory Management: Implemented Redis-based inventory deduction with segmentation and locking mechanisms to prevent overselling, complemented by asynchronous queues and scheduled tasks for database synchronization.
  • Development and Deployment: Proficient in using IntelliJ IDEA, WebStorm, Docker, MySQL, cloud servers, and SSH tools, successfully deploying the project to a live environment.

The system design is as follow:

The following are some screenshots about the project’s frontend UI.

  • UI_1
  • UI_2
  • UI_3
  • UI_4
  • UI_5

The following are the database design. This project used sharded database and sharded tables for user activities. More details can be viewed in the images.

A more detailed system design about user system, reward system, raffle system will be uploaded shortly.

CATEGORIES

  • Personal Projects
  • Notes
  • Algorithms

  • University of Maryland
  • CMSC426 - Computer Vision
  • CMSC320 - Introduction to Data Science
  • CMSC330 - Organization of Programming Languages
  • CMSC216 - Introduction to Computer Systems
©2025 Portfolio | WordPress Theme by Superbthemes.com