CARP Gardener collects wearable activity and health data from third-party services and optionally transforms the payloads before publishing them. The repository contains the reusable framework plus a ready-to-run CARP-oriented service.
gardener-core(:core): framework for OAuth-based authorization, data collection, and transformer registration. See docs/core_readme.md for architecture and extension points.gardener-caws-implementation(:caws-implementation): Ktor service that wires the core to PostgreSQL, RabbitMQ, and CARP payload transformers. See docs/impl_readme.md for deployment details and docs/ktor-routing.md for HTTP endpoints.
- Fitbit (OAuth2)
- Garmin (OAuth1)
- Withings (OAuth2)
- Dexcom (OAuth2)
- JDK 21 (the Gradle wrapper configures toolchains automatically).
- Docker + Docker Compose if you want to run the service in a container.
- The carp-webservices stack running: Gardener shares its PostgreSQL and RabbitMQ (containers
carp-postgres-<profile>andcarp-rabbitmq-<profile>on networkcarp-<profile>). - OAuth credentials for the vendors you plan to enable (fill them into
gardener-caws-implementation/.env).
Run the Gradle wrapper from the repository root:
./gradlew build # builds everything and runs tests
./gradlew :core:test # framework-only tests
./gradlew :caws-implementation:test
-
With Docker Compose
- Create
gardener-caws-implementation/.env(gitignored) with your secrets. Config keys map to variables by upper-casing and replacing.with__, e.g.fitbit.client.id→FITBIT__CLIENT__ID. - Start the stack:
docker compose -f gardener-caws-implementation/docker/docker-compose.yml --env-file gardener-caws-implementation/.env up --build
This starts the service on port8444. It connects to the shared PostgreSQL and RabbitMQ of the carp-webservices stack, which must already be running;POSTGRES_DB,POSTGRES_USER,POSTGRES_PASSWORD,RABBITMQ_USERandRABBITMQ_PASSWORDin.envselect the database and credentials (defaultsgardenerandadmin/admin). Gardener's tables, exchange and queue are created on first start if missing.
- Create
-
Locally with Gradle
Ensure the carp-webservices stack is running (its PostgreSQL and RabbitMQ are published onlocalhost). Keep the.envfile ingardener-caws-implementation/for overrides. Then run:
cd gardener-caws-implementation && profile=local ../gradlew :caws-implementation:run
Configuration is loaded fromconf/config-<profile>.jsonwith environment variables (or.env) overriding the defaults.
- docs/core_readme.md – core framework architecture and extension hooks.
- docs/impl_readme.md – deployment architecture and RabbitMQ consumer helper.
- docs/ktor-routing.md – HTTP endpoints exposed by the CARP implementation.
- gardener-caws-implementation/src/main/resources/db/postgres-schema.sql – database schema, applied automatically on startup.
MIT License. See LICENSE for details.
