Generated output — this is a static snapshot rendered from .vibekb/. The .vibekb/ content is the source of truth. See Reference for provenance.

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

High impact Verified from source

Cold-start bootstrap: dotenv, RevenueCat, Firebase, analytics, notifications, Superwall, deep links, and startup routing into onboarding, paywall, or MainScaffold.

Runs when
Every cold start and when AppLinks or notification payloads arrive.
Depends on
lib/core/config/env_config.dart lib/firebase_options.dart lib/core/subscription/subscription_service.dart
Depended on by
almost all features
Test after change
Cold start for anonymous, free, and paid users; deep links; notification open paths.

lib/firebase_options.dart

High impact Verified from source

Env-backed DefaultFirebaseOptions for Android/iOS only; missing keys assert at startup.

Runs when
Firebase.initializeApp during bootstrap.
Depends on
lib/core/config/env_config.dart
Depended on by
lib/main.dart
Test after change
Cold start with complete Firebase env names present.

lib/core/config/env_config.dart

High impact Verified from source

Typed accessors for environment variable NAMES used by Firebase, purchases, AI, and analytics. Never commit values.

Runs when
Whenever a service reads configuration.
Depended on by
auth; purchases; AI features; analytics
Test after change
Missing-key behavior; ensure no secrets are logged.

lib/core/auth/auth_service.dart

High impact Verified from source

Firebase Auth (Google, Apple, email) plus RevenueCat/Mixpanel identity sync and users/{uid} profile writes. Google OAuth fallbacks are placeholders when env is missing.

Runs when
Sign-in, sign-out, and auth state changes.
Depends on
lib/core/config/env_config.dart
Depended on by
AuthCubit; onboarding; community
Test after change
Google/Apple/email sign-in; anonymous upgrade; RevenueCat logIn.

lib/core/repositories/user_repository.dart

High impact Verified from source

Central Firestore user document hub for profile, streak mirrors, subscription fields, and related user subcollections.

Runs when
Profile reads/writes and many feature repositories.
Depends on
Firebase Auth Cloud Firestore
Depended on by
home; settings; streak; onboarding
Test after change
Profile edit; streak mirror; auth user document creation.

lib/core/subscription/subscription_service.dart

High impact Verified from source

Paid-access decisions from Superwall subscription status and RevenueCat CustomerInfo. Firestore subscription fields are not the entitlement source of truth.

Runs when
Gating checks throughout the app and at startup routing.
Depends on
Superwall RevenueCat
Depended on by
startup; onboarding completion; accountability; home banners
Test after change
Free vs paid routing; bypass accounts; restore purchases.

lib/core/superwall/superwall_purchase_controller.dart

High impact Verified from source

Maps Superwall purchase/restore actions to RevenueCat and syncs subscription status back to Superwall.

Runs when
Purchase, restore, and status sync.
Depends on
purchases_flutter superwallkit_flutter
Depended on by
PrePaywall; home banners
Test after change
iOS and Android purchase/restore paths with a real purchase controller attached.

lib/core/usage/feature_quota_service.dart

Moderate impact Verified from source

Soft-paywall quota counters and Firestore user_feature_quotas helpers. Call sites often gate behind QUOTA_SYSTEM_ENABLED = false.

Runs when
Feature entry points that check free usage limits.
Depends on
Cloud Firestore
Depended on by
learn videos; food scan; rate my plate; chatbot
Test after change
Toggle QUOTA_SYSTEM_ENABLED and confirm limits plus Superwall placements.

lib/features/onboarding/presentation/screens/pre_paywall.dart

Understand dependencies first Verified from source

Primary paywall UI and Superwall placement registration. Many placement IDs remain INSERT_YOUR_* placeholders.

Runs when
End of onboarding or unpaid return to paywall.
Implements
Main paywall
Depends on
lib/core/superwall/superwall_purchase_controller.dart lib/core/subscription/post_purchase_handler.dart
Test after change
Placement registration; paid skip; purchase success; gift/standard placements.

lib/features/onboarding/data/services/onboarding_progress_service.dart

Moderate impact Verified from source

SharedPreferences + Firestore resume checkpoints and onboarding_completed for startup routing.

Runs when
Each onboarding screen save and cold-start resume.
Depends on
lib/core/subscription/subscription_service.dart
Depended on by
lib/main.dart routing
Test after change
Kill-app resume at multiple onboarding screens; completion flag.

lib/features/app/presentation/screens/main_scaffold.dart

Moderate impact Verified from source

Bottom-tab shell hosting Home, Learn, Rewire, Community, and Profile with initialIndex deep-link entry.

Runs when
After paid/onboarding routing reaches the main app.
Depends on
lib/features/app/presentation/screens/home_screen.dart
Depended on by
deep links targeting tabs
Test after change
Tab switching; initialIndex from deep links.

lib/features/app/presentation/screens/home_screen.dart

Moderate impact Verified from source

Daily hub UI: streak, pledge, panic entry, banners, and soft Superwall triggers.

Runs when
Home tab visible.
Depends on
lib/core/streak/streak_service.dart lib/core/subscription/subscription_service.dart lib/core/pledges/pledge_service.dart
Test after change
Banner paywalls; navigation to panic/pledge; streak display.

lib/core/streak/streak_service.dart

Moderate impact Verified from source

Streak persistence (SharedPreferences + Firestore) and home_widget sync. iOS app group id is still group.YOUR_BUNDLE_ID.shared.

Runs when
Streak updates, relapse resets, and widget refreshes.
Depends on
home_widget
Depended on by
home; relapse; post-purchase
Test after change
Streak increment/reset; iOS/Android widget values with a real app group.

lib/core/pledges/pledge_service.dart

Moderate impact Verified from source

Daily pledge/check-in persistence under users/{uid}/pledges.

Runs when
User completes or updates a daily pledge.
Depends on
Cloud Firestore
Depended on by
home dashboard
Test after change
Create pledge success/failure; streak interaction.

lib/features/app/services/panic_flow_manager.dart

Moderate impact Verified from source

Guided multi-step panic intervention orchestration used from Home and deep links.

Runs when
User opens panic flow or stoppr://panic.
Implements
Panic intervention
Depends on
lib/features/panic/presentation/breathing_exercise_panic_screen.dart
Depended on by
home; deep-link-handling
Test after change
Complete panic steps; deep link entry.

lib/core/relapse/relapse_service.dart

Moderate impact Verified from source

Relapse recovery helpers that can reset streak state after a failed check-in.

Runs when
User indicates relapse / failed pledge.
Depends on
lib/core/streak/streak_service.dart
Depended on by
daily-check-in-pledge
Test after change
Relapse path resets streak and recovers UI state.

lib/features/community/data/repositories/community_repository.dart

Moderate impact Verified from source

Community posts/comments Firestore repository for the forum surface.

Runs when
Community tab loads or user posts/comments.
Implements
Community forum
Depends on
Cloud Firestore Firebase Auth
Depended on by
community Cubits
Test after change
Create post/comment; blocked-user filtering path.

lib/features/accountability/data/repositories/accountability_repository.dart

Moderate impact Verified from source

Accountability partnerships and matching pool persistence.

Runs when
Partner invite, accept, or pool matching flows.
Depends on
Cloud Firestore lib/core/subscription/subscription_service.dart
Depended on by
accountability UI; widgets
Test after change
Invite/accept partnership; pool entry; paid gating.

lib/features/learn/presentation/cubit/learn_video_cubit.dart

Moderate impact Verified from source

Hardcoded Mux HLS lesson catalog, subtitle assets, and local completion tracking.

Runs when
Learn video list/player opens.
Depends on
SharedPreferences
Depended on by
learn UI
Test after change
Play lesson; completion persistence; quota flag path.

lib/features/app/presentation/screens/chatbot/chatbot_screen.dart

Understand dependencies first Verified from source

Melinda CBT assistant using Groq chat/transcription and OpenAI speech, with daily API interaction limits.

Runs when
Chatbot screen opened.
Depends on
GROQ_API_KEY OPENAI_API_KEY lib/core/api_rate_limit/api_rate_limit_service.dart
Test after change
Text and voice paths; daily rate limit; soft-paywall flag.

lib/features/app/presentation/screens/food_scan/food_scan_screen.dart

Understand dependencies first Verified from source

Sugar/food vision scan UI with Groq-compatible analysis and disabled feature-quota soft paywall.

Runs when
User opens food scan.
Depends on
GROQ_API_KEY lib/core/usage/feature_quota_service.dart
Test after change
Scan a plate photo; quota disabled vs enabled; Superwall placement id.

lib/features/nutrition/data/repositories/nutrition_repository.dart

Moderate impact Verified from source

Nutrition Firestore hub for food_logs, daily_summaries, goals, body metrics, and workouts.

Runs when
Food log and nutrition goal operations.
Depends on
Firebase Auth Cloud Firestore
Depended on by
scanner; nutrition dashboard
Test after change
Log food; load daily summary; update goals.

lib/features/recipes/data/repositories/recipe_repository.dart

Understand dependencies first Verified from source

Recipe search via Edamam with Spoonacular fallback and OpenAI-assisted detail paths.

Runs when
Recipe search or detail fetch.
Implements
Recipe discovery
Depends on
EDAMAM_API_KEY EDAMAM_APP_ID SPOONACULAR_API_KEY OPENAI_API_KEY
Depended on by
recipes UI
Test after change
Search recipes; fallback path; favorite save.

lib/features/app/presentation/screens/rate_my_plate/rate_my_plate_scan_screen.dart

Understand dependencies first Verified from source

Rate My Plate camera/scoring flow with Groq vision and disabled quota soft paywall.

Runs when
User opens Rate My Plate.
Depends on
GROQ_API_KEY lib/core/usage/feature_quota_service.dart
Test after change
Score a plate; quota flag; Superwall placement id.

lib/features/app/presentation/screens/meditation_screen.dart

Low impact Verified from source

In-app meditation UI also reachable via stoppr://meditation.

Runs when
Meditation opened from Home or deep link.
Depended on by
deep-link-handling
Test after change
Open from Home and stoppr://meditation.

lib/core/challenge/challenge_service.dart

Moderate impact Verified from source

Twenty-eight day challenge progression in SharedPreferences and users/{uid}/challenges.

Runs when
Challenge day/task updates.
Depends on
Cloud Firestore SharedPreferences
Depended on by
challenge UI
Test after change
Advance a challenge day; task completion persistence.

lib/features/fasting/data/repositories/fasting_repository.dart

Low impact Verified from source

Local-only fasting logs and active timer cache in SharedPreferences.

Runs when
Fasting start/stop or history load.
Implements
Fasting tracker
Depends on
SharedPreferences
Depended on by
fasting UI
Test after change
Start/stop fast; history survives restart.

lib/core/notifications/notification_service.dart

Moderate impact Verified from source

Local notifications and FCM preference storage; some payloads map to placeholder Superwall placements.

Runs when
Scheduling, preference changes, and notification open handling.
Implements
Notifications
Depends on
Firebase Messaging
Depended on by
lib/main.dart; settings
Test after change
Schedule local notification; open payload routing; preference toggles.

lib/core/analytics/mixpanel_service.dart

Moderate impact Verified from source

Primary product analytics wrapper around Mixpanel.

Runs when
App events and identity sync after auth.
Depends on
MIXPANEL_API_KEY
Depended on by
many feature screens
Test after change
Event fires after key actions; identify after login.

firestore.rules

High impact Inferred from source

Server-side Firestore access rules for users, community, accountability, and related collections.

Runs when
Every Firestore request.
Depended on by
all cloud data features
Test after change
Rules unit tests / emulator for affected paths.

pubspec.yaml

High impact Verified from source

Package identity (stoppr 7.4.2+1), SDK constraint, and dependency set.

Runs when
Build and dependency resolution.
Test after change
flutter pub get; smoke build.