3 minutes
Scrabble Word Checker
Anyone who’s played Scrabble or Quiddler with friends knows the inevitable debate: “Is that really a word?” We’d pull out our phones to check online dictionaries, only to find they’re overly permissive and accept nearly anything. What we needed was a definitive source of truth for word games. So I decided to build my own word validator - with blackjack and hookers.
The site: https://tituslesley89.github.io/scrabble-word-checker/
Introduction
While I’d worked extensively with AWS using internal tools in my professional career, I had never experienced it from a customer’s perspective. This project seemed like the perfect opportunity to explore AWS services as an end user. The experience had its rough edges, but overall it proved to be a valuable learning exercise in architecting serverless applications.
Design Considerations
The app needed to be accessible and cost-effective. No one wants to download yet another app for something they’ll use occasionally during game night, so a simple website was the obvious choice. More importantly, since the application would only be used sporadically during actual game sessions, I needed an architecture that wouldn’t incur costs during idle periods. This led me to choose AWS Lambda for compute and S3 for storage - both services that scale to zero when not in use.
One interesting challenge was handling the subjective nature of word validity. It’s impossible to create a definitive list of all valid and invalid words, especially when different word games have different rules. To address this, I built a flexible system where I could mark or unmark specific words or entire word categories as valid or invalid, giving me control over the validation logic as edge cases emerged.
Major Challenges
S3 as a Data Store: Using S3 as a database replacement proved trickier than expected. While not particularly difficult, I couldn’t find a simple wrapper library that would cleanly abstract away the reading and writing operations. I ended up implementing my own lightweight abstraction layer to handle data persistence.
Parsing Merriam-Webster Responses: This was the most cumbersome part of the project. The JSON response structure from the Merriam-Webster API is unintuitive, and their documentation leaves much to be desired - enum lists aren’t exhaustive, and many fields are optional without clear documentation. I had to write defensive code to handle numerous edge cases where expected fields simply didn’t exist in the response.
Word Validation Logic: What sounds like a straightforward task - “is this word valid?” - turned out to be surprisingly complex. A single word can have multiple definitions, each belonging to different grammatical categories. Combined with the ability to mark certain categories or specific words as invalid, the validation logic required careful consideration to handle all the permutations correctly.
Outcome
The site exceeded my expectations in both functionality and cost efficiency. Hosting costs literally nothing thanks to GitHub Pages, and during the development month when I was actively testing against AWS services, I spent a whopping $0.05. When my friends actually use the app during game sessions, it costs mere pennies per session. Mission accomplished - a definitive word checker that settles our Scrabble debates without breaking the bank.
516 Words
2022-07-20 17:00 -0700