NBA Players Data App

Find Out More!

NOTE - This webpage is only preview
to the source code on Github!

This webpage contain basic information about the application I built, for full information, including project diagram, endpoints, etc, please click here!

What is the purpose of this application?

The main purpose of this program is to use information that derived from external API. The data will be imported to a local cache memory (including scheduler that pulls the details every 15 minutes and update the persistent caching if necessary).

What information does the external API contain?

Balldontlie’s API is used to acquire information about NBA Players and their teams.

How it works?

I created Spring MVC application that contains 2 Entities: Player and Team.
The program uses a local CSV file that contains 9 rows with each row representing an NBA player.
A scheduler runs every 15 minutes, parse and process the local CSV file(players.csv) line by line, pull additional information about each player from the external API, and add it into the database that serve here as a local cache memory system (the caching based on the player id).

For caching data, I used Spring Hibernate JPA + SQL.
For scheduling every 15 minutes, I used Spring Scheduling.
To receive the data that was located in the cache memory – I used the Spring MVC Layers Controller, Service and Repository.

I worked on this project at the beginning of my studies, it is not ideal, and isn't
BEST PRACTICE regarding the concept of two-way interactive communication session between the user's browser and a server.


The main goal here was to play with different options for bringing and returning data from an external source.

Okay! Let's move on!

EXTRA

Making FUN with CSV Parsing & Web Socket

1st EXTRA

After I finished working on the main purpose of this project, I thought it will be FUN to play a bit with the local CSV file, pull the data from the External API, and return it back to the user in 3 different ways as detailed below.
• For full information, including specific endpoints for each one of those approaches, please click here - README.md.

2nd EXTRA

I’m not a big pro at WebSocket but added this cool feature the program.
In this part – the data will return a Json Object and will contain full information about all the players.
I added few extra java files to support this section + config class + html & JS for simple UI.
• For full information, including specific endpoints for each one of those approaches, please click here - README.md.

1st approach

Parse CSV file and return the data in a new CSV file

2nd approach

Parse CSV file and return the data as a Java Object

3rd approach

Parse CSV file and return the data as a Json Object

4th approach

Parse CSV file and return the data as a Json Object with WebSocket


See Application Diagram

The buttons below are impossible to resist...

Click to the full info on README.md Click to the source code of this app