No description
Find a file
2026-08-08 23:39:02 -04:00
gradle init 2026-08-08 23:38:35 -04:00
src init 2026-08-08 23:38:35 -04:00
.gitignore init again 2026-08-08 23:39:02 -04:00
build.gradle.kts init 2026-08-08 23:38:35 -04:00
compose.yaml init 2026-08-08 23:38:35 -04:00
Dockerfile init 2026-08-08 23:38:35 -04:00
gradle.properties init 2026-08-08 23:38:35 -04:00
gradlew init 2026-08-08 23:38:35 -04:00
gradlew.bat init 2026-08-08 23:38:35 -04:00
README.md init 2026-08-08 23:38:35 -04:00
settings.gradle.kts init 2026-08-08 23:38:35 -04:00

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)

  1. Create a database named fitness in the existing Postgres.

  2. New Coolify application from this repo, build via server/Dockerfile, port 8080.

  3. Env vars:

    Var Value
    DATABASE_URL jdbc:postgresql://<postgres-host>:5432/fitness
    DATABASE_USER database user
    DATABASE_PASSWORD database password
    FITNESS_TOKEN long random string; same value goes in the app's Settings screen
  4. 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 /healthok (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.