Leonardo Bonalumi
All work
  • LLM
  • Tooling

Word Game Calendar Builder

Three words a day, forever, never repeating, and themed for special dates. A five-step wizard turns a dictionary into a publishable calendar — with the LLM bill shown live while it runs.

Role
Backend, frontend, and the LLM extraction
Context
RCS MediaGroup
Period
2026
Stack
  • Python
  • FastAPI
  • React
  • Vite
  • Tailwind
  • Gemini
  • Vertex AI
  • Object storage
  • Excel export
  1. Dictionary tens of thousands of words
  2. Candidates grammatical filters, or themed via LLM
  3. Playability rules inflections, accents, cooldown
  4. Calendar draft regenerate a single day
  5. Confirm writes the publication history
Confirmation is the only step that writes history, which is what turns the no-repeat rule from a hope into a guarantee.

Objective

A daily word game publishes three words every day. They must be playable, never previously used, and occasionally themed — a word set for a sporting event, a holiday, a launch. Building that by hand is tedious in a way that guarantees mistakes, and the expensive mistake is repeating a word players have already seen.

Approach

Five steps, each one leaving something durable behind: load the dictionary, extract candidates, validate them, generate the calendar, export and confirm.

Extraction has two modes. Random with grammatical filters covers the everyday need. Themed extraction asks an LLM for words fitting a brief, which is the mode that earns its keep — and the one that costs money, so the UI shows running cost live and lets an editor stop the job while keeping whatever has already been produced. Showing the bill while it accrues changes behaviour more than any warning in a footer.

The no-repeat guarantee is global and checked against the full publication history, not just the current draft. Themed days draw only from their own themed pool. Individual calendar cells can be regenerated one at a time, because the failure mode in practice is not “the calendar is wrong” but “that one word is unfortunate on that one day”.

Playability turned out to need real rules: inflected forms of a recently used stem are blocked for a long window, and words with accents are excluded because of how the game input works. Those rules are verifiable offline, so they are tested without a browser.

Architecture

Shared state in object storage with generation-matched writes and retry, so several editors can work at once: the candidate queue, the approved pool, discarded words, the publication history, the theme registry, the current draft and the cumulative token accounting are each a file. Confirmation is the only step that writes to history, and it is what makes the no-repeat constraint hold.

What I owned

Backend, LLM extraction with cost accounting, the React wizard, the rule engine and its offline tests, and the Excel export the newsroom actually publishes from.

Outcome

Calendar preparation went from a manual spreadsheet exercise to a wizard the newsroom runs itself, with a repeat now structurally impossible rather than merely unlikely.