Skip to main content

L3 — Components

Two zoom-ins: inside the app container, and inside the client_sdk container.

The app

Pages own layout + their bloc; blocs depend on repositories (the thin presentation seam) and effect providers. Only repositories and effect providers cross from inside the tree to outside it.

Navigation (auto_route) is a role-filtered tab shell under a MainShellRoute: adults get Home · Earn · Rewards · Household · Profile (5 slots), children get Home · Earn · Rewards · Profile (4 slots — Household is adult-only, hidden by _kChildDestinations + ChildModeGuard). The chore catalog + the full-page chore editor live under Earn; members live under Household. The trailing slot is Profile (ProfileRoute / ProfilePage) — it replaced the old More tab; its nav icon is the active member's identity avatar (companion-when-configured, else emoji) and its label is that member's short (ellipsized) display name, both driven by ActiveIdentity_Cubit. A shared Shell_AppBar carries the same identity avatar top-left (tap → companion sheet) plus a "viewing {member}" cue shown only when proxied. Per-tab [page] analytics fire from the route observer's didInitTabRoute / didChangeTabRoute (the shell route itself is skipped).

The client_sdk

A thin facade over domain services (where the rules live) over swappable adapters over models. The cloud (data) adapter is built (SP3 — SupabaseStorageAdapter + MappingPort + CloudMigrationService + linkAccountToMember; hydrate-once reads/watches; Realtime cross-device = SP3.5 deferred). The ai adapter remains planned (dashed).

Why / changed from the POC: the POC's single monolithic client mixed orchestration, rules, and I/O. The rebuild puts domain rules in services, keeps repositories thin, and makes the adapter a config choice — never injected. cloud data adapter is built (SP3): SupabaseStorageAdapter (full StoragePort over Supabase PostgREST, RLS-enforced), MappingPort (Postgres→SDK error translation), createClient cloud branch (dataMode: DataMode.cloudCachedStorageAdapter(durable: SupabaseStorageAdapter, cache: InMemory)), linkAccountToMember (shadow→account), and CloudMigrationService (free→paid upload, idempotent, ledger-safe). Reads/watches are hydrate-once this session; Realtime cross-device sync = SP3.5 (deferred). ai remains scoped but not yet built. See the CLAUDE.md load-bearing rules on the overview and the POC domain gap analysis.