Arwen starts PostgreSQL, runs Flyway migrations, and prints an initial Legolas pairing QR code to the console. Feature modules are disabled unless explicitly enabled.
For repeated local runs, copy .env.example to .env and replace the example address. Docker Compose loads this ignored machine-local file automatically.
For an Android emulator, enable location ingestion and use the emulator host address:
ROOT_MODULES_LOCATION_ENABLED=true \
ARWEN_PUBLIC_URL=http://10.0.2.2:8080 \
docker compose up --buildFor a real phone on a trusted private network, publish the host's RFC 1918 address:
ROOT_MODULES_LOCATION_ENABLED=true \
ARWEN_PUBLIC_URL=http://192.168.1.10:8080 \
docker compose up --buildFor an internet-facing deployment, put Arwen behind TLS and publish the HTTPS URL that the phone can reach:
ROOT_MODULES_LOCATION_ENABLED=true \
ARWEN_PUBLIC_URL=https://arwen.example.com \
docker compose up --buildThe Compose stack exposes Arwen on port 8080; TLS termination is intentionally left to your reverse proxy. Legolas accepts cleartext pairing only for loopback and RFC 1918 private IPv4 addresses. Use that mode only on a trusted LAN because the QR credential and location samples are visible in transit. Android 17 additionally asks users for local-network access when this URL resolves to a private or local host.
Follow the Arwen logs if the QR code is not visible:
docker compose logs -f arwenOn first initialization, the QR code contains the server URL and the single API key shared by all clients. The raw key is shown only once and only its hash is stored. Use it for protected APIs:
Authorization: Bearer arwen_...Authenticated clients can call GET /api/health regardless of which feature modules are enabled.
When ROOT_MODULES_LOCATION_ENABLED=true, Legolas can send batches to POST /api/location/samples/batch. Arwen stores the authenticated owner, client sample ID, collection and receipt times, coordinates, horizontal accuracy, source, activity type, and save reason. Duplicate (owner, client sample ID) pairs are ignored safely.
Authenticated clients can read the same owner's samples with GET /api/location/samples?date=YYYY-MM-DD in the Asia/Seoul day boundary or GET /api/location/samples/recent?limit=20. Both endpoints accept an optional quality=GOOD|FAIR|BAD filter derived from horizontal accuracy.
Known places are owner-scoped and managed with GET/POST /api/location/places and PUT/DELETE /api/location/places/{id}. A place contains a name, center coordinate, and radius in meters.
GET /api/location/timeline?date=YYYY-MM-DD derives that owner's place-entry, place-exit, and move events on demand from GOOD/FAIR samples and saved places. Dates use the Asia/Seoul boundary. Derived events are not persisted yet.
Feature modules use package-by-feature first and split responsibilities inside the module. In the location module, controller owns HTTP boundaries, service owns use cases and transaction boundaries, repository owns SQL, domain owns internal models, and dto/request and dto/response own the public API contract. Module-specific errors and feature switches live under exception, config, and properties.
The dependency direction is controller -> service -> repository; controllers do not access the database directly. When root.modules.location.enabled=false, location controllers, services, and repositories are not registered.
./gradlew test