Roll for Discount
A shop where customers roll dice for their discount. Buy more, unlock a bigger die. Get a win-back email and you might roll with advantage — twice, keep the better one. It is a loyalty program wearing a costume, and the costume is the point.
- Role
- Sole author
- Status
- Prototype, pre-launch
- Scale
- 83 commits
- Built
- 2026
What it does
- A widget embeds in the storefront theme and offers the customer a roll.
- Purchase history unlocks bigger dice — a returning customer rolls a die with better faces. The ladder is a loyalty tier that feels like a reward rather than a policy.
- Win-back campaigns send an expiring "roll with advantage" link: roll twice, keep the higher result.
- The merchant admin shows the expected value of each die — "this one averages twelve percent" — so a shop owner can price the promotion instead of guessing at it.
- Discount codes are minted on the win and attributed back when the order lands.
Pick a style and throw the dice.
The same controls the merchant admin has. Every die style below is one the app actually ships.
Honest caveat: this demo rolls in your browser, because this page is a static file with no server behind it. In the actual app the opposite is true — the roll is generated server-side and the animation is handed the answer. The engine below is the same one the storefront uses, which is exactly why it can be told which face to land on.
What it looks like




The decision worth explaining
The entire feature is a random number attached to money, delivered inside a web page the customer fully controls. Anything decided in the browser can be edited in the browser.
The client never rolls.
Every roll is generated server-side with a cryptographic random source. The tumbling 3D dice in the storefront are pure theater — the physics animation is handed the result and told to land on it.
The customer sees chance. The server saw a decision. Cooldowns, tier eligibility and advantage tokens are all enforced in the same place, so the only thing a determined person can tamper with is an animation that has already been told the answer.
The unglamorous part I did anyway
The app implements the platform's privacy compliance webhooks — the endpoints that handle a customer's request for their data, a request to erase it, and a shop's own deletion. It is regulatory plumbing with no visible payoff, nobody demos it, and leaving it out is the normal shortcut for a side project.
I mention it because handling data-subject requests properly is not optional in public-sector work either, and the willingness to build the boring compliance path is more predictive than the willingness to build the fun part.
Why it is on this page at all
Honestly? Because it is fun. It is the only thing here that made people laugh when I showed them. But the two things underneath it — never trust the client with the outcome, and do the compliance work nobody sees — are the same instincts I would bring to a system where the stakes are real rather than a discount on a comic book.
Honest limits
- No automated tests. The riskiest logic is server-side and reviewed by hand, which is not the same thing and I know it.
- It is pre-launch. It runs, it has a readiness audit and a launch plan, and it has not gone through the platform's app review.
- It is built on the platform's application template, so some of the scaffolding is theirs rather than mine.
Seeing the code
The repository is private. If you are evaluating me and want to read the code or walk through the architecture, ask me and I will arrange read access or a screen share.