Real-Time Reward Engine Implementation

Заказчик: AI | Опубликовано: 29.12.2025

I’m building a lightning-fast reward engine where a user tap on any key button must feel instant and authentic. The rule is strict: the back-end has no more than two seconds to finish the calculation, credit the reward, and push it forward; the front-end must answer that push at once with jumping numbers, a voice cue, and the comforting sense of “money just landed”. Because I care most about the front-/back-end link itself, WebSocket will be the primary lane and must carry online events such as share invites, daily check-ins, cash-outs, holiday multipliers, and team milestones in real time. I still want the recommended safety net—regular polling every 5-10 seconds plus push notifications—so rewards reach users even if a socket drops or they are offline. Key technical demands • All multipliers, reward amounts, texts, start/stop times, stacking rules, pop-up and push wording live in a back-office panel; no hard-coded values or if-else nests. • Any change made in that panel must roll out to every service within five seconds, with zero code changes or app-store releases. • The calculation flow is fixed: look up the highest priority multiplier (temporary event > holiday > default), compute “base × multiplier”, write the log (user, moment, multiplier source, final value), update the database, then broadcast through WebSocket. Acceptance test 1. Tap “Sign-In” on the staging app: within 2 s the balance climbs, the number rolls, and a voice clip says “签到成功”. 2. Change the holiday multiplier in the admin panel; within 5 s the new rate is applied to the next reward event without a redeploy. 3. Unplug the WebSocket; polling still picks up the reward within 10 s; if the device is offline a push arrives within a minute. Deliverables • Reward calculation microservice with WebSocket gateway and REST fallback. • Configuration dashboard (React/Vue/Angular; your choice) hot-reloading all fields listed above. • Front-end demo page or component that shows the number animation and plays the audio cue. • Deployment scripts and concise setup guide. If you have a proven pattern for ultra-low-latency sockets, hot reloading of configs, or creative front-end feedback effects, let’s talk—I’m ready to integrate fast.