GET rollful.dev/ – 200
The Rollful dice rolling interface.

OpenDice began inside OpenFray. I needed a dice engine that could parse the expressions used in tabletop games: rerolls, exploding dice, keep and drop modifiers, advantage, disadvantage, and nested formulas. It also had to produce predictable results for the game mechanics built around it.

I initially developed the engine as part of the application, then extracted it into an open-source npm package. JavaScript and TypeScript projects can now use the same parser and call a single roll() function rather than implementing each rule independently.

Rollful makes that engine available without installing a package. It provides a hosted API and a small web interface where you can enter a dice expression and inspect the result. The website also works as an interactive playground for the API because both use the same OpenDice implementation.

The two projects offer different ways into the same engine. OpenDice runs directly inside an application; Rollful can be called over the web or used from a browser. Keeping the parsing and rolling logic in one place means both interfaces support the same expressions and return results in the same format.

Notable bits

  • From OpenFray to everywhere. A dice engine extracted from a real-world application into an open source library and hosted service.
  • Supports the full language of dice. Exploding dice, rerolls, keep/drop modifiers, custom functions, and more.
  • OpenDice at its core. Rollful is powered by the exact same engine, not a separate implementation.
  • Test in the browser, integrate anywhere. One interface for humans, one API for applications.
  • Lightweight by design. No accounts required, no unnecessary complexity, just reliable dice rolling.

THE STACK

Frontend
AstroAstro StarlightTypeScriptTailwind CSSVite
Backend
OpenAPI
Hosting
Cloudflare Pages
Tools
GitHubGitHub ActionsnpmPrettier