@davoodmehraban89 / LifeMate / commits / e9f6981
Fork 0

LifeMate — Personal, Family & Learning Companion

docs: plan final Feature 1 implementation

davoodmehraban89 committed Oct 5, 2026 at 19:38 UTC e9f698171f76fadb93883abe38c1bd54e7552152
1 file changed +61
docs/superpowers/plans/2026-10-05-iran-family-learning-hub.md new
+61
@@ -0,0 +1,61 @@
1 +# Feature 1 — Iranian Family & Learning Hub Implementation Plan
2 +
3 +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
4 +
5 +**Goal:** Deliver the final owner-testable Iranian family, education, Jalali calendar, reminder-preference and private cycle-tracking feature set.
6 +
7 +**Architecture:** Extend the existing phase-based backend with `0005` + `phase6.js`, expose a compact API client surface, and add a focused Flutter hub without restructuring earlier phases. Preserve existing authorization as the security authority.
8 +
9 +**Tech Stack:** PostgreSQL, Node/Express, Flutter/Dart, GitHub Actions.
10 +
11 +**Spec:** `docs/superpowers/specs/2026-10-05-iran-family-learning-hub-design.md`
12 +
13 +## Global Constraints
14 +- No public production deployment.
15 +- No copyrighted textbook PDF binaries committed without verified redistribution rights.
16 +- Menstrual entries owner-only.
17 +- Persona metadata never grants authorization.
18 +- Jalali week begins Saturday for Iranian locale.
19 +
20 +## Review Focus
21 +- Guardian attempting to read private cycle data must have no route/capability.
22 +- Invalid grade/stage combinations must be rejected.
23 +- Grade 7 must map to secondary first cycle, local year 1.
24 +- Sensitive notification preview defaults off.
25 +- External textbook URLs must be trusted HTTPS sources.
26 +
27 +---
28 +
29 +### Task 1: Red-first contracts
30 +**Files:** create `backend/tests/phase6_contract.test.js`, `backend/tests/phase6_schema_test.sql`; create Flutter pure-model tests.
31 +- [ ] Add failing contract/schema tests for required files/tables/guardrails.
32 +- [ ] Push and observe CI failure before implementation.
33 +
34 +### Task 2: Data model and seed catalog
35 +**Files:** create `backend/migrations/0005_iran_family_learning.sql`.
36 +- [ ] Add persona, education profile, curriculum/textbook, official calendar, notification preference and cycle tables.
37 +- [ ] Seed stage/grade mapping and Grade 7 curriculum metadata.
38 +- [ ] Run migration/schema gates.
39 +
40 +### Task 3: API
41 +**Files:** create `backend/src/phase6.js`; modify `backend/src/server.js`.
42 +- [ ] Implement authenticated owner/guardian-safe profile APIs.
43 +- [ ] Implement catalog/calendar/preferences APIs.
44 +- [ ] Implement owner-only cycle CRUD/list API.
45 +- [ ] Run backend tests and syntax checks.
46 +
47 +### Task 4: Flutter integration
48 +**Files:** create `apps/lifemate/lib/iran_hub.dart`; modify `api.dart`, `phase3_ui.dart`, navigation as required.
49 +- [ ] Add education/persona setup.
50 +- [ ] Add Jalali-first calendar/event view.
51 +- [ ] Add textbook/catalog view using official metadata links.
52 +- [ ] Add notification settings and private cycle tracker.
53 +- [ ] Run format/analyze/widget tests.
54 +
55 +### Task 5: Release outputs
56 +**Files:** modify `.github/workflows/ci.yml`, release docs/state.
57 +- [ ] Retain Web release bundle and Android APK as CI artifacts.
58 +- [ ] Document iOS signing gate and build command.
59 +- [ ] Run full CI and verify all jobs.
60 +- [ ] Open PR, review diff/security, merge only after green CI.
61 +- [ ] Verify post-merge main CI.
\ No newline at end of file