https://github.com/faforever/faf-league-service
The league service of Forged Alliance Forever
https://github.com/faforever/faf-league-service
Last synced: about 1 month ago
JSON representation
The league service of Forged Alliance Forever
- Host: GitHub
- URL: https://github.com/faforever/faf-league-service
- Owner: FAForever
- License: gpl-3.0
- Created: 2020-07-04T22:46:41.000Z (about 6 years ago)
- Default Branch: develop
- Last Pushed: 2025-04-02T11:44:38.000Z (over 1 year ago)
- Last Synced: 2025-04-13T19:50:20.812Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 19.3 MB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license.txt
Awesome Lists containing this project
README
# FA Forever - League Service
This is the [Forged Alliance Forever](http://www.faforever.com/) league service. It listens to the rating update messages, as specified in the config.py file, that the [server](https://github.com/FAForever/server) publishes to RabbitMQ and uses them to calculate league scores.
You can find a visual representation of the current schema on this projects [Github page](https://faforever.github.io/faf-league-service/relationships.html).
## Installation
Install [docker](https://www.docker.com).
The following assumes the db container is called `faf-db`,
the database is called `faf-league`,
and the root password is `banana`.
Cloning [faf-stack](https://github.com/FAForever/faf-stack)
and running `scripts/init-db.sh` should set this up.
Additionally, the service needs a running RabbitMQ server, which can be started
via docker by running `scripts/local-rabbitmq.sh`.
This starts a RabbitMQ server on vhost `/faf-lobby`.
## Setting up for development
First make sure you have instances of `faf-db` and RabbitMQ running as described in the
installation section. Then install the dependencies to a virtual environment
using pipenv:
$ pipenv install --dev
If you have just set up the database for development, you will have to apply the
database migrations manually by running
$ pipenv run migrate-develop
You can now start the service:
$ pipenv run devserver
**Note** *The pipenv scripts are not meant for production deployment. For
deployment use `faf-stack`*
## Running the tests
Make sure to follow the setup steps above. Then run
$ pipenv run tests
To run the tests directly in PyCharm you need to add `--mysql_database=faf-league`
in the Additional Arguments field in the Run Configuration.
## Database migrations
Database migrations are done using [yoyo](https://ollycope.com/software/yoyo).
To migrate run `yoyo apply` from inside the `pipenv`,
see `scripts/migrate_develop.sh` for a full example.
# License
GPLv3. See the [license](license.txt) file.