Case study

Magick Whisper

Reward-based dog-training companion for the Guardian collar

Backend and mobile developer · 2026 – present · on TestFlight

156
Go tests
~480
Flutter tests
15 min
Access token life
distroless
Image base

How it fits together

Flutter appiOS · AndroidGoogle / AppleOIDC issuersign inID tokenGo APIGinPOST /v1/auth/oauthJWKS cacheRS256 · ES256verifyaccess token15 minutesrefresh tokensha-256 onlyrotates on useno password is ever stored, sentor checked anywhere in the system
Sign-in. The provider proves who you are once; the API issues and rotates its own session.

No passwords anywhere

Sign-in is Google or Apple only. The API verifies the provider's ID token against their published JWKS, cached and refreshed, and accepts only RS256 and ES256 so a token signed with a symmetric key can never be mistaken for a valid one. It then issues its own short access token and an opaque refresh token, stored only as a SHA-256 hash and rotated on every use.

Apple sends a person's name exactly once

On the very first sign-in and never again. Nothing was capturing it, so every account created before the fix would have lost its owner's name permanently, with no way to repair it later. Caught before launch and fixed with a migration.

Seventeen tests that had never run

The database tests skipped silently in CI because no Postgres was attached, and skips report as passes. They had been green and meaningless for weeks, including the one guarding the name above. CI now runs a Postgres service and fails the build if any database test skips.

Speech recognition on the phone

Training sessions are scored by listening for cue words, which runs entirely on the device through Whisper and Silero voice detection in a background isolate. Nothing is uploaded, sessions are stored locally, and uploads carry client-generated identifiers so a retry after a dropped connection cannot create a duplicate.

Sign-in is optional, deliberately

The design called for a launch gate with no way past it. That reads as a rejection risk under App Store guideline 5.1.1, which expects people to use an app before handing over an identity. Onboarding runs with no account, and the account is offered afterwards as a way to back up the dog profile the owner has already built.

Stack

Go 1.25GinPostgreSQLpgxgooseFlutterRiverpodsherpa_onnxDockerGitHub ActionsCodemagic