← Back to Home

Technical Documentation

System Architecture & Implementation Details

Overview

CookOrDelete is a mobile app that turns recipe saving into action. Instead of endless bookmarking, users must decide to cook or delete each recipe.

Tech Stack

Frontend React Native, Expo, TypeScript
Navigation Expo Router
State / Fetching @tanstack/react-query
Payments RevenueCat
Backend / Auth Supabase
Deployment EAS Build + Submit

Architecture System

The app uses a provider-based architecture for core services:

  • AuthProvider: User auth/session lifecycle
  • SubscriptionProvider: RevenueCat offerings, purchase/restore, entitlement state
  • I18nProvider + OnboardingProvider: Localization and onboarding state

React Query Role: Handles caching, background refetching, mutation flows, and query invalidation after writes.

Supabase Role: Primary source of truth for authenticated users, with local fallback/hydration to keep UX stable.

Core Product Logic

Recipe Lifecycle States

inbox -> review -> planned -> cooked

Key Rules

  • 7-day expiration window for inbox items
  • Expired inbox recipes are auto-cleaned with safeguards
  • Review and tab UI surfaces urgency and expiring counts

Notifications

CookOrDelete schedules and manages:

  • Weekly review reminders (user-configurable day/time)
  • Expiring-soon reminders
  • Daily urgent expiration notifications
  • Cooking reminders tied to planned meals

Notification settings are user-controlled in-app, and scheduling includes cancellation/de-duplication logic to avoid duplicate alerts.

RevenueCat Implementation

Configuration

Uses platform keys via environment variables:

EXPO_PUBLIC_REVENUECAT_IOS_API_KEY EXPO_PUBLIC_REVENUECAT_ANDROID_API_KEY EXPO_PUBLIC_REVENUECAT_TEST_API_KEY

Purchase Flow

  1. App configures RevenueCat SDK.
  2. Authenticated user is mapped to RevenueCat app user ID.
  3. App fetches offerings and customer info.
  4. User purchases or restores.
  5. Active entitlement (pro) controls premium access.
  6. Queries are invalidated to refresh UI state.

Backend Sync

Supabase profile stores subscription_tier (free | premium). RevenueCat webhook updates backend tier state. Client invalidates/refetches profile after purchase/restore to align UI with backend truth.

Scalability & Reliability

  • Query-based cache invalidation for consistency
  • Retry-aware sync patterns for unstable networks
  • Local hydration to reduce empty-state flashes
  • Lifecycle safeguards around expiration and planned meals
  • Separation of concerns between UI, domain providers, and service modules

Summary

CookOrDelete combines a behavior-first product model (Cook or Delete) with production-grade mobile architecture: Expo + React Query on the client, Supabase for backend data/auth, and RevenueCat for subscription monetization. The result is a focused system that drives weekly user action, not passive content accumulation.