---
title: "Run for your money: Engineering a treadmill that prints store credit"
description: "For NYC Marathon weekend, Shopify and Endorphins Running built a gamified curved manual treadmill that awards in-store credit for holding a chosen pace within a padded \"zone\" for 30 seconds, earning 1/30th of $75 per second in zone."
url: "https://swe.quest/articles/run-for-your-money-engineering-a-treadmill-that-prints-store-credit-702ad79862116f35"
canonical: "https://shopify.engineering/how-we-built-a-gamified-treadmill"
source: "Shopify Engineering"
published: "2025-11-25"
difficulty: "medium"
kind: "Case study"
reading_minutes: 8
tags: ["ecommerce","realtime","hardware","product-engineering"]
---

# Run for your money: Engineering a treadmill that prints store credit

A post on [Shopify Engineering](https://swe.quest/sources/shopify.md), published 2025-11-25, 8 min read, Case study. Original: [https://shopify.engineering/how-we-built-a-gamified-treadmill](https://shopify.engineering/how-we-built-a-gamified-treadmill)

## Summary

For NYC Marathon weekend, Shopify and Endorphins Running built a gamified curved manual treadmill that awards in-store credit for holding a chosen pace within a padded "zone" for 30 seconds, earning 1/30th of $75 per second in zone. A Python script on a single MacBook Pro reads Bluetooth FTMS messages and relays them over Socket.IO to a local Remix/Express app that drives displays, a state-machine control panel, Shopify discount creation and Epson ePOS receipt printing. Irregular FTMS message timing is normalized by weighting each interval as a fraction of a second. A POS UI extension scans the receipt barcode to attach the customer and discount, and it is hosted on production rather than the local server so treadmill problems never block checkout.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [E-commerce](https://swe.quest/tags/ecommerce.md) (Domains)
- [Real-time systems](https://swe.quest/tags/realtime.md) (Backend & APIs)
- [Hardware](https://swe.quest/tags/hardware.md) (Infrastructure)
- [Product engineering](https://swe.quest/tags/product-engineering.md) (Engineering organization)

## Prerequisites

- WebSockets basics ([easy posts on Real-time systems](https://swe.quest/tags/realtime.md?difficulty=easy))
- React/Remix routing ([easy posts on React](https://swe.quest/tags/react.md?difficulty=easy))
- Shopify Admin API

## Keywords

FTMS, Socket.IO, Remix, Shopify POS UI extensions, Epson ePOS SDK, TrueForm Trainer, Bluetooth

## Related posts

- [Behind the Scenes - A Glimpse into Tax Calculations](https://swe.quest/articles/behind-the-scenes-a-glimpse-into-tax-calculations-e407cbdd9218b08a.md): Etsy Code as Craft · 2025-03-29 · Medium · 4 min read · E-commerce, Scaling, Load balancing, System design
  Etsy calculates marketplace tax by calling Vertex's tax engine: a Quotation Request SOAP call when items are added to cart, and DistributeTaxRequest calls at order creation, cancellation and refund so Vertex's tax journal holds a complete record for reporting and remittance.
- [Building a Real-time Buyer Signal Data Pipeline for Shopify Inbox](https://swe.quest/articles/building-a-real-time-buyer-signal-data-pipeline-for-shopify-inbox-35ea4cdd28145f71.md): Shopify Engineering · 2021-12-13 · Medium · 12 min read · Stream processing, Data pipelines, Event-driven architecture, E-commerce
  Shopify built a streaming pipeline on Apache Beam and Google Cloud Dataflow that surfaces cart actions and order completions to merchants inside Shopify Inbox conversations.
- [Scaling Shopify's BFCM Live Map: An Apache Flink Redesign](https://swe.quest/articles/scaling-shopify-s-bfcm-live-map-an-apache-flink-redesign-bcbe156fa7990bd0.md): Shopify Engineering · 2021-12-10 · Medium · 9 min read · Stream processing, Scaling, System design, Real-time systems
  Shopify scaled its Black Friday/Cyber Monday live sales map by putting Apache Flink in front of Cricket, its home-grown Go stateful streaming service.
- [Behind the build: 2025's BFCM globe in a pinball machine 🌎🕹️](https://swe.quest/articles/behind-the-build-2025-s-bfcm-globe-in-a-pinball-machine-31ac98f2441d854c.md): Shopify Engineering · 2025-12-03 · Medium · 16 min read · Frontend, React, Performance engineering, Games, Real-time systems
  Shopify's 2025 BFCM live globe was embedded in a browser pinball game built with three.js and react-three-fiber, streaming real merchant orders via server-sent events and reacting to sales milestones and first sales.
- [Beyond rate limits: scaling access to Codex and Sora](https://swe.quest/articles/beyond-rate-limits-scaling-access-to-codex-and-sora-f19f4998580ba788.md): OpenAI · 2026-02-13 · Medium · 6 min read · Payments & fintech, System design, Consistency models, Event-driven architecture, Distributed systems
  OpenAI replaced hard rate-limit stops for Codex and Sora with a real-time access engine that treats rate limits, free tiers, credits, promotions and enterprise entitlements as layers in a single decision waterfall evaluated per request.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
