Pet Flex Backend
Personal — Supabase Auth, Postgres RLS, Storage, and edge functions
Role: Personal project — sole builder
Overview
Backend for the Pet Flex platform implementing Auth, Postgres, RLS, Storage, Realtime, Phase 3 chat/pre-visit/announcements, IAP subscription verification, and an offline-sync protocol slice — clients talk to Supabase directly.
The core challenge
Model multi-role veterinary data (owners, clinics, staff, platform admin) with strong RLS, privacy-aware storage of medical records, and privileged edge functions without a custom Node API.
The engineering solution
Schema and policies in supabase/migrations; Deno edge functions for staff invites, push dispatch, and Apple/Google IAP. Drove work with Superpowers specs/plans, Graphify graphs, Codegraph exploration, and supabase-migrations / RLS / local-dev / edge-functions skills.
Architecture
- Supabase-only stack: Auth, Postgres, Storage, Realtime — RLS is the authorization layer
- Hand-written SQL migrations; typed clients generated for mobile and admin
- Deno edge functions: accept-staff-invite, dispatch-notifications, verify-subscription-receipt, subscription-webhook
- Platform admin identity (platform_admins + is_platform_admin()) for cross-clinic ops
- Agent tooling: Superpowers specs/plans, Graphify, Codegraph, supabase-* skills
Highlights
- No Express API — PostgREST + RLS + edge functions serve all clients
- IAP-only monetization with receipt verification and store webhooks
- Local Docker workflow (supabase start/reset) with seeded multi-role accounts
Secure shared backend that enables the owner app and admin panel while demonstrating RLS-first architecture and AI-assisted backend delivery.