## 2 Materials and Methods  
### System Architecture  
The AGAPE platform is specifically developed to effortlessly combine wearable technology, user involvement, and physical activity tracking to offer a holistic solution for promoting an active and healthy ageing process. The technological architecture of our system is depicted in Figure 1, which highlights the key components and their interconnections. The AGAPE Platform incorporates two primary stakeholders, namely:  
1. Onder Adults: The platform is specifically designed to be used by all adults who are older than 65 years [10]. Due to the main objectives of this experimentation (feasibility of home-based use of the solution and usability testing), requiring a most objective feedback from testers, the participants were recruited from able-bodied people, with no severe physical- or cognitive-related disability nor presenting severe mood disorders.
2. Formal Caregiver: They are caregivers who have undergone specific training and certification to provide professional care services to those who require assistance [11]. They work in various healthcare settings, such as hospitals, nursing homes, and assisted living facilities.  
The AGAPE platform comprises the AGAPE Assistant mHealth solution for OAs. This mobile application serves as an IoT hub for all the wearables that were deployed to OAs. The AGAPE Assistant uses the smartphone's Bluetooth to connect and retrieve the data from the wearable. The application is developed in Flutter and can be deployed on iOS and Android. The application employs a modular design pattern for the IoT Hub (BLoC [12]). The AGAPE Assistant is capable of integrating various sensors from different vendors and can seamlessly incorporate third-party Software Development Kits (SDKs).  
For instance, the application has the capability to connect to IMU sensors from two suppliers and two types of fitness bands from two different manufacturers.  
To facilitate the integration of new sensors, the AGAPE Assistant analyses the raw data from the accelerometer, gyroscope and magnetometer. Hence, the analysis of these data is independent of the sensors' supplier. To calculate the OA's steps, we implemented the established Peak detection technique [13]. The pseudo-code for this algorithm is defined in Algorithm 1. The algorithm is flexible enough to adapt to different sensors based on the accuracy, sampling rate and position where these sensors are placed on the OA. For instance, when an IMU sampling at 50 Hz is positioned on the ankle, the filter index is configured to a value of 0.9, and the time interval between each step is established at 450 ms. The step count is used to compute the OA's PA level on a daily basis. These data are then transmitted to the backend system for storage in a timeseries database (InfluxDB).  
Figure 1: AGAPE Technical Architecture.  
The AGAPE platform includes the AGAPE Monitor web application, which is specifically created for formal caregivers. The AGAPE Monitor functions as a Content Management System (CMS) that enables the formal carer to provide technological interventions to OAs. AGAPE Monitor and AGAPE Assistant offer text and message service that are interconnected. This service utilises the open-source Matrix Server, which simplifies the deployment of secure messaging services (end-to-end encryption). In addition, the Matrix Server employs end-to-end encryption to ensure the privacy of every user. The user authentication within the AGAPE platform is overseen by the Keycloak authentication server. Utilizing a unified authentication server enables a cohesive authentication process across multiple apps. The NodeJS backend integrates these data into a SQL relational database for organised storage and a decision support engine for OA profiling.