Back to Projects

Real-Time Loyalty & Engagement System with Streaming Chat Bot

2024
Real-Time Loyalty & Engagement System with Streaming Chat Bot screenshot 1
+2 photos

* Images are for illustration purposes only

Real-time loyalty and reward platform integrated with a custom streaming chat bot, enabling viewer engagement, point accumulation, and raffle-based rewards.

Tech Stack

TypeScriptNode.jsNext.jsNextAuthWebSocketPostgreSQLUpstash RedisQStash

Key Features

  • Real-Time Point Distribution & Raffle Mechanics
  • Custom Streaming Bot (Reverse-Engineered WebSocket)
  • NextAuth Secure Authentication
  • Scheduled Reward Processing (QStash)
  • Scalable Event-Driven Architecture

The Challenge

Live streamers struggled to maintain viewer engagement and reward loyal community members effectively.

Constraints & Scale

Needed to process chat events in real-time, integrate with multiple streaming platforms, and handle burst traffic during raffles.

System Architecture

Event-driven architecture using Next.js, a custom WebSocket server for the bot, and Upstash Redis for high-speed leaderboards and ephemeral state.

Key Tradeoffs

Built a custom WebSocket bot instead of using standard APIs to bypass rate limits and enable deeper integration, requiring more maintenance but offering superior control.

Measurable Results

Increased chat activity by 200% and facilitated the redemption of over 5,000 rewards. The system handled 10k+ concurrent WebSocket connections with minimal resource usage.

Project Details

Designed and developed a real-time loyalty and engagement system integrated with a custom-built streaming chat bot to enhance audience interaction and retention. The project focused on rewarding user activity such as watching, chatting, and interacting during live streams. Built a dedicated loyalty program web application using Next.js with secure and fast authentication via NextAuth. The platform allows users to track points, redeem rewards, and convert accumulated points into raffle tickets through a structured reward system. Developed a custom streaming bot using TypeScript and Node.js. At the time, no official API was available, so the bot was implemented by reverse-engineering the WebSocket communication protocol, enabling real-time detection of user activity and chat commands. Streamers could configure and use multiple bot commands to interact directly with viewers. Implemented real-time point distribution, raffle mechanics, and scheduled reward processing using PostgreSQL for persistence and Upstash Redis / QStash for caching and task scheduling. WebSocket-based communication ensured low-latency interactions between viewers, the bot, and the loyalty platform. The system was designed to be scalable, event-driven, and extensible, supporting high concurrency during live streaming sessions while maintaining accurate reward tracking and fair raffle execution.

#Loyalty System#Real-Time Engagement#Streaming Bot#WebSocket#Event-Driven#Audience Engagement#Raffle Engine#Data Processing#Custom Bot#Scalable Backend

Want to boost audience engagement? Let's create a real-time interactive experience.

Other Projects

DRX Sportnet Ecosystem (2025)

Infrastructure migration and optimization for Indonesia's premier blockchain sport tech brand.

Tech Stack:
+2
#Blockchain#Sport Tech#Infrastructure
AMS Mobil Karawang

Modernized showroom operations with a customer website and back-office admin.

Tech Stack:
#Freelance#Automotive#CRM
Activo Asset Management

Enterprise SaaS solution for lifecycle asset management and depreciation tracking.

Tech Stack:
+1
#Asset Management#Enterprise SaaS#Workflow Automation

Frequently Asked Questions