@davoodmehraban89 / LifeMate / commits / d52e853
Fork 0

LifeMate — Personal, Family & Learning Companion

docs: decouple phase 2 from Supabase

davoodmehraban89 committed Oct 5, 2026 at 07:27 UTC d52e8533c0837a20eb1e87d0c05a4eeaa1a4bfe6
1 file changed +16 -5
docs/plans/PHASE_2_IMPLEMENTATION_PLAN.md
+16 -5
@@ -3,18 +3,29 @@
3 Status: IN PROGRESS
4
5 ## Acceptance contract
6 -Phase 2 is complete only when a real Flutter Android/Web-PWA scaffold exists; email/password auth supports verification, recovery and password change; profiles and family workspaces exist; invitations and guardian relationships are server-authorized; RTL/theme shells exist for teen/parent; CI builds/tests Android and Web; and a separate staging backend has been exercised.
6 +Phase 2 is complete only when a real Flutter Android/Web-PWA scaffold exists; email/password auth supports verification, recovery and password change; profiles and family workspaces exist; invitations and guardian relationships are server-authorized; RTL/theme shells exist for teen/parent; CI builds/tests Android and Web; and a separate staging PostgreSQL backend has been exercised.
7 +
8 +## Architecture revision
9 +Supabase is no longer a required platform dependency. LifeMate uses provider-neutral backend ports with PostgreSQL as the durable relational core. Neon is the preferred managed PostgreSQL target when its connector is operational, but application/domain code must not depend on Neon-specific APIs.
10 +
11 +Provider boundaries:
12 +- Database: PostgreSQL 17-compatible SQL; managed target may be Neon.
13 +- Authorization: server-side policy/service layer backed by relational membership/guardian grants; PostgreSQL RLS may provide defense in depth where supported.
14 +- Authentication: `IdentityProvider` port; provider implementation can be changed without altering domain entities.
15 +- Object storage: `ObjectStorage` port; not required for Phase 2 identity acceptance.
16 +- Email: `TransactionalEmail` port for verification/recovery/invitations.
17 +- Realtime: optional adapter; no Phase 2 domain rule depends on realtime delivery.
18
19 ## Execution order
20 1. Scaffold Flutter app and platform assets.
21 2. RED tests for role/theme/auth/family domain behavior, then minimal GREEN implementation.
11 -3. Add Supabase client repositories for auth/profile/family flows.
12 -4. Add versioned SQL schema, RLS and allow/deny tests.
22 +3. Add provider-neutral client repositories for auth/profile/family flows.
23 +4. Add versioned PostgreSQL schema, constraints, authorization policy tests and optional RLS defense-in-depth policies.
24 5. Add authentication UI: sign-in/up, verification state, forgot/reset/change password.
25 6. Add profile + family workspace + invitation + membership/guardian UI.
26 7. Add Persian RTL authenticated Teen/Parent shells and MyStudyLife-inspired direct student navigation.
27 8. Add CI: format, analyze, tests, Android debug build, Web build, secret scan.
17 -9. Provision/attach isolated staging Supabase, apply migrations, run RLS/smoke/advisors.
28 +9. Attach an isolated staging PostgreSQL environment, apply migrations, run authorization/smoke tests.
29 10. Verify branch, update PROJECT_STATE, PR review and merge only after green evidence.
30
31 ## Product rulings carried into implementation
@@ -24,4 +35,4 @@ Phase 2 is complete only when a real Flutter Android/Web-PWA scaffold exists; em
35 - No wellbeing/AI production exposure in Phase 2.
36
37 ## Environment rule
27 -Local, staging and production are distinct. Staging must not reuse Finora/EasyFactor projects. Creating a new Supabase project is an external cost action and therefore requires its required cost confirmation; until that gate is available, code/config must remain deploy-ready but Phase 2 cannot be truthfully marked COMPLETE.
38 +Local, staging and production are distinct. Staging must not reuse Finora/EasyFactor infrastructure. The codebase must remain deployable to standard PostgreSQL even if a managed-provider connector is temporarily unavailable.