This project is licensed under the GPLv3 (or later). See the LICENSE file for more details.
To run the project, follow these steps:
-
Make sure you have Docker and Docker Compose installed on your machine.
-
Clone the repository to your local system.
-
In the project root, run the following command to start the simulator:
docker-compose up
-
Once it's up and running, you can access the application at
http://127.0.0.1:<port>, where<port>(8084 by default) is the one specified in thedocker-compose.yamlfile.
The project was designed with simplicity in mind. Key choices include:
-
No database: Instead of a database, all data (such as teams, matches, and results) is serialized and saved to a file. This decision avoids unnecessary complexity since we’re simulating a single tournament with small data amount.
-
No frameworks: No need for frameworks, as the project doesn't require a database and do not provide an API. This keeps the project lightweight and minimizes overhead.
The code is modular and designed to be extensible. However, certain features are implemented in a basic way, with potential for further development:
-
Teams: Each team can be extended with additional characteristics to influence the match results. For now, match outcomes are generated randomly.
-
Match pairing algorithm: Currently, the algorithm supports only four teams and generates matches in a basic round-robin format. The system can be expanded to accommodate more teams and different tournament formats.
This project uses the following tools for code quality and verification:
-
PHPUnit: Used for unit testing. Run the tests with:
vendor/bin/phpunit --color
-
Psalm: A static analysis tool that ensures code quality at the highest level (Level 1). To run Psalm, use:
vendor/bin/psalm.phar
Both PHPUnit and Psalm configuration files are included in the project.