From ddacf8b30734c7d5e9a109084024cea2acacd36a Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 20 Aug 2026 21:41:12 +0000 Subject: [PATCH] Add mobile app framework decision and architecture design Research and design document evaluating how to build iOS and Android clients for Brackt while maximizing code sharing with the website. Recommends Expo (React Native SDK 56) in an npm workspaces monorepo, with a contract-first zod layer and a hybrid UI strategy: native screens for the 24 surfaces that justify them, and Expo DOM components reusing existing web components for the 44-route long tail (admin, marketing, brackets). Rejects a universal react-native-web UI, documenting why. Covers the shared packages/core extraction, better-auth Expo integration, socket-first realtime, push notifications, the Phase 0 monorepo mechanics, an eight-phase delivery sequence, testing, risks, and verification. Also records three findings from the audit that stand on their own: Socket.IO has no handshake authentication and join-draft trusts a client-supplied teamId, exposing other managers' private queues; the public-api-v1 plan is filed under completed but was never implemented; and CLAUDE.md and AGENTS.md still describe Clerk instead of better-auth. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01SnwjrXK8UpMZC4pmLTQ3hE --- plans/mobile-app-architecture.md | 391 +++++++++++++++++++++++++++++++ 1 file changed, 391 insertions(+) create mode 100644 plans/mobile-app-architecture.md diff --git a/plans/mobile-app-architecture.md b/plans/mobile-app-architecture.md new file mode 100644 index 0000000..82b722d --- /dev/null +++ b/plans/mobile-app-architecture.md @@ -0,0 +1,391 @@ +# Brackt Mobile — Framework Decision & Architecture Design + +**Status:** Design document. Not an implementation plan yet — this is the input to one. +**Date:** 2026-08-20 + +--- + +## 1. Context + +Brackt.com is a multi-sport fantasy drafting platform. Its centerpiece is a **live, real-time snake draft** with a running clock, a per-team draft queue, autodraft, and commissioner controls. That experience is the strongest possible argument for a native app: drafts are time-boxed, turn-based, and happen while people are away from a desk. The website already tries to compensate — `app/hooks/useDraftNotifications.ts` fires Web Notifications only when `document.hidden`, and `server/socket.ts` emits a full `draft-state-sync` snapshot on reconnect with an inline comment explaining it exists *because mobile backgrounding breaks the HTTP revalidate path*. The codebase has been reaching for an app for a while. + +**The goal:** ship iOS and Android from one codebase, with as much code shared with the website as possible, so the two never drift apart on the rules that matter. + +**The constraint that shapes everything:** divergence risk is not evenly distributed. Two `