Inspiration
Fitness streams are fun to watch, but chat usually just watches. I wanted viewers to have real stakes in a workout, and I wanted two streamers in different places to be able to challenge each other live, each on their own stream, without sharing a video call.
What it does
RepRally is a Twitch-connected push-up challenge for streamers and their communities.
- Solo round: the streamer starts a timed challenge and viewers predict the final count with
!predict N. The closest guesses win. - Two-streamer battle: both streamers share one synchronized countdown and timer while keeping separate rep counts. Viewers predict the winner with
!win A,!win Bor!win empate, and each player's count with!rep A Nor!rep B N. Predictions close when the countdown starts. - OBS overlay: a browser source shows the timer, live counts, camera/pose status, the winner or tie, correct guesses and the closest rep predictions.
- Privacy by design: pose detection runs locally in each streamer's browser. Camera video never leaves their computer; only rep counts are sent.
How we built it
RepRally runs on a lightweight Node.js server with plain HTML, CSS and JavaScript pages.
- Rep counting: MediaPipe Pose Landmarker Lite runs in the browser. It tracks elbow angle, picks the most visible arm (or combines both), and uses relative depth, a minimum range of motion and a minimum rep duration. It works with front, side and oblique camera angles.
- Twitch: EventSub WebSocket reads chat commands, and the Chat API announces round starts and results. OAuth uses only the public Client ID, so no Client Secret is ever needed.
- Battles: one server clock defines start and end for both players. Each battle creates separate private invite links for player A, player B and the overlay. A remote participant can only update their own count and never sees host controls.
- Codex: I built almost the entire project in one OpenAI Codex thread over 8 days: game and battle rules, the Twitch integration, the remote gateway, the overlays, the camera counter, documentation and automated tests that run in GitHub Actions on every push.
Challenges we ran into
- Accurate counting in a browser. Early versions undercounted (44–45 reps on a 50-rep clip). With Codex I aligned the counter with a reference pose-analysis pipeline: arm selection, sampling rate, thresholds and cycle timing. On my test clips the browser count then matched the real reps, including 50/50 on the hardest oblique clip.
- Fairness across two streams. Both players needed the same start and end time, and a page refresh could not lose a player's count. The server owns the clock, and each camera page recovers its accepted total after a refresh.
- Safe remote access. Inviting another streamer meant exposing part of the app over HTTPS without exposing host controls or Twitch tokens. The remote gateway serves only camera pages, battle state, the overlay and rep submission.
- Choosing the right platform. I started with an Android companion app, then switched to the streamer's own PC camera, since that is what streamers actually use on stream.
Accomplishments that we're proud of
- A full flow from camera to pose detection to rep count to Twitch chat to OBS overlay, built in 8 days.
- Pose detection that runs entirely on the streamer's device, with no video uploads.
- Two-streamer battles with private invites, a shared countdown and audience predictions.
- Automated tests for counting, predictions, battle timing and gateway access boundaries.
What we learned
- How to build a Twitch chatbot with EventSub WebSocket and the Chat API, and how to keep OAuth tokens in memory only.
- That browser pose estimation needs careful tuning: frame drops, arm visibility and camera angle all change the count.
- How to work with Codex as a build partner: describe the goal, review each step, test with real clips, and give precise feedback when the result was off.
What's next for RepRally
- More fun exercises. I ran out of time to add squats and timed static planks. Both fit the same battle and prediction format and are planned next, each with its own detection rules.
- Live trials: a full battle between two live webcams on separate PCs, and live Twitch testing of the battle commands. The demo uses pre-recorded push-up clips in place of live webcams, and its audience predictions are simulated through the same local API.
- Guest streamer integration: Twitch sign-in and chat for the guest streamer's own channel, so both communities can predict.
- Stable hosting with a permanent domain, persistence and recovery after a server restart.
Log in or sign up for Devpost to join the conversation.