Bankroll40 docs

ADR-0002 Expo for the app, Cloudflare for everything behind it

Version: 1 · 2026-10-01 · accepted

Decision

One Expo (React Native) codebase targets iOS, Android and web through Expo Router. The API is Hono on Cloudflare Workers; data in D1 with Drizzle; media in R2; MCP sessions in Durable Objects via Cloudflare's agents runtime; OAuth 2.1 with dynamic client registration via @cloudflare/workers-oauth-provider; sign-in via better-auth; FX rates by a cron trigger; push via Expo. Builds and store submission via EAS or local Xcode.

Why

The target widened from a browser app for one circle to every player through the stores. The discipline engine is notification-driven and wants a native app; Apple's minimum-functionality rule makes a webview shell a review risk. A consumer app must not depend on a home-lab box behind a tunnel, and Cloudflare ships first-party libraries for the remote-MCP and OAuth flow claude.ai requires.

Rejected

A PWA wrapped in Capacitor on eda k3s with Zitadel (first draft). Bun on the server: Workers run workerd, so the Bun house rule does not apply here.

Consequences

D1 is SQLite; money is stored as integer minor units with an ISO code, which needs nothing Postgres-specific. Hyperdrive to a hosted Postgres is the escape hatch at tens of thousands of active players.