The task is to create a JavaScript library that displays 5-star ratings received from the Google Places API. A key feature of this project is the design of an API that controls the number of calls made to the Google API by storing the received information and updating it weekly. The API also allows the creation of a custom 5-star rating system, called BridgetPro Stars, for clients who do not have a Google account or for countries where Google is not as popular or encouraged.
The first part of the application, and the most important, is the WordPress server that acts as the API. The choice of the WordPress framework was made to integrate with the company’s hosting service, which specializes in WordPress applications. One advantage of WordPress is that it already provides a functional database and a ready-to-use API. I developed a WordPress plugin to add the missing logic. This includes new routes for making API calls, querying the Google Places API, and creating custom tables in the database based on the application’s needs. The application stores the information received from Google in the database for one week before updating it. If the data is still up to date, the API returns the stored information. The API is also responsible for managing the security of the calls by verifying the origin of the received requests.
On the other side, there is the JavaScript application that makes calls to the BridgetPro API and displays the information in a nice 5-star interface, also showing the number of ratings received.