The [C]openh[A]gen [R]esearch [P]latform (CARP) enables researchers to run digital phenotyping studies and develop mobile health (mHealth) applications where data is collected on the participant's smartphones and wearable devices. Studies are configured, study participants are managed, and data is securely uploaded and managed in a hosting infrastructure. CARP is a platform for running research studies in the health domain – also known as Digital Phenotyping. Such studies range from technical feasibility studies of novel technology to large-scale clinical studies. The platform is very versatile in terms of support for different types of health domains, both in terms of technical support and configuration. See the CARP Homepage for a description of the entire CARP platform and set of software components.
The CARP Web Services (CAWS) API provides a REST-based implementation of the CARP Core Domain Model using Spring Boot.
The architecture is a modular monolith, with loosely coupled services and endpoints separated by feature type (i.e. auth, data points, study, protocols, etc.). Shared services can be found under the common directory, and are again separated into directories by type (rather than controllers, models, views, services, factories, presenters, etc). Overall, the CARP Webservice API architecture is divided into three layers; API Gateway, Security, Services, and Persistence layer.
The above-mentioned features, namely studies, protocols, and deployments are implemented in the CARP Core library, which publishes them as packages and this project uses them as dependencies. Briefly explained, the Core library is developed using an Onion (Hexagonal) Architecture, which means that it provides the domain models and business logic, but it requires several dependencies (Database, API) to function in a real environment. These dependencies are provided by this application.
Essentially, the CARP Webservices uses a modular-monolith architecture, written in Kotlin using Spring Boot.
The project can be set up using different profiles for different environments. The following profiles are available:
The main services of the application are the following:
All of them have a dedicated package with their own controller, service, and persistence layers, however, there are differences in their management.
These services include the Studies
, Protocols
, and Deployments
packages. These are not implemented in this repository but are implemented in CARP Core.
For each subsystem, there is a service interface defined in CARP Core. This application provides web endpoints to access these services and repository implementations to be used by a core to persist and fetch data. The business logic is entirely separated from CARP Core.
On the API level, there is one POST endpoint that requires a service functionality-specific data transfer object (defined in CARP Core infrastructure libraries) and delegates it to its destination.
The project-specific services are the rest, plus additional ones, such as security and other infrastructure-specific concerns. These can be found in the 'common' package and 'security' package. These services are entirely implemented in this project, and most of them provide a RESTful API for data manipulation.
For API documentation we use Swagger.
Note: The documentation is currently only available in the development environment.
Follow these steps to deploy CAWS:
keycloak
section for nowbash deployment.sh
Carp
realm after opening <server>/admin/master/console/
, and click Create client
under the Clients
tab.Client authentication
as well as the Authorization
options on. Then fill the URL settings.manage-users
view-users
query-users
Users
add a new Admin user and assign the system-admin
role to it. This user will be used to invite the first researcher. Can be deactivated afterward.Realm settings
-> Email
configure the email settings. This is used to send out invitations to researchers/participants. The same email server can be used as the one specified in the configuration file.Realm settings
-> Themes
configure the theme settings.bash deployment.sh
dk.cachet.carp.webservices.Application
local