The Mission & Competitive Psychology
Habit adherence collapses when accountability is solitary or subjective. Peer pressure and head-to-head competition remain the most effective behavioral incentives in sports science. Do It transforms daily habit execution into a high-stakes, real-time two-player duel. By bridging physical health telemetry directly with cryptographic accountability, players compete with absolute confidence that every rep, split, and milestone is validated.
1. Multi-Tenant Isolation via Supabase Row-Level Security
Rather than relying exclusively on application-layer permission middleware, Do It delegates data boundary enforcement directly to the PostgreSQL kernel using Supabase Row-Level Security:
- Duel Matchup Guard: Matches, logs, and scoreboards are inaccessible to external tenants. SELECT and UPDATE statements are filtered by
auth.uid() = player_a OR auth.uid() = player_b. - Audit Immutability: Historical completion records are cryptographically tagged with submission timestamps, preventing retro-active date modifications or artificial streak preservation.
2. AES-256-GCM Wearable Sync & OAuth Token Vault
Handling third-party health integrations (Strava, Apple HealthKit, Google Health Connect, Hevy) requires handling long-lived sensitive OAuth refresh credentials. Do It isolates token storage using an envelope encryption schema:
- Tokens are never stored in plaintext within database rows.
- Each payload is encrypted using AES-256-GCM with a server-side master key and a dynamically generated initialization vector (IV), verifying both confidentiality and authentication tag integrity upon decryption.
- Rate-limited asynchronous sync workers poll external APIs on configured cadences, normalizing disparate health units (kJ, kcal, meters, RPE) into standard metric representations.
3. 12-Week Consistency Matrix & Micro-Interactions
The user interface pairs low-latency Next.js 16 App Router streaming with Tailwind CSS v4 styling. Interactive 12-week GitHub-style activity heatmaps visualize mutual progress, while real-time parity meters calculate who is leading the current week's 240 Par threshold, fueling healthy accountability and relentless consistency.