This webpage contain basic information about the application I built, for full information, including project diagram, endpoints, etc, please click here!
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).
Balldontlie’s API is used to acquire information about NBA Players and their teams.
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.
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.
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.
Parse CSV file and return the data in a new CSV file
Parse CSV file and return the data as a Java Object
Parse CSV file and return the data as a Json Object
Parse CSV file and return the data as a Json Object with WebSocket