| gradle | ||
| src | ||
| .gitignore | ||
| build.gradle.kts | ||
| compose.yaml | ||
| Dockerfile | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| README.md | ||
| settings.gradle.kts | ||
fitness-server
Thin sync mirror for the Fitness Android app. One endpoint (POST /sync) that accepts row
upserts from the phone and returns rows the phone hasn't seen; Flyway runs migrations on boot.
Postgres is the queryable mirror — see the training_log, personal_records, and
session_summary views.
Deploy (Coolify)
-
Create a database named
fitnessin the existing Postgres. -
New Coolify application from this repo, build via
server/Dockerfile, port 8080. -
Env vars:
Var Value DATABASE_URLjdbc:postgresql://<postgres-host>:5432/fitnessDATABASE_USERdatabase user DATABASE_PASSWORDdatabase password FITNESS_TOKENlong random string; same value goes in the app's Settings screen -
Point an nginx proxy manager host (e.g.
fitness.yourdomain) at the container, TLS on. The app's Settings screen takes the resulting base URL.
Health check: GET /health → ok (no auth).
Local dev
docker compose up -d (scratch Postgres on 5432) then ./gradlew run. Defaults in
application.yaml match the compose credentials; token defaults to dev-token.
Tests
./gradlew test — spins an embedded Postgres (Zonky), runs migrations, and exercises
push/pull, last-write-wins, and the views end to end. No docker needed.