treefmt / nix fmt (pull_request) Successful in 6s
test ebook search / test-ebook-search (pull_request) Successful in 39s
pytest / pytest (pull_request) Successful in 40s
build_systems / build-brain (pull_request) Successful in 1m0s
build_systems / build-bob (pull_request) Successful in 1m2s
build_systems / build-rhapsody-in-green (pull_request) Successful in 1m33s
build_systems / build-jeeves (pull_request) Successful in 2m25s
test ebook search / test-ebook-search (push) Successful in 35s
build_systems / build-brain (push) Successful in 37s
build_systems / build-bob (push) Successful in 37s
build_systems / build-jeeves (push) Successful in 2m17s
treefmt / nix fmt (push) Successful in 5s
pytest / pytest (push) Successful in 29s
build_systems / build-rhapsody-in-green (push) Successful in 49s
- 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
55 lines
2.0 KiB
Markdown
55 lines
2.0 KiB
Markdown
# 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
|
|
|
|
```shell
|
|
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_PATH`
|
|
- `GEMS_KEY_PATH`
|
|
- `GEMS_PUBLIC_ORIGIN`
|
|
- `GEMS_SECURE_COOKIES`
|
|
- `GEMS_HOST`
|
|
- `GEMS_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:
|
|
|
|
- `none`
|
|
- `virtual_wild`
|
|
- `copy_bonus`
|
|
- `copy_and_claim`
|
|
- `multi_bonus`
|
|
- `claim_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.
|