30 Days of Code — Day 7

Simple TTRPG Dice Roller

Jordan Fox
4 min readMay 21, 2024

Hello and welcome back! Yesterday we finished up the basic MVP. The dice roller application can now take a string input of dice notation, parse it, and roll it for the user. It also displays the results of the rolls on a cute little card.

While this is cool, and basically achieves what we wanted, I think it can be better. Today I want to spend a bit of time planning the next steps. I’ve made a list of some of the features I want to include moving forward:

Two big ones I’ve mentioned are a roll history and saved/named rolls. Saving rolls is going to require some kind of user profile which is a lot more complexity than I initially wanted to add, but I can’t think of any other way to reasonably do this. A roll history can be saved to the browser/local storage which might be a solution for saved rolls, but it would be much more annoying to lose your saves if the cache is cleared than it would be to lose your roll history.

I also added Favicon to the To-Do list. It’s not incredibly important, but it is something we want to remember to do, and eventually I would like to add some dice roll animation similar to the one used in D&D Beyond.

This feature would be nice to have, but it’s going to require working with 3D objects and physics, so I’m going to leave it to the end.

Security and Reliability

So far we’ve been focused on features, but it’s also important that we take a moment to think about the security of the application. Since we decided to use an API to roll the dice, we will want to make sure to limit the number of times a call to the API can be made. Without a limit, a malicious user could make millions of calls to our backend and drive up our costs. This is also a good reason to set a budget in Vercel and automatically stop the service when the budget is reached.

Since we’re going to be allowing for user creation, we’ll also need to make sure we’re safely handling the user data. Most likely we won’t store any real user data as this application doesn’t have a use for it and I don’t want to be responsible for user data, but we still want it to be a consideration. We’ll also need to be sure to create a privacy policy and and include one of those lovely GDPR cookie notifications.

Monetization

We’re a long way from this being important, but it’s something to consider, especially because there’s a potential for the application to rack up charges on Vercel. There are a few things we can do to monetize the dice roller.

  1. Ad placement
  2. Add the API to RapidAPI and charge for use.
  3. Use the API to create a Discord service that server owners can pay to add to their servers
  4. Patreon/Ko-fi links

I’ll be the first to admit, no one likes any of these things. They’re incredibly annoying to deal with as a user, but the reality is they are necessary if we want people to continue creating cool things to use online. We’ll look at ways we can monetize this application without it being too intrusive.

Accessibility

Last but certainly not least, accessibility. We need to make sure the application is accessible for all users. We’re going to use some tools for measuring accessibility, and make sure we’re following best practices wherever we can.

I think this is a a good start. There’s definitely more we can do in the future, but I think we’ll be in a good place once we’ve completed these additional steps. Please let me know what you think down below. I love reading feedback. Thanks for reading!

--

--

Jordan Fox

Chicago with my husband. Father of one (dog). Passionate about technology. Occasionally political. Working on my mental health, my family, and my career.