diff --git a/docs/developer/android-app.md b/docs/developer/android-app.md index b10ccd2..56d94a6 100644 --- a/docs/developer/android-app.md +++ b/docs/developer/android-app.md @@ -68,10 +68,11 @@ Keeping `:core:domain` free of Android dependencies preserves optionality: a fut 4. While online, a WebSocket connection receives realtime updates pushed by other devices (web reader, KOReader) 5. Books are downloaded to app storage for fully offline reading, with storage management UI -### Device registration & auth +### Authentication & device identity -- The app registers as a Bookhoard **device** using the existing QR-approval flow (`POST /api/devices/register` + web-based approval) — no passwords stored on the device -- JWT access/refresh handled by the existing auth endpoints +- **Primary auth: username/password login** via the existing endpoints (`POST /api/auth/login` + refresh). The app is a full user client — browse, collections, ratings, and annotation management all live behind the user JWT, which device tokens cannot reach +- After login, the app registers itself as a **device** (`device_type: mobile`) and **self-approves** its registration using its own JWT — approval only requires a logged-in user. The phone then appears on the Devices page with sync attribution, per-device settings, and individually revocable access, with no QR ceremony +- Netflix-style QR pairing as a zero-typing sign-in option: post-v1 (see below) --- @@ -125,6 +126,18 @@ iOS is a real roadmap item but not near-term. The strategy is **not** to pre-pay ## 🔭 Post-v1 Ideas +### QR pairing sign-in (Netflix-style) + +"Add device" on the web (while logged in) displays a QR code; a fresh app install scans it and is **fully signed in** — no server URL, no password, nothing typed on the phone. + +- **QR is a full login**: the claim endpoint returns JWT + refresh token (plus the device token for sync identity) +- **Typed-code fallback** (GitHub/Netflix device-flow style: app displays a short code, user enters it on the web) for phones with broken cameras or no camera +- **KOReader keeps its existing flow unchanged** — no typed-code pairing there; it is already as convenient as it can be +- **Use the configured `BASE_URL`, never a detected LAN IP** — if the server is published at `https://public.domain`, pairing must work identically from outside the LAN +- Requires small server additions: `pair`/`claim` endpoints backed by single-use pairing sessions with a short TTL (in-memory like `pendingRegistrations`) + +### Other ideas + - Webtoon / continuous vertical reading mode - Home-screen widgets and app shortcuts ("continue reading") - Text-to-speech