We combined FTMS sensors, Socket.IO, and POS UI extensions to turn a manual treadmill into a discount-printing machine.
Overview
Shopify partnered with Endorphins Running to build a gamified treadmill experience for the 2025 NYC Marathon weekend that rewarded runners with in-store credit based on pace consistency. The system combined Bluetooth FTMS hardware sensors, a Python treadmill server, a Remix web application with Socket.IO for real-time communication, and a custom Shopify POS UI extension for seamless discount redemption at checkout.
What You'll Learn
How to connect Bluetooth FTMS fitness hardware to a Python server for real-time data processing
How to build a real-time gamified experience using Socket.IO, Remix, and WebSocket event-driven architecture
How to build a Shopify POS UI extension that scans barcodes and applies discounts automatically
How to normalize irregular sensor data intervals for consistent pace-to-credit calculations
Why decoupling the treadmill experience from the checkout system improves reliability in live retail events
Prerequisites & Requirements
- Understanding of WebSocket and real-time event-driven communication patterns
- Familiarity with React and component-based UI architecture
- Experience with Remix framework or similar full-stack React frameworks(optional)
- Basic understanding of Bluetooth protocols and hardware sensor integration(optional)
- Familiarity with Shopify POS and its extension APIs(optional)
Key Questions Answered
How do you read real-time speed data from a treadmill using Bluetooth FTMS?
Why use a manual treadmill instead of a motorized one for a pace-based game?
How do you normalize irregular Bluetooth FTMS sensor intervals for consistent calculations?
How does the pace zone scoring system work for converting running speed to store credit?
How do you build a Shopify POS UI extension that scans barcodes and applies discounts?
How do you print custom receipts with barcodes from a Remix web application?
Why should you decouple the in-store experience from the checkout system?
How do you manage state across multiple displays and control panels in a real-time event?
Key Statistics & Figures
Technologies & Tools
Some links below are affiliate links. We may earn a commission if you make a purchase.
Key Actionable Insights
1Use manual treadmills instead of motorized ones when building pace-tracking experiences, because motorized treadmills produce uniform data regardless of runner effort. Manual treadmills respond immediately to pace changes, providing genuine variability that makes gamification meaningful.This applies to any hardware-based gamification project where you need authentic user input rather than automated system output.
2Normalize irregular sensor intervals by calculating timestamps as a percentage of a second rather than assuming fixed-rate data delivery. FTMS messages and many other hardware protocols do not guarantee consistent timing between events, which can lead to inaccurate calculations if you assume fixed intervals.This pattern is essential for any application consuming real-time hardware sensor data, from fitness equipment to IoT devices, where message frequency varies.
3Decouple your experiential/interactive system from your transactional checkout system by hosting them on separate infrastructure. This ensures that debugging or failures in the interactive experience never block customers from completing purchases.Critical for live retail events and pop-ups where downtime directly impacts revenue and customer satisfaction.
4Use Socket.IO with a local network architecture (all services on one machine) for ultra-low-latency real-time experiences. Running the Python treadmill server, Remix web app, and display clients on the same MacBook Pro eliminates network latency entirely.Ideal for in-store or event-based installations where a single machine can handle the load and you need sub-second responsiveness.
5Wrap hardware interfaces like receipt printers in React Context via custom hooks so they can be accessed from any component without re-instantiation. The usePrinter hook pattern makes printer status and functionality available application-wide while maintaining a single connection.Applicable to any web application that interfaces with physical hardware peripherals, especially in retail or kiosk environments.
6Store customer metadata from experiential events as Shopify customer metafields to enable future segmentation and personalized marketing. This turns a one-time interactive event into a long-term customer data asset.Useful for brands running pop-up events or in-store activations who want to build ongoing relationships with participants.