F1 Gjettespill (F1 Guessing Game) is a game where the participants guess the end results of the Formula 1 season. In addition, the participants also guess on who gets pole, first place and tenth place in each grand prix. Participants can create leagues so that friends can compete against each other. Points are calculated based on how close the guess was to the actual result. The winner for the year is the one that has the most points when the season is over. There is both a global leaderboard and a leaderboard for each league.
This is the repository for the backend code to the website. The code for the frontend is here.
Vebjørn Øiestad
- Java JDK 17
- Maven
- PostgreSQL
Can also be ran fully in Docker.
- Create a file in
/src/main/resourcesnamedsecret.properties. - Add the following information:
spring.security.oauth2.client.registration.google.client-id={id}
spring.security.oauth2.client.registration.google.client-secret={secret}
spring.datasource.username={database username}
spring.datasource.password={database password}
ntfy.user={ntfy username}
ntfy.password={ntfy password}
frontend.baseurl=http://localhost:5173 # Change as needed for frontend
You also need to set up a PostgreSQL database named f1 at port 5432. The schema is available in schema.sql.
To start the application, run the following command:
mvn spring-boot:run
Add line in secret.properties:
spring.datasource.url=jdbc:postgresql://database:5432/f1
Add lines in .env:
POSTGRES_USER={database username}
POSTGRES_PASSWORD={database password}
POSTGRES_DB=f1
Run:
docker compose up
F1 Gjettespill is in no way affiliated with Formula 1 and the trademark F1 belongs to Formula One Group.