## 3 Materials and Methods
### Web Ecosystem Design and Proof of Concept Implementation
#### 3.2.3 Web Platform  
Figure 7 presents the architecture of the implemented web platform, where we can observe three central modules with different functions. First, it contains a module in charge of data formatting, used to send and receive data in JSON format, since the data exchanged between the smartphone and the server have been coded in JSON format due to its broad usage and compatibility with most programming languages. It is also worthy to note that the JSON data have been encrypted and transmitted by HTTPS. This web platform has a second module to communicate with external services to acquire weather and pollution environmental data, masking the particularities of each service. Additionally, it has been developed, considering the possible addition of new services and data types in the future. Additionally, the web platform has a module focused on the communication with the database, allowing modular and transparent management of the data, permitting its storage and consultation. Finally, there is a module in charge of executing predictions based on machine learning models previously trained. This module encapsulates the complexity of performing the prediction and managing the results of multiple ML algorithms. This element of the SENIOR ecosystem has been implemented using Flask [20], following a REST architecture. This web platform presents several REST endpoints to operate with the smartphone:  
* /register: the web platform receives the data introduced by the user in the smartphone and sent by the application. It must verify that the user does not exist, creating a new database for the user. The users' password is represented in SHA512 to prevent its transmission and storage in plain text. * /login: it receives the identification of the user. The web platform must access the database to verify that the username and password match the data already registered in the platform. If the user exists, the platform sends the profile data to the application. * /device: this endpoint receives the data concerning new measurements acquired by the wearable and stores them into the user's database. * /weather: it obtains the location and city in which the user currently is. The platform then emits a query to the external services and stores the response in the general  
Figure 7: Elements integrating the implemented web platform. database containing weather and pollution data. Additionally, it must also update the user's database with a new entry to link these data with the environmental status. These particular implementation aspects are explained in Management of the Database System Section. * /surveys: this endpoint acquires the results of the surveys completed by the user, updating the user's database. * /predict: it receives data concerning the patient's current status evaluated from the different dimensions considered in the present study. These data are provided to the ML models previously trained to predict future blood pressure values using multiple ML algorithms. The platform returns a real-time prediction followed by near-future predictions for the next 8, 16, and 24 h.  
Apart from these three modules, the platform includes three additional components, presented in subsequent sections. The first one is in charge of acquiring environmental data from external services, while the second communicates with the database system to store and retrieve data. Finally, the third component consists of the prediction of blood pressure values using ML algorithms. Communication with External Services  
Focusing on these external services, we used OpenWeatherMap [21] as the provider of weather data, a service allowing 60 requests per minute in its free plan, enough for our scenario. Regarding the acquisition of pollution data, we used The World Air Quality service [22], which provides information about the air quality worldwide. We opted to unify these queries from the webserver instead of the smartphone application due to privacy concerns.