Installation
tilttek/leaderboards-bundleRequirements
- PHP 8.5 or later, Symfony 8.2, Doctrine DBAL 4.5 and
doctrine/doctrine-bundle. tilttek/activity-bundle, to keep the journal of activity the projection reads.- Optional:
doctrine/orm(the tables in the generated schema),symfony/console(the commands),symfony/twig-bundleandsymfony/translation(the templates),symfony/ux-twig-componentand the recipesCard,BadgeandEmptyof a UX Toolkit kit (the league screen and the ranking of teams), the recipeCelebrationof the PHIL UX kit 0.5.0-alpha or later (the celebration of the top),symfony/scheduler(the schedule),symfony/cachewith the redis extension, Relay or Predis (the scores in Valkey from a DSN) — or the application's own client, valkey-glide-php included —,phil/privacy-bundle(export and erasure).
Installing
composer require tilttek/leaderboards-bundle tilttek/activity-bundle
Register both bundles, configure the boards (Configuration), then let the ORM see the tables:
bin/console doctrine:migrations:diff
bin/console doctrine:migrations:migrate
The projection, named leaderboards, is found by tilttek/activity-bundle by its tag: it follows the journal live,
tilttek:activity:catch-up leaderboards catches it up, and tilttek:activity:rebuild leaderboards --since=… replays a
period after a board changes. Enable the schedule, or run tilttek:leaderboards:snapshot, tilttek:leaderboards:settle
and tilttek:leaderboards:slide from a cron, to freeze the periods that ended, settle the weeks of the leagues and
slide the windows (Scheduling).
For the league screen, install the recipes of the kit (Templates):
bin/console ux:install card badge empty --kit=github.com/parler-haut-interagir-librement/ux-kit