Skip to content

marceljuenemann/schach.world

Repository files navigation

♟️ schach.world

schach.world is a suite of web applications for organizing chess tournaments and leagues. Features include:

League manager (live examples here and here)

  • Since 2006 over 25,000 matches with more than 150,000 games have been managed through this system
  • Team managers can enter match results themselves. They receive a link a few days before the match without the need for setting up an account
  • Mobile-friendly UI with team, player and divison statistics
  • Exports to PDF and SWI (for rating calculations)
  • Teams can register online at the beginning of the season
  • Many admin functions including optimization of the league schedule

Tournament registration (live examples here)

  • Generic and customizable registration system for any chess tournament
  • Support for multiple groups with configurable age and rating constraints
  • Integration with the player database of the German Chess Federation ("DWZ Datenbank")
  • Extensive admin functions including managing a "waiting list" when seats are limited
  • Export to CSV and Swiss Chess

Tournament results (live examples here and here)

  • Easy upload of TXT files generated by Swiss Chess
  • Support for multiple groups with player and club statistics

WordPress integreation (live example here)

  • Use standard WordPress for news and static pages
  • User management via WordPress

Technical Overview

schach.world uses Symfony for dynamic pages and WordPress for CMS and user management. There is also some very old code in the league manager that was written 20 years ago, so this life of a request might help you navigate the codebase:

  1. All requests first go through public/.htaccess. If the path matches a (static) file in the public directory, that file is served directly.
  2. Otherwise the request is forwarded to WordPress in public/wordpress. WordPress pages including the frontpage will simply be rendered by WordPress with the nsv-2020 theme.
    1. Note that the theme uses public/core/nsv2020 under the hood, which can also be utilized by non-WordPress scripts.
    2. The theme can also be extended to allow customization for other organizations, see bezirk2020 for an example
  3. Some legacy dynamic pages are served by WordPress plugins like nsv-turniere (tournament results), nsv-archiv, nsv-misc or nsv-core.
  4. The nsv-v3 plugin keeps an allowlist of paths that are forwarded to the Symfony application (located in the root directory of this repository).
  5. Most of the Symfony application conforms to standard and modern Symfony best practices, with these notable exceptions:
    1. The code under src/WebApp/Core/WordPress offers the ability to call back into WordPress for rendering the theme as well as for user management functionality.
    2. Any league manager code that has not been migrated to Symfony yet (see issue #53) will go through the LegacyController, which calls back into the legacy system located under public/ligen. Note that the entire legacy system also outputs using an ISO charset rather than Unicode for now.

Local Development

Initial Setup

We have a docker based development environment that runs Apache, MySQL and PhpMyAdmin for you. Follow these instructions for setup.

Docker Usage

  • Start containers: docker compose up -d in the dev directory
  • Stop containers: docker compose down
  • SSH into webserver: docker exec -it nsv-webserver /bin/bash. This allows you to run composer and symfony commands without having PHP installed. Even if you have PHP installed on the host, this ensures you run PHP with the same version as the webserver.

Composer & Symfony Usage

Some useful commands for Symfony development:

  • Update dependencies: composer update
  • Clear cache: ./bin/console cache:clear. This should only be needed if the enviornment is set to PROD.

Running tests

If you're using the docker setup, it's easiest to use dev/script/run-tests.sh. This runs ./bin/phpunit in the webserver docker container. It also updates the snapshot tests.

Updating test snapshots

Many of the tests run against the actual database docker container and the league manager test cases make extensive use of the anonymized production database dump in order to have meaningful tests. In addition, snapshot tests are used for large test coverage with minimal test setup. If you expect snapshots to change, run tests with

./bin/phpunit -d --update-snapshots

and check that the snapshot changes are expected before opening a pull request.

Test coverage

You can generate a test coverage report with

XDEBUG_MODE=coverage ./bin/phpunit --coverage-html var/coverage

This is also generated as part of the GitHub workflow.

Angular Development

The more interactive components of the frontend are gradually being rewritten in Angular. See ng for instructions.

React Development

A few components were written in React before I decided to move to Angular. You can find the code and instructions for those in the javascript folder.

Migrations

The most recent DB changes should be applied using Doctrine migrations with the following command:

./bin/console doctrine:migrations:migrate --em main

TODO: Add to CI.

License

Copyright (C) 2006-2026 Marcel Juenemann

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

About

Web Applications for organizing chess tournaments and leagues

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages