Skip to content

Expand README with architecture and design rationale - #14

Merged
LouisBenjamin merged 1 commit into
mainfrom
docs/readme-architecture
Sep 2, 2026
Merged

Expand README with architecture and design rationale#14
LouisBenjamin merged 1 commit into
mainfrom
docs/readme-architecture

Conversation

@LouisBenjamin

Copy link
Copy Markdown
Owner

Rewrites the README from an 88-line feature checklist into a 295-line document that explains the system and the reasoning behind it. Docs only, no code touched.

What's new

  • What works today — each feature described concretely: the OTP sign-in flow, guests, the three split modes, soft delete, greedy settle-up, recurring catch-up, realtime invalidation, the 1100px content cap.
  • Architecture — the four-layer feature shape (ui / providers / data / logic) and the rules that keep it honest, plus why Riverpod (family + autoDispose + ref.invalidate are load-bearing for the realtime channel), why go_router (URLs are part of the web product), and why Supabase with no backend of my own, including the trade-off that business rules end up in SQL and how the Dart/SQL line was drawn.
  • Data model — table map plus five named decisions: everything FKs to group_members rather than profiles (the decision the rest of the schema hangs off, and what makes guests first-class with no isGuest branch anywhere), RLS as the security boundary with the SECURITY DEFINER recursion break, RPCs placed exactly where RLS is deliberately too narrow, security_invoker = true on views, and soft delete. The migration numbering is read as a record of what went wrong (0002 search_path, 0003 creator select, 0005 balances view).
  • Money handling — the three rounding rules with worked numbers, and why amounts travel as strings.
  • Debt simplificationn-1 vs n(n-1)/2.
  • Testing, CI, distribution — what each workflow does and why the Cloudflare deploy step is conditional.

Corrections

The old README had drifted from the code:

  • Auth was described as magic-link; it is an emailed one-time code (signInWithOtp + verifyOTP).
  • The project tree listed supabase/functions/ edge functions and a features/notifications/ folder, neither of which exists, and omitted features/realtime/ and core/widgets/.
  • Setup said to run 0001_init.sql; there are ten migrations.
  • The "in progress" checklist marked balances, settle-up, insights, recurring and Android as unbuilt. All are built. The genuinely unbuilt items (FCM push, multi-currency, member removal, tests in CI) moved to their own section.

Em dashes removed throughout, as requested.

Verification

flutter test run against this branch: 58 tests, all passing, which is the count cited in the README. flutter pub get left pubspec.lock unchanged.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EUD4kp9eThszghQ8MHcoTY

Rewrites the README from a feature checklist into a document that explains why the app is built the way it is: the four-layer feature structure, the Riverpod/go_router/Supabase choices and their trade-offs, the five schema decisions (group_members as the participant identity, RLS as the security boundary, SECURITY DEFINER RPCs where RLS is deliberately narrow, security_invoker views, soft delete), the money rounding rules, and debt simplification.

Also corrects details that had drifted from the code: auth is an emailed one-time code rather than a magic link, the project tree listed a supabase/functions directory and a notifications feature folder that do not exist while omitting realtime/ and core/widgets/, setup referenced only 0001_init.sql when there are ten migrations, and the progress checklist marked balances, settle-up, insights, recurring and Android as unbuilt. Genuinely unbuilt work moved to its own section. Em dashes removed throughout.

Test count cited in the README verified with flutter test: 58 passing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EUD4kp9eThszghQ8MHcoTY
@LouisBenjamin
LouisBenjamin merged commit 8aa087c into main Sep 2, 2026
1 check passed
LouisBenjamin added a commit that referenced this pull request Sep 2, 2026
The README was last expanded in #14, before the statement import feature
landed in #15, so it had no mention of the importer at all.

- New "Importing a bank statement" feature section
- New "Decision: statement import keeps raw data off the server" section
  covering the privacy boundary, the client-side fingerprint, and the
  partial unique index
- merchant_rules and expenses.source_fingerprint in the data model table
- import_expenses() in the RPC list
- computeSplits() now noted as shared by three call sites, not two
- features/import/, core/dates.dart, docs/statement-import.md in the tree
- test count 58 -> 165, plus the import test group
- test.yml documented; dropped the stale "tests in CI" gap and added
  "PDF statement import" to the roadmap
- removed no em dashes (there were none); kept the existing voice


Claude-Session: https://claude.ai/code/session_01PcEjJSFabfyzty3uUXx6dQ

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant