- implement FastAPI and HTMX lobby and game interfaces - support up to four human and AI-controlled players - add configurable rules, victory conditions, and expansion modules - support validated JSON cards, patrons, objectives, and outposts
2.0 KiB
Gems
Gems is a server-rendered, turn-based resource-engine game for one to four human or AI players. It uses FastAPI, Jinja, HTMX, server-sent events, and SQLite.
The application deliberately contains no playable card deck, patron/governor set, objective set, official artwork, or copied rulebook text. A room host must upload a content pack they are entitled to use before starting a game.
Run locally
uv run gems --host 127.0.0.1 --port 8082
The default database and installation key are created under .gems/. The following environment variables override
runtime behavior:
GEMS_DATABASE_PATHGEMS_KEY_PATHGEMS_PUBLIC_ORIGINGEMS_SECURE_COOKIESGEMS_HOSTGEMS_PORT
Content packs
The current schema is available from a running server at /schemas/content-pack-v1.json. A pack defines exactly
five normal resources, one wild resource, cards, and optional patrons, objectives, and outposts. patrons is the
canonical field name; governors is accepted as an input alias.
Cards may use only the built-in, bounded effect vocabulary:
nonevirtual_wildcopy_bonuscopy_and_claimmulti_bonusclaim_free- an optional discard-cards alternate cost
Unknown fields, resource references, executable expressions, HTML, artwork URLs, and files larger than 512 KiB are rejected. The normalized pack is private to its room and becomes immutable when play starts.
Neutral module mapping
Gems calls the four optional mechanics Objectives, Outposts, Eastern Decks, and Fortifications. Lobby presets combine these mechanics into the familiar base, objective-race, objective-plus-outpost, eastern-plus-fortification, and all-module configurations. Component identities and values always come from the uploaded pack.
Jeeves
The NixOS module runs one Uvicorn worker on 127.0.0.1:8002, stores state in
/zfs/media/services/gems, and publishes it through HAProxy at https://gems.tmmworkshop.com. The DNS record must
point to Jeeves before ACME can issue the certificate.