Viscosity's Blog

World Cup Predictor App

Written by Luis Flores | Dec 2, 2022 3:38:09 PM

As the FIFA World Cup Soccer tournament was approaching, we decided to create an app to have some fun throughout the tournament. The rules were simple. Predict the exact result, and you get 3 points. Predict who wins, and you get 1.

We wanted to accomplish two goals with this little project:
 

  1. Have some fun with our coworkers with a competitive game while watching the World Cup. 
  1. Teach our new developers our APEX ways while developing a final product. Even though the app is simple, it was good practice and a teaching opportunity. 

Authentication and Users 

The first issue we came across was user management and authentication. We could have used regular APEX accounts, but they had some flaws. The most important one being we had to create each user that wanted to play, and that's no fun; nobody wants to do extra work.

We decided to go with Google accounts using the social sign-in functionality APEX has had since 18.1. Therefore, we didn't have to manage users manually. 

 

Tournament Configurations and Fixtures Data 

To get the information and data for the matches, we could have created and updated each game on our own, but it would be too much work. So, we did some quick research and found some cool APIs that could give us the information we needed. 

 

After the research, we decided to go with https://dashboard.api-football.com/ since it had a free version of 100 requests per day, and we only wanted the World Cup data.  

It was an excellent opportunity to teach our new developers how to integrate with an external API and sync the data on ours with PL/SQL.  

The final step was setting up a job to refresh the result every 15 minutes, and we solved the most challenging part.

 

 

APEX Application 

For the APEX application, we needed an admin section to configure new tournaments and see who was on each tournament. We needed to be able to fix things if we ever had any issues with our API provider (manual overwrite), and the most important part is where the end user will enter the prediction.

We also focused on being mobile-friendly since it would be an app more frequently used on mobile devices. 

 

The Dashboard 

On the design, you could be involved in several tournaments and predict each one. On the dashboard, you can see all the tournaments you are involved in and their standings. 

 

 

 

 

We needed a few additions to make it fair, so everyone could check the app and engage while watching the games and what predictions each of their co-workers added. We created a page to look at the predictions for every one of them once the match has started. 

 

 

Conclusion 

Ultimately, we accomplished two objectives: a cool game where we could have some internal competition and bragging rights. Since I am writing this, once the round of 16 is defined, we already know the US will face the Netherlands, which has given us another reason to support our favorite team.

It was a great app to teach the development cycles of an app and how you can accomplish great apps in no time with APEX. We came across issues and managed to solve them, and they realized, once we ran our pilot, what was missing and added it in time for the World Cup.

If you want to give it a try for round 16, visit https://apps.viscosityna.com/ords/bet/r/sports-pools/, and on the top right, you can read the rules and join a tournament using the code WC2022 to join the demo.