Files that matter
The files worth understanding
A curated list — not the whole repository. Each file says what it does, when it runs, and how safe it is to change.
lib/main.dart
Cold-start bootstrap: dotenv, RevenueCat, Firebase, analytics, notifications, Superwall, deep links, and startup routing into onboarding, paywall, or MainScaffold.
lib/firebase_options.dart
Env-backed DefaultFirebaseOptions for Android/iOS only; missing keys assert at startup.
lib/core/config/env_config.dart
Typed accessors for environment variable NAMES used by Firebase, purchases, AI, and analytics. Never commit values.
lib/core/auth/auth_service.dart
Firebase Auth (Google, Apple, email) plus RevenueCat/Mixpanel identity sync and users/{uid} profile writes. Google OAuth fallbacks are placeholders when env is missing.
lib/core/repositories/user_repository.dart
Central Firestore user document hub for profile, streak mirrors, subscription fields, and related user subcollections.
lib/core/subscription/subscription_service.dart
Paid-access decisions from Superwall subscription status and RevenueCat CustomerInfo. Firestore subscription fields are not the entitlement source of truth.
lib/core/superwall/superwall_purchase_controller.dart
Maps Superwall purchase/restore actions to RevenueCat and syncs subscription status back to Superwall.
lib/core/usage/feature_quota_service.dart
Soft-paywall quota counters and Firestore user_feature_quotas helpers. Call sites often gate behind QUOTA_SYSTEM_ENABLED = false.
lib/features/onboarding/presentation/screens/pre_paywall.dart
Primary paywall UI and Superwall placement registration. Many placement IDs remain INSERT_YOUR_* placeholders.
lib/features/onboarding/data/services/onboarding_progress_service.dart
SharedPreferences + Firestore resume checkpoints and onboarding_completed for startup routing.
lib/features/app/presentation/screens/main_scaffold.dart
Bottom-tab shell hosting Home, Learn, Rewire, Community, and Profile with initialIndex deep-link entry.
lib/features/app/presentation/screens/home_screen.dart
Daily hub UI: streak, pledge, panic entry, banners, and soft Superwall triggers.
lib/core/streak/streak_service.dart
Streak persistence (SharedPreferences + Firestore) and home_widget sync. iOS app group id is still group.YOUR_BUNDLE_ID.shared.
lib/core/pledges/pledge_service.dart
Daily pledge/check-in persistence under users/{uid}/pledges.
lib/features/app/services/panic_flow_manager.dart
Guided multi-step panic intervention orchestration used from Home and deep links.
lib/core/relapse/relapse_service.dart
Relapse recovery helpers that can reset streak state after a failed check-in.
lib/features/community/data/repositories/community_repository.dart
Community posts/comments Firestore repository for the forum surface.
lib/features/accountability/data/repositories/accountability_repository.dart
Accountability partnerships and matching pool persistence.
lib/features/learn/presentation/cubit/learn_video_cubit.dart
Hardcoded Mux HLS lesson catalog, subtitle assets, and local completion tracking.
lib/features/app/presentation/screens/chatbot/chatbot_screen.dart
Melinda CBT assistant using Groq chat/transcription and OpenAI speech, with daily API interaction limits.
lib/features/app/presentation/screens/food_scan/food_scan_screen.dart
Sugar/food vision scan UI with Groq-compatible analysis and disabled feature-quota soft paywall.
lib/features/nutrition/data/repositories/nutrition_repository.dart
Nutrition Firestore hub for food_logs, daily_summaries, goals, body metrics, and workouts.
lib/features/recipes/data/repositories/recipe_repository.dart
Recipe search via Edamam with Spoonacular fallback and OpenAI-assisted detail paths.
lib/features/app/presentation/screens/rate_my_plate/rate_my_plate_scan_screen.dart
Rate My Plate camera/scoring flow with Groq vision and disabled quota soft paywall.
lib/features/app/presentation/screens/meditation_screen.dart
In-app meditation UI also reachable via stoppr://meditation.
lib/core/challenge/challenge_service.dart
Twenty-eight day challenge progression in SharedPreferences and users/{uid}/challenges.
lib/features/fasting/data/repositories/fasting_repository.dart
Local-only fasting logs and active timer cache in SharedPreferences.
lib/core/notifications/notification_service.dart
Local notifications and FCM preference storage; some payloads map to placeholder Superwall placements.
lib/core/analytics/mixpanel_service.dart
Primary product analytics wrapper around Mixpanel.
firestore.rules
Server-side Firestore access rules for users, community, accountability, and related collections.
pubspec.yaml
Package identity (stoppr 7.4.2+1), SDK constraint, and dependency set.