# Design and Implementation of Health and Risk Level Assessment for Socially Disadvantaged Patients
## 3 Platform Design and Implementation
### Server-Client Architecture for Patient-Specific Risk Assessment
For other models, we divided the ratio of training data, validation data, and test data as 7:2:1, respectively. The ratio of the data from depressed subjects and normal subjects was equalized. In terms of back-end, we exploited the Springboot-based server technique to perform dynamic web development and data management, adopting a model-view-data design pattern. The Springboot is a Spring sub-project that avoids complicated XML configuration, enabling a simpler environment configuration. Based on the Spring framework, our server architecture provides various core services such as inversion of control (IoC), dependency injection (DI), aspect-oriented programming (AOP), and java object persistence API (JPA). Figure 3 shows the overall system architecture of our platform, consisting of four components. The first component is a user-level application, which utilizes the oxygen saturation, accelerometer, gyroscope, touch screen, and sleep mode information from the smartphone to acquire sensor information time series data and transmit them to the server using HTTP communication. The second component is the server. Sensitive data such as the user's personal information and password must be secured quite thoroughly, so most applications create a web application server (WAS) to store and process data. The WAS is a server that provides dynamic content according to client requests, such as various algorithms, business logic, and DB inquiries, and sends a response for data analysis and visualization to the smartphone along with a response code. The third component is the database management system (DBMS), which is a software (MySQL version 8.0.28) that manages and operates databases. The fourth component is the Google FCM service. Firebase cloud messaging (FCM) is a cross-platform messaging solution that reliably delivers messages for free and allows you to distribute messages to your app in  
Figure 2: Information architecture for data acquisition application. three ways: single devices, groups of devices, or devices subscribed to a topic. If you create a notice in the admin page, you can receive push notifications in the user-side app. Figure 4 shows the navigation graph, which shows all navigation-related information. This graph shows all the flows that the user can proceed with in the application, and the fragments in the application can be depicted briefly. Movement in the navigation graph is performed by the navigation controller. The navigation controller is an object that the navigation host uses to manage application navigation. The navigation controller is responsible for steering the transition of target content on the navigation host as the user navigates through the app. To use the navigation controller in fragments, we imported it through the findNavController() function. The default navigation host implementation, NavHostFragment, navigates fragments as defined in the navigation graph. We specified NavHostFragment in the android:name item of XML. With this, we specified that a particular fragment is a NavHostFragment. The NavHostFragment is a container, and a fragment can be regarded as being put into a container according to the navigation graph defined by the developer. The execution of the application largely takes place according to a two-layer architecture, as depicted in Figure 5. The first layer is the foreground layer including identity, and stores sensor data by classifying users. From then on, the data collection phase continues in the background layer with the appropriate user authority. JWT, a token-based authentication system for authenticating and identifying users, is introduced. Using JWT, user data can be exchanged in a stateless environment such as RESTful. When a user attempts to log in, the server performs user authentication from the DB. If authentication is successful, an  
Figure 4: Navigation graph from login to measurement result view. Figure 3: Server architecture for patient-specific risk assessment. Access Token and Refresh Token are issued to the user.