tilttek / dice-tower
A table's shared dice tower: every roll seen by everyone at the table, live and in order, with missed rolls read back from the log.
Package info
Type:symfony-bundle
pkg:composer/tilttek/dice-tower
Requires
- php: >=8.5
- ext-filter: *
- doctrine/orm: ^3.7
- phil/resource: ^0.1@dev
- psr/clock: ^1.0
- psr/log: ^3.0
- symfony/config: ^8.2
- symfony/dependency-injection: ^8.2
- symfony/http-foundation: ^8.2
- symfony/http-kernel: ^8.2
- symfony/mercure: ^0.10
- tilttek/dice: ^0.2@dev || ^0.3@dev
- tilttek/dice-bundle: ^0.2@dev
Requires (Dev)
- doctrine/dbal: ^4.5
- phil/ux-kit: ^0.5@dev
- phpunit/phpunit: ^13.4
- symfony/clock: ^8.2
- symfony/event-dispatcher: ^8.2
- symfony/framework-bundle: ^8.2
- symfony/messenger: ^8.2
- symfony/routing: ^8.2
- symfony/stimulus-bundle: ^3.7
- symfony/translation: ^8.2
- symfony/twig-bridge: ^8.2
- symfony/twig-bundle: ^8.2
- symfony/ux-twig-component: ^3.7
- symfony/yaml: ^8.2
- twig/twig: ^3.21
Suggests
- phil/ux-kit: For the Card recipe the overlay is drawn with, installed by the Symfony UX Toolkit
- symfony/mercure-bundle: For the hub each new entry is pushed to and the authorization cookie of the viewers
- symfony/messenger: To reach the relays through a message bus rather than during the roll
- symfony/routing: For the route of the entries a viewer missed
- symfony/stimulus-bundle: For the controller that adds the new entries on the page
- symfony/twig-bundle: For dice_tower() and the overlay, with symfony/ux-twig-component
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-21 03:06:09 UTC
README
A table's shared dice tower: every roll seen by everyone at the table, in order, as it falls.
tilttek/dice-tower is a Symfony bundle on tilttek/dice-bundle. A roll of the journal of the dice is dropped in a
table's tower; the tower keeps where it fell, in a log of its own, and pushes the new entry to a private Mercure topic
of the table, which only the viewers the application allows subscribe to. A viewer who was away reads what was missed
from the log, by position: nothing is kept in memory between two requests. The entries carry identifiers and the
result of the roll, never a person's name. A Twig and Stimulus overlay, drawn with the PHIL UX kit, shows the tower and
adds each new roll; relays carry each entry to other channels, through adapters of their own packages.
Status
| Part | State |
|---|---|
| The log of the towers, in Doctrine or in memory, its positions given by the database | Implemented and tested |
DiceTower: rolls dropped, entries read in order, missed entries read again, erasure of a roller |
Implemented and tested |
| The private topic of each table on a Mercure hub, and the authorization of its viewers | Implemented and tested |
| The route of the missed entries, for allowed viewers only | Implemented and tested |
dice_tower(), the overlay drawn with the PHIL UX kit and its Stimulus controller, in English and French |
Implemented and tested |
| The relays, at once or through a message bus | Implemented and tested |
Documentation
| Document | What it covers |
|---|---|
| Installation | Requirements, registering the bundle, the route, the hub and the recipes of the kit. |
| Configuration | Every key, its default and what it sets. |
| The tower in PHP | Rolling and dropping, reading the entries, the payload, privacy and long-running processes. |
| The overlay | dice_tower(), the overlay, its Stimulus controller and its events. |
| Extension points | Who may watch a table, relays to other channels, publishers, templates and translations. |
| Testing | The bundle's tests, and how to test an application that uses a tower. |
| Reference | Every type and service of the bundle. |
Quick start
composer require tilttek/dice-tower symfony/mercure-bundle php bin/console ux:install card --kit=github.com/parler-haut-interagir-librement/ux-kit
// config/bundles.php return [ Tilttek\DiceBundle\TilttekDiceBundle::class => ['all' => true], Tilttek\DiceTower\TilttekDiceTowerBundle::class => ['all' => true], ];
# config/packages/tilttek_dice_tower.yaml tilttek_dice_tower: table_access: App\Dice\TableMembers # config/routes/tilttek_dice_tower.yaml tilttek_dice_tower: resource: '@TilttekDiceTowerBundle/config/routes.php'
$tower->roll(ResourceReference::of('table', '7'), '1d20+5', ResourceReference::of('member', '42'));
{{ dice_tower('table:7', {'member:42': 'Aelis'}) }}
Requirements
PHP 8.5 or later, Symfony 8.2, tilttek/dice-bundle, Doctrine ORM for the log and a Mercure hub for the live entries;
Twig, Symfony UX and the recipes of the PHIL UX kit for the overlay.
Contributing
Contributions are welcome on the PHIL monorepo: read the contribution guide and the code of conduct. Report a vulnerability privately, as the security policy explains, never in a public issue.
License
MIT, © Philippe Gamache, doing business as Le Gnome Archiviste; a Tilttek project. See LICENSE.