Architecture
How the CARP components fit together, from study protocol to data upload.
CARP is split into four parts:
- a platform-independent domain model (
carp_core); - a client framework that runs studies on the phone (CARP Mobile Sensing, CAMS);
- pluggable sampling packages;
- backends that deploy studies and store data (CARP Web Services, CAWS).
Components
flowchart LR
subgraph Phone["Flutter app"]
CAMS["carp_mobile_sensing<br/>(CAMS runtime)"]
Pkgs["Sampling packages<br/>context, survey, health, audio,<br/>Apple Watch, Polar, Movesense, …"]
Core["carp_core<br/>domain model"]
Pkgs --> CAMS
CAMS --> Core
end
CAMS -- "carp_backend<br/>carp_webservices" --> CAWS[("CARP Web Services<br/>(CAWS)")]
Portal["CARP Portal"] --> CAWS
- Sampling packages, including those for wearables, plug into CAMS.
- CAMS builds on the
carp_coredomain model. - CAMS communicates with CAWS through the
carp_backendandcarp_webservicespackages. - The CARP Portal connects to CAWS.
Study lifecycle
sequenceDiagram
participant R as Researcher
participant S as CAWS
participant C as SmartPhoneClientManager
participant P as Probes
R->>S: Upload study protocol
R->>S: Invite participant (study deployment)
C->>S: tryDeployment()
S-->>C: Primary device deployment
C->>P: start() sampling
P-->>C: Measurements
C->>S: Upload data (data manager)
- The researcher uploads a study protocol to CAWS.
- The researcher invites a participant, which creates a study deployment.
- On the phone,
SmartPhoneClientManagercallstryDeployment(), and CAWS returns the primary device deployment. - The client calls
start()on its probes, which return measurements. - A data manager uploads the data to CAWS.
Next steps
CAMS software architecture
The CAMS runtime in detail.
Domain model
Protocols, devices, triggers, tasks and measures.
API reference
Generated Dart API docs on pub.dev.