LifeMate — Personal, Family & Learning Companion
feat/personal-encrypted-recovery
chore/phase1-repository-cleanup
deploy/stable-web-apk
deployment-static
design/mobile-accessibility-v2
design/mobile-navigation-review
docs/child-education-access-decision
docs/offline-data-rescue-options
docs/owner-guide-and-delivery-plan
docs/phase1-policy-options
docs/public-review-live-2026-10-15
feat/aparat-learning-library
feat/child-device-safety
feat/child-identity-schema
feat/flutter-mobile-navigation
feat/learning-content-operations
feat/local-signing-preflight
feat/online-family-stage0
feat/personal-encrypted-recovery
feat/private-planner-series-api
feat/public-review-page
feat/standalone-weekly-planner
feat/weekly-planner-android
final-feature-1/iran-family-school
fix/auth-abuse-expiry-safety
fix/auth-expiry-after-lock
fix/backend-request-safety
fix/lifeguide-bootstrap-naming-ci
fix/lifeguide-pages-qa-base-preflight
fix/lifeguide-qa-pages-env-deployment
fix/local-task-persistence
fix/managed-child-session-boundary
fix/personal-jalali-dates
fix/personal-notification-controls
fix/personal-upgrade-delivery-guard
fix/sms-approval-gates
fix/study-duration-display
infra/cloudflare-neon-migration
infra/lifeguide-cloudflare-qa
infra/lifeguide-github-pages-qa
infra/lifeguide-supabase-qa
main
phase-1/foundation-completion
phase-2/product-foundation-identity
phase-3/planner-school-family-core
phase-4/ai-learning-wellbeing
phase-5/hardening-observability-release
test/android-reminder-acceptance
test/personal-notification-settings
test/personal-recovery-acceptance
test/role-entry-apk
| 1 | # ADR 0012 — Netlify Free as **candidate** for LifeGuide QA Node API (not deployed) |
| 2 | |
| 3 | Date: 2026-10-15 |
| 4 | Status: **INVESTIGATE ONLY — NO HOST/ACCOUNT/DEPLOYMENT** |
| 5 | |
| 6 | ## Purpose |
| 7 | |
| 8 | LifeGuide v0.7.1 is Node.js 22 / Express 5 / `argon2` native / `pg` / custom JWT-session family permissions. Supabase Free **LifeGuide-QA** currently hosts the already-migrated private PostgreSQL17 application model (20 original migrations; 59 private tables; deny-by-default RLS). Supabase managed Postgres **does not run the existing Express server** and its Edge Functions are not a verified replacement for Node native Argon2. |
| 9 | |
| 10 | Owner cannot provide an international credit card, so no provider requiring a billing card, paid trial or out-of-band cost is suitable. |
| 11 | |
| 12 | ## Evidence from current provider documentation |
| 13 | |
| 14 | - Netlify's updated Free plan: **$0/month with a HARD 300-credit monthly limit**, no auto recharge, which pauses the site if allowance is exhausted. https://docs.netlify.com/manage/accounts-and-billing/billing/billing-for-credit-based-plans/credit-based-pricing-plans/ |
| 15 | - Netlify official free-plan announcement explicitly states **no credit card required**; still verify on the specific owner's account before taking any account action. https://www.netlify.com/blog/introducing-netlify-free-plan/ |
| 16 | - Netlify's official Express guide describes `serverless-http` converting Express to Node Functions and redirects; support is documented, **not verified for this LifeGuide repo**. https://docs.netlify.com/build/frameworks/framework-setup-guides/express/ |
| 17 | - Official function bundling docs allow `node_bundler = "esbuild"` and `external_node_modules` to include Node-native modules: https://docs.netlify.com/build/functions/configuration/ |
| 18 | |
| 19 | ## Required implementation, **not yet done** |
| 20 | |
| 21 | 1. Confirm Netlify Free registration works for the owner **without card**, terms/accessibility from Iran without VPN, and no cost to deploy a private QA site. No Netlify connector is currently available via ChatGPT integration, and no account was assumed. |
| 22 | 2. Create a new QA branch and deployment (not production `main`); bundle the **existing** Express Router with `serverless-http` and preserve request-context, errors, JWT/session checks and exact `/v1` route semantics; make any build/test commands compatible with Node22 and the native `argon2` build. |
| 23 | 3. Fix or replace the existing **process-memory per-IP rate limiter** with a reliable shared server-side limiter before exposing authentication on stateless, autoscaled Functions. The existing DB per-phone cooldown helps OTP but is not adequate alone for password-login throttling. Need negative tests for multi-instance abuse, correct trusted-proxy behavior, sanitized logs. |
| 24 | 4. Postgres connection strategy: use pooler/SSL and bounded connection pools; preserve app-level tenant/guardian permission functions. Private Supabase QA schema has **FORCED RLS, no policies and no client grants**. Design a dedicated least-privileged server role with scoped RLS policies before granting any access, and prohibit production app secrets in GitHub, PWA, Flutter or logs. |
| 25 | 5. Configure **server-side-only** `DATABASE_URL`, `JWT_SECRET`, `KAVENEGAR_API_KEY` if explicitly approved later, plus CORS and origin; never put passwords/keys in a public browser bundle. Keep real SMS provider disabled until `lifeguideotp` is approved and owner approves one paid test. |
| 26 | 6. Private synthetic child/parent E2E HTTP tests, including unauthorized 403, revocation, 4-second duration, session persistence and offline idempotency; full end-to-end QA on iPhone Safari/Android and from Iran without VPN. |
| 27 | 7. Only after acceptance, separately discuss `https://app.lifeguide.ir` DNS/path migration. No automatic cutover. |
| 28 | |
| 29 | ## Decision |
| 30 | |
| 31 | **Research candidate, not an adopted deployment architecture.** Netlify may solve the free Node hosting gap with less rework than replacing Express with Supabase Edge Auth, but suitability of Kavenegar networking, stable native Argon2 packaging, stateless rate limits, private Postgres role/RLS, quota and Iran access has not yet been verified. This document does NOT authorize account charges, live domain changes, actual SMS, production migration or new identity-provider substitution. Production hosting ADR0009 remains unchanged. |