Skip to content

Monetization MVP + free Supabase accounts (synced plan/trial/devices)#5

Merged
CarlosA49 merged 7 commits into
mainfrom
claude/ai-humanizer-tool-DPX66
May 17, 2026
Merged

Monetization MVP + free Supabase accounts (synced plan/trial/devices)#5
CarlosA49 merged 7 commits into
mainfrom
claude/ai-humanizer-tool-DPX66

Conversation

@CarlosA49

Copy link
Copy Markdown
Owner

Summary

Adds a complete monetization layer plus a free, server-enforced account
system to the client-side humanizer.

Monetization MVP

  • Free trial (500 words), launch pricing tiers, paywall, checkout modal
  • Signed coupon codes (percent/amount/FREE), owner tools, feedback form
  • PayMongo / PayPal payment links (manual activation), per-plan device caps
  • Plan tuning: allowances, devices, ₱5,000 Unlimited, code-only Lifetime,
    Pro lowered to 30,000 words/month

Free accounts (Supabase)

  • Email + password signup/login via the footer "Account" link
  • Per-user profile syncs plan, trial words, unlock and devices across
    browsers/phones
  • All mutations go through SECURITY DEFINER Postgres functions
    (ensure_profile, consume_words, register_device,
    forget_other_devices, redeem_coupon) — clients can only read their
    own row, so trial count / unlock / device list are tamper-resistant
  • Coupon signature re-verified server-side (HMAC in Postgres)
  • Real per-plan device-cap enforcement with a "use this device" reset
  • Falls back to the localStorage MVP if Supabase is unreachable
  • Live Supabase project URL + publishable key wired in (publishable key
    is safe to ship; data protected by RLS + the server functions)
  • supabase/schema.sql provided; README documents setup

Test plan

  • Footer "Account" → create account (email + 6+ char password)
  • Trial banner shows email + "synced"; humanizing decrements the
    server-side profiles.trial_words
  • Sign in on a second browser/device → same usage/plan follows you
  • Owner FREE coupon unlocks the account everywhere (not one device)
  • Exceeding the plan device cap is blocked; "use this device" resets
  • With Supabase blacked out, app still runs as the localStorage MVP
  • Python humanizer tests still pass (python -m unittest)

https://claude.ai/code/session_015REKyF6JmJchTnZWoLth7Y


Generated by Claude Code

claude added 7 commits May 17, 2026 03:22
…edback

No-backend client-side MVP:
- 500-word free trial (localStorage), paywall when exhausted
- Launch-priced plans page with pricing psychology (anchored strike-through
  prices, "Most popular" decoy, annual savings, lifetime anchor): Starter
  P499 / Pro P799 / Unlimited P1,499 /mo, Pro Annual P7,990, Lifetime P9,999
- Signed coupon system (%-off / P-off / 100%-free), per-plan or all
- Password-gated owner coupon generator (footer "Owner tools"); password
  stored only as SHA-256 hash (public repo safe)
- Checkout instructions: PayMongo (GCash/cards -> BPI) + PayPal QR
  (international), manual activation in MVP
- Embedded feedback form (Formspree endpoint or email fallback)
- config.js holds owner TODO placeholders; sw.js cache bumped to v2

Client-side enforcement is tamper-resistant, not tamper-proof; real
payment/enforcement is the planned backend phase. No Python changes;
41 tests still pass.

https://claude.ai/code/session_015REKyF6JmJchTnZWoLth7Y
- Starter /mo: 10,000 words (was 25k)
- Pro /mo: 60,000 words; Unlimited /mo raised to ₱5,000
- Add Pro Semi-Annual (₱3,990 / 6 mo); Pro Annual repriced to ₱6,990
- Per-plan device limits (Starter 1 … Unlimited 5) shown on cards,
  checkout and unlocked banner; soft per-device id, real binding deferred
  to the backend phase
- Lifetime removed from the page; now code-only via Owner tools
  (plan LIFE), unlocks on the redeeming device (devices: 3)
- "Best for…" value line per plan; README pricing table refreshed

https://claude.ai/code/session_015REKyF6JmJchTnZWoLth7Y
Applies to Pro monthly and the Pro Semi-Annual / Annual variants
(same Pro entitlement); perk updated to "3x the words".

https://claude.ai/code/session_015REKyF6JmJchTnZWoLth7Y
- Email + password auth via Supabase; account modal (footer "Account")
- Per-user profile syncs plan, trial words, unlock and devices across
  devices; signed-in state is the source of truth, localStorage MVP is
  the offline/no-keys fallback
- supabase/schema.sql: profiles table + RLS (read-own-row only) and
  SECURITY DEFINER RPCs (consume_words, redeem_coupon with server-side
  HMAC, register_device with cap, forget_other_devices) so trial count,
  unlock and device list are tamper-resistant
- Coupon redemption routes server-side when signed in
- Real per-plan device-cap enforcement with "use this device" reset
- App still runs as localStorage MVP until SUPABASE_URL/ANON_KEY set
- sw cache -> v3; README documents the free Supabase setup

https://claude.ai/code/session_015REKyF6JmJchTnZWoLth7Y
- grant select on profiles to authenticated and usage on schema public,
  so the Data API works regardless of the "Automatically expose new
  tables" project setting (RLS still limits reads to the own row)
- enable RLS on private_config with no policies (deny-all via API;
  SECURITY DEFINER functions still read the coupon secret)

https://claude.ai/code/session_015REKyF6JmJchTnZWoLth7Y
Drops the on_auth_user_created trigger and handle_new_user (which
referenced new.id) in favour of a SECURITY DEFINER ensure_profile()
that creates+returns the caller's row using auth.uid()/auth.jwt().
The client now calls ensure_profile on session init. Removes the
new.id token that some SQL editors/assistants kept corrupting, and
simplifies setup (no trigger on the auth schema).

https://claude.ai/code/session_015REKyF6JmJchTnZWoLth7Y
Accounts, synced plan/trial/devices, and server-side coupon
redemption are now live (publishable key is safe to ship; data is
protected by RLS + SECURITY DEFINER functions).

https://claude.ai/code/session_015REKyF6JmJchTnZWoLth7Y
@CarlosA49 CarlosA49 merged commit b408666 into main May 17, 2026
2 checks passed
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.

2 participants