A suite of Spring Boot REST APIs for a Fantasy Cycling League.
Currently, our Fantasy League is a process of manually checking web pages to see who made transfers, who scored what points, and what people's current teams are. These are then shared into a WhatsApp group in the form of screenshots. This floods our camera roll.
The goal of this suite of tools is to create a few APIs that can send formatted text, or screenshots, into a WhatsApp Group at the call of a REST Endpoint.
- Get Transfers
- Get League Standings Including Today's scores.
- Get Current Teams
There are a horrid amount of Strings inside the Application. These need to be changed to POJOs, or possibly Java 17 Records. This is a pending action.
Since Chrome version 115 (late-July 2023), there is a new Browser, "Chrome for Testing", that the July 2023 releases of Selenium and WebDriverManager look for.
This can be downloaded via Puppet, or from the Website Chrome for Testing Releases.
On MacOS, you should try to open the newly downloaded Chrome for Testing, to ensure that the security will allow it to be opened. If you are presented with a Security Message, not allowing it to be run, open System Settings -> Privacy and Security -> Open Anyway. You will also be presented with a message asking you to Sign In to Chromium, which you can dismiss.
You can set the version of Chrome for Testing that you have downloaded, in the
src/main/resources/application.properties
file. The version.chromefortesting
property takes a string.
You can run this in your Terminal by editing the setEnvironmentalVariables.sh
or setEnvironmentalVariables.bat
files to set the three Environmental Variables to your values.
Be wary not to commit the updated file to a public Git Repo. Consider adding it to the .gitignore
file.
As this project uses Spring Boot 3, you need Java 17 to run it.
This project uses port 8080 by default, so ensure that it's free when you're trying to run it.
Then executing
source setEnvironmentalVariables.sh
./gradlew build bootRun
or with Docker:
docker build --pull -t fantasy-cycling-tools:latest .
docker run --name fantasy_cycling \
-p 8080:8080 \
--env=ROADCC_USERNAME='yourUsername' \
--env=ROADCC_PASSWORD='yourPassword' \
--env=ROADCC_LEAGUE_NAME='Your League Name' \
-d --rm fantasy-cycling-tools:latest
You can run this in your IDE by adding the Environment Variables to your Run Configurations.
IS_FANTASY_CYCLING_TOOLS_ON_DOCKER = false
ROADCC_USERNAME = yourUsername
ROADCC_PASSWORD = yourPassword
ROADCC_LEAGUE_NAME = Your League Name
Heroku is supported. Render is a Work in Progress. The Environment Variables are supplied in the relevant Config Files.
PostMan Collection: JSON Format.
Swagger UI is Enabled: Localhost.