Skip to content

feat(v3.1.0): complete SaaS transformation — auth, sync, paywall, sharing - #1

Merged
AzizX-coder merged 2 commits into
mainfrom
claude/saas-paywall-features-Z8Stm
May 13, 2026
Merged

feat(v3.1.0): complete SaaS transformation — auth, sync, paywall, sharing#1
AzizX-coder merged 2 commits into
mainfrom
claude/saas-paywall-features-Z8Stm

Conversation

@AzizX-coder

@AzizX-coder AzizX-coder commented May 13, 2026

Copy link
Copy Markdown
Owner

Blocks B–L of the Delay v3.1 SaaS build:

AUTH GATE (Block B)

  • Auth guard in App.tsx: if Supabase configured + no session → AuthPage
  • useProfile.ts: fetch/upsert profiles row, realtime plan updates
  • ProfileButton with avatar, plan badge, XP/level, sign-out dropdown
  • gamificationStore: setXP/setStreak setters + fire-and-forget Supabase sync

CLOUD SYNC (Block C)

  • Dexie v4 migration: sync_queue, voice_recordings, note sharing fields
  • sync.ts: enqueueSync → drain (5× retry), pullFromSupabase, subscribeToTable
  • notesStore + tasksStore wired to enqueueSync on create/update/delete

PUBLIC SHARING (Block H)

  • Note type: is_public, public_slug fields
  • Share button in NoteEditor: nanoid slug, copy link, revoke
  • PublicNotePage: read-only view at #/share/note/:slug (no auth required)
  • Supabase RLS policy: is_public=1 rows readable by anyone

PAYWALL / PRICING (Block K)

  • usePlanLimits: free/pro/max limits (notes, boards, share, vault)
  • PricingPage: Free/$0, Pro/$8, Max/$18 — Stripe TODO stubbed
  • UpgradeModal: plan comparison cards, CTA to /pricing
  • Public share gated for pro+ users via UpgradeModal

FEATURE FIXES (Block F)

  • BucketPage: FilePreviewModal (image/video/audio/PDF/text), drag-to-preview
  • VoiceStudioPage: recordings persisted to Dexie voice_recordings table
  • AppLayout: AnimatePresence page transitions (opacity + y slide)

UX POLISH (Block G)

  • Timer: +25 XP on focus session complete
  • Tasks: +50 XP bonus when all today's tasks are done

AI WEEKLY INSIGHT (Block I)

  • StatusPage: Monday insight card via OpenRouter, cached in profile

BUILDS (Block J)

  • package.json: electron:build:win/mac/linux scripts, mac DMG+ZIP multi-arch
  • electron/entitlements.mac.plist: hardened runtime for macOS notarization

SUPABASE (infra)

  • migrations/001_profiles.sql: profiles table + RLS + auto-insert trigger
  • migrations/002_sync_tables.sql: user_notes/tasks/events + RLS
  • functions/create-checkout/index.ts: Stripe stub (503, full impl commented)
  • functions/stripe-webhook/index.ts: Stripe stub (503, full impl commented)

README: full v3.1.0 rewrite with badges, features, download table, tech stack

https://claude.ai/code/session_015FM4HeBho3cC7tbBX3qXUM

Summary by CodeRabbit

Release Notes

  • New Features

    • Added user profile management and authentication system
    • Added public note sharing with plan-based limits
    • Added pricing page with Free, Pro, and Max plans
    • Added AI-powered weekly insights on status page
    • Added persistent voice recording storage
    • Added file preview functionality in vault (images, videos, audio, PDFs, text)
    • Added cloud synchronization with offline-first support
  • Improvements

    • Enhanced multi-platform distribution support (Windows, macOS, Linux)
    • Added animated page transitions for improved user experience

Review Change Stack

claude added 2 commits May 13, 2026 13:28
…ring

Blocks B–L of the Delay v3.1 SaaS build:

AUTH GATE (Block B)
- Auth guard in App.tsx: if Supabase configured + no session → AuthPage
- useProfile.ts: fetch/upsert profiles row, realtime plan updates
- ProfileButton with avatar, plan badge, XP/level, sign-out dropdown
- gamificationStore: setXP/setStreak setters + fire-and-forget Supabase sync

CLOUD SYNC (Block C)
- Dexie v4 migration: sync_queue, voice_recordings, note sharing fields
- sync.ts: enqueueSync → drain (5× retry), pullFromSupabase, subscribeToTable
- notesStore + tasksStore wired to enqueueSync on create/update/delete

PUBLIC SHARING (Block H)
- Note type: is_public, public_slug fields
- Share button in NoteEditor: nanoid slug, copy link, revoke
- PublicNotePage: read-only view at #/share/note/:slug (no auth required)
- Supabase RLS policy: is_public=1 rows readable by anyone

PAYWALL / PRICING (Block K)
- usePlanLimits: free/pro/max limits (notes, boards, share, vault)
- PricingPage: Free/$0, Pro/$8, Max/$18 — Stripe TODO stubbed
- UpgradeModal: plan comparison cards, CTA to /pricing
- Public share gated for pro+ users via UpgradeModal

FEATURE FIXES (Block F)
- BucketPage: FilePreviewModal (image/video/audio/PDF/text), drag-to-preview
- VoiceStudioPage: recordings persisted to Dexie voice_recordings table
- AppLayout: AnimatePresence page transitions (opacity + y slide)

UX POLISH (Block G)
- Timer: +25 XP on focus session complete
- Tasks: +50 XP bonus when all today's tasks are done

AI WEEKLY INSIGHT (Block I)
- StatusPage: Monday insight card via OpenRouter, cached in profile

BUILDS (Block J)
- package.json: electron:build:win/mac/linux scripts, mac DMG+ZIP multi-arch
- electron/entitlements.mac.plist: hardened runtime for macOS notarization

SUPABASE (infra)
- migrations/001_profiles.sql: profiles table + RLS + auto-insert trigger
- migrations/002_sync_tables.sql: user_notes/tasks/events + RLS
- functions/create-checkout/index.ts: Stripe stub (503, full impl commented)
- functions/stripe-webhook/index.ts: Stripe stub (503, full impl commented)

README: full v3.1.0 rewrite with badges, features, download table, tech stack

https://claude.ai/code/session_015FM4HeBho3cC7tbBX3qXUM
Parallel jobs for windows-latest, macos-latest, ubuntu-latest.
All artifacts collected and published in a final create-release job.
Matches new electron:build:win/mac/linux scripts added in v3.1.0.

https://claude.ai/code/session_015FM4HeBho3cC7tbBX3qXUM
@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f9edf15b-fbc8-4ca3-a63d-48229daf5bf8

📥 Commits

Reviewing files that changed from the base of the PR and between b55f51c and 482daef.

📒 Files selected for processing (27)
  • .github/workflows/main.yml
  • README.md
  • electron/entitlements.mac.plist
  • package.json
  • src/App.tsx
  • src/components/layout/AppLayout.tsx
  • src/components/layout/NavigationRail.tsx
  • src/components/ui/ProfileButton.tsx
  • src/components/ui/UpgradeModal.tsx
  • src/features/bucket/BucketPage.tsx
  • src/features/notes/NoteEditor.tsx
  • src/features/pricing/PricingPage.tsx
  • src/features/share/PublicNotePage.tsx
  • src/features/status/StatusPage.tsx
  • src/features/voice-studio/VoiceStudioPage.tsx
  • src/hooks/usePlanLimits.ts
  • src/hooks/useProfile.ts
  • src/lib/database.ts
  • src/lib/sync.ts
  • src/stores/gamificationStore.ts
  • src/stores/notesStore.ts
  • src/stores/tasksStore.ts
  • src/types/note.ts
  • supabase/functions/create-checkout/index.ts
  • supabase/functions/stripe-webhook/index.ts
  • supabase/migrations/001_profiles.sql
  • supabase/migrations/002_sync_tables.sql

📝 Walkthrough

Walkthrough

This PR introduces v3.1.0 with Supabase-backed user profiles, cloud data synchronization, plan-gated feature tiers, and public note sharing. The multi-platform build system supports Windows, macOS, and Linux. Core additions include the useProfile hook for cloud profile management, a sync layer for offline-first local-Supabase bidirectional sync, and feature-gate components like pricing pages and upgrade modals. Voice recordings and note sharing are now persistent.

Changes

Version 3.1.0 Feature Release

Layer / File(s) Summary
Build and Release Infrastructure
.github/workflows/main.yml, package.json, electron/entitlements.mac.plist, README.md
Multi-platform Electron builds for Windows/macOS/Linux with per-platform checksums, version bump to 3.1.0, entitlements plist for macOS security, and restructured README with release highlights and build instructions.
Supabase Cloud Database and RLS Policies
supabase/migrations/001_profiles.sql, supabase/migrations/002_sync_tables.sql
Profiles table with auto-enrollment on new auth users, row-level security for all tables, and per-user data tables (notes, tasks, task lists, events) with public read policy for shared notes.
Authentication Gate and User Profile Hook
src/hooks/useProfile.ts, src/App.tsx
useProfile hook with Supabase fetch/realtime sync, offline auth bypass via sessionStorage, and App-level conditional auth gating that only enforces authentication when Supabase is configured.
Plan Limits and Pricing UI
src/hooks/usePlanLimits.ts, src/features/pricing/PricingPage.tsx, src/components/ui/UpgradeModal.tsx
PLAN_LIMITS configuration for free/pro/max with feature caps, pricing page with plan cards and current plan highlighting, and animated upgrade modal gated to plan-restricted features.
Public Note Sharing
src/types/note.ts, src/features/notes/NoteEditor.tsx, src/features/share/PublicNotePage.tsx
Note type extended with is_public and public_slug fields, NoteEditor UI for toggling sharing and copying share links (pro+ only), and PublicNotePage for viewing shared notes via slug lookup from Supabase or local Dexie.
Data Synchronization Infrastructure
src/lib/database.ts, src/lib/sync.ts, src/stores/notesStore.ts, src/stores/tasksStore.ts
Dexie schema v4 adds sync_queue and voice_recordings tables, sync.ts provides enqueue/flush/pull/subscribe for bidirectional Supabase sync, and notes/tasks stores integrate enqueue calls after create/update/delete operations.
Navigation and Profile UI Components
src/components/layout/AppLayout.tsx, src/components/layout/NavigationRail.tsx, src/components/ui/ProfileButton.tsx
ProfileButton component in NavigationRail shows user avatar, plan, and dropdown menu with settings/sign-out; AppLayout adds animated route transitions via AnimatePresence and location-keyed motion divs.
Feature Implementations and Gamification
src/features/status/StatusPage.tsx, src/features/voice-studio/VoiceStudioPage.tsx, src/features/bucket/BucketPage.tsx, src/stores/gamificationStore.ts
StatusPage generates and caches AI Weekly Insights on Mondays, VoiceStudioPage persists recordings to Dexie as base64, BucketPage adds file preview modal, and gamificationStore syncs XP/streak to Supabase; task completion now awards bonus 50 XP when all today's tasks are done.
Application Routing and Pricing Route
src/App.tsx
App routing adds /pricing for PricingPage, public /share/note/:slug for PublicNotePage, ensures AI/timer/code-studio routes available, and refactors keyboard shortcut handling into main hooks.
Stripe Integration Stubs
supabase/functions/create-checkout/index.ts, supabase/functions/stripe-webhook/index.ts
Stripe Edge Functions stubbed with HTTP 503 "not configured" responses; commented placeholder code provided for future Stripe Checkout and webhook implementation.

🎯 4 (Complex) | ⏱️ ~60 minutes

🐰 Hops through the changelog with glee

Version three-point-one brings profiles to the cloud,
With sync and sharing making devs quite proud!
Gamified streaks and pricing tiers align,
While voice and vaults persist—the release feels fine! 🌟

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/saas-paywall-features-Z8Stm

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@AzizX-coder
AzizX-coder merged commit 0ee73b1 into main May 13, 2026
1 check was pending
AzizX-coder added a commit that referenced this pull request May 17, 2026
Followed up the audit with concrete fixes for what was actually broken:

1. BLOCKER — desktop & Android releases shipped with empty Supabase env.
   .github/workflows/main.yml passed GH_TOKEN to all four platform build
   steps but never VITE_SUPABASE_URL / VITE_SUPABASE_ANON_KEY. Result:
   the bundled app called createClient("", "") and isSupabaseConfigured
   returned false, so the installed desktop app had no cloud features at
   all and Account/Workspaces showed "sign in" with no working sign-in.
   Now passed on Win / Mac / Linux / Android.

2. captureStore.loadItems() was only called by CapturePage's useEffect.
   Quick Capture (Ctrl+Shift+S from anywhere) and the command palette
   read the same store. If the user used those before visiting the Saved
   tab, the store was [] in memory while localStorage had content —
   making it look like Saved messages were silently failing. App.tsx
   now pre-loads captureStore + flowsStore at boot.

3. MarkdownRenderer (used by AI chat for assistant replies) wrote raw
   markdown HTML through dangerouslySetInnerHTML without sanitization.
   renderMarkdown escapes inline text but inline HTML in the input would
   leak through. Now wrapped with DOMPurify (same config as the public
   note share page).

4. package.json bumped to 3.2.1 — tagging this immediately so the next
   release build picks up #1.

Co-Authored-By: Claude Opus 4.7 <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.

2 participants