"Gambling is illegal at Bushwood sir, and I never slice." ―Judge Smails
Scorecard is a score keeping API service for golf. Scorecard is able to provide live scoring updates for tournaments, as well as individual rounds of golf, and can support any number of players playing any format of golf.
I haven't written a proper Postman collection to document the API, but in the meantime I've listed and partially described the available endpoints below.
- Get the list of players
- Create a new player
- Players need to be issued a JWT with a corresponding email address if they want to log in to update their scores
- Get a specific player
- Update an existing player
- Delete a specific player
- Get the list of tournaments
- Create a new tournament
- Get a specific tournament
- Update an existing tournament
- Get the list of tournament organizers
- Tournament organizers have admin privileges to the tournament
- Organizers are just players
- Add organizers to the tournament
- Remove organizers from the tournament
- Get a list of teams playing in the tournament
- Add a new team to the tournament
- Remove the team from the tournament and delete it
- Get the list of players on the particular team
- Add new players to the team
- Remove players from the team
- Get the list of rounds in the tournament
- Add a new round to the tournament
- Get a specific round from the tournament
- Remove and delete a specific round from the tournament
- Get a list of tee times for the tournament round
- Add a new tee time to the tournament round
- Get the details for a specific tee time including match results
- Delete the tee time
- Get the list of players assigned to the tee time
- Assign players to the tee time
- Unassign players from the tee time
- Get the player's score
- Record a new score for the player for the round
- Delete a score for the player for the round
Scorecard runs in its own docker container and uses a postgres database. Before spinning up the containers there are a few environment variables that need to be defined in an env/dev.env file. There is a sample .env file in the root of the repository that contains all the required variables.
In order to authenticate with Scorecard, users will have to have a valid JWT issued to their email address. This token will be used to determine the level of access the user should be granted based on the roles and permissions the user has assigned to their token. In order to verify the validity of the tokens Scorecard receives, the public key of the public/private key pair used to sign the tokens must be added to the /keys directory. This will allow Scorecard to verify that the data contained in the token is authentic.
Once that is setup, the environment can be spun up by running docker-compose up -d
.
MIT © Travis Bale