For buyers, product owners & developers

🌰 Almond β€” Documentation & Setup Guide

Whether you're evaluating the app, planning a rebrand, or setting up the code, this guide balances visual, plain-language explanations with technical setup details. Start with App Overview if you're new β€” jump to Getting Started when you're ready to build.

App Overview UI/UX FAQ User Journey Getting Started Branding Guide

Beginner's Guide β€” No Coding Required to Start

Simple, visual, step-by-step instructions for buyers who have never opened a code editor. Technical details are optional β€” follow the pictures.

What you need

A Windows, Mac, or Linux computer, an internet connection, and about 1–2 hours for first-time setup. You do not need to understand programming β€” just follow each step in order.

Try the app instantly (no setup)

Open the demo/ folder in the download package. Install app-release.apk on any Android phone to test the full app β€” onboarding, diary, recipes, and meal plans β€” without building anything.

Diary screen preview

Unzip the project folder

Extract almond-source.zip to a simple location like Documents/Almond. You should see folders named lib, assets, android, and files named index.html and pubspec.yaml.

πŸ“ Almond/
  πŸ“ assets/ ← images & icons
  πŸ“ lib/ ← app screens
  πŸ“ android/ ← Android build files
  πŸ“ screenshots/ ← all app screenshots
  πŸ“„ index.html ← open this documentation
  πŸ“„ pubspec.yaml

Install Flutter (one-time)

Go to docs.flutter.dev/get-started/install and download Flutter for your operating system. Run the installer, then open Terminal (Mac) or Command Prompt (Windows) and type flutter doctor. Fix any items marked with a red βœ— by following the on-screen links.

Install Android Studio (for Android builds)

Download Android Studio from Google. During setup, accept the Android SDK license when prompted. This gives you a phone emulator so you can test the app on your computer without a physical device.

Open the project & run the app

Open Android Studio β†’ File β†’ Open β†’ select the unzipped Almond folder. Wait for indexing to finish, then open the built-in terminal at the bottom and type:

flutter pub get
flutter run

Select an emulator or connected phone when prompted. The app will build and launch β€” first build may take 5–10 minutes.

Onboarding screen after first run

Rebrand the app (change name & colors)

You don't need to touch code for a basic rebrand. Follow the visual Branding Guide β€” it shows exactly which files to replace for your logo, app name, and colors, with before/after pictures.

Profile settings screen

Need more detail?

See Visual Setup Guide for folder diagrams, or Environment Setup for Firebase and API keys.

App Overview β€” What Almond Does

A visual tour of every primary screen. Written for non-technical buyers β€” technical file paths are optional notes at the bottom of each card.

In one sentence

Almond is an all-in-one health companion: users set personal goals, log meals and water, track weight and activity, browse meal plans and recipes, and review nutrition trends β€” all from a single diary-style home screen.

Four main areas users see every day

Diary β€” daily home base

Calendar at the top, nutrition ring, meal slots (breakfast β†’ dinner), water, weight, and activity β€” all for the selected day.

Meal Plans β€” structured programs

Ready-made plans (weight loss, muscle gain, vegetarian, etc.) with weekly schedules and shopping lists.

Recipes β€” browse & cook

Searchable recipe catalog with photos, ingredients, steps, and one-tap β€œadd to meal” logging.

Profile β€” settings & goals

Language, dark/light theme, notifications, nutrition targets, and weight goal management.

Screenshot gallery β€” all primary screens (20 screens)

Every core screen is shown below. High-resolution PNGs are in the screenshots/ folder (01–20) inside the download package.

For developers: Screen implementations live under lib/screens/. The diary hub is diary_screen.dart; bottom tabs are in main_navigation_screen.dart.

UI/UX FAQ β€” Common Questions

Quick answers to help buyers understand how the app works from an end-user perspective β€” before diving into code.

What does the user see when they open the app for the first time?
A branded splash screen, then a friendly 7-step onboarding wizard (goal, gender, activity, weight, target, height, age). The app calculates personalized daily calorie and macro targets, then lands on the Diary tab. See: Onboarding & Diary screenshots above
How do users log what they eat?
From the Diary β†’ Today's Meals, users tap a meal slot (breakfast, lunch, etc.) and choose:
  • Search β€” type a food name from the built-in database
  • Barcode scan β€” point the camera at a product label
  • AI photo recognition β€” snap a photo of the plate (requires OpenAI API key; marked as Pro)
Portion size can be adjusted before saving. Logged items update the nutrition ring instantly.
What is the Diary tab and why is it the home screen?
The Diary is the daily command center. Users pick a date on the calendar strip and see everything for that day: calories consumed vs. goal, water intake, weight entry, activity summary, and all meals. It replaces the need to jump between separate apps for nutrition, hydration, and fitness tracking.
How do Meal Plans differ from Recipes?
Meal Plans are multi-week structured programs (e.g. "Lean Muscle Builder" for 6 weeks) with a day-by-day schedule and checklists. Recipes are individual dishes users can browse, cook, and log one at a time. Both can generate a shopping list from their ingredients.
Can users switch between dark and light mode?
Yes. The Profile tab includes a theme toggle. The default theme is dark (purple accent on navy background). Light mode uses a softer grey-blue palette. Buyers can customize both in the branding guide.
Does the app support multiple languages?
Yes β€” English, French, Spanish, and Arabic are included out of the box. Users change language from Profile β†’ Settings. Translation files are in assets/lang/ for easy extension.
What are Premium / Pro features?
The app includes a subscription paywall screen with monthly, quarterly, and yearly pricing tiers. AI food photo recognition is gated behind Pro. Buyers can connect their own payment provider or adjust which features require a subscription. See: Premium screenshot above
How does water tracking work?
Users set a daily water goal and tap quick-add buttons (e.g. 250 ml, 500 ml) or enter a custom amount. Progress appears on the Diary header and in the water panel. Optional push reminders nudge users to stay hydrated.
How does weight tracking work?
Users log their weight on any day from the Diary. A charts screen shows trends over time. Goal Management lets users set current weight, target weight, goal type (lose/gain/maintain), and activity level β€” the app then recalculates daily calorie targets using the Mifflin-St Jeor formula.
Is there a demo I can try without building the app?
Yes. A pre-built demo APK is included at demo/app-release.apk. Install it on any Android device to experience onboarding, diary logging, meal plans, and recipes immediately.
What do I need beyond the purchase to run AI features?
AI food recognition requires your own OpenAI API key (paid, billed by OpenAI per use), stored as a Firebase secret on a deployed Cloud Function β€” the key is never bundled in the app. See Publisher Setup for deployment steps. Barcode scanning uses the free Open Food Facts API β€” no key needed. Firebase has a free tier; charges may apply at scale.

Ready to customize or build?

Continue to the Branding Guide to rebrand colors and logo, Getting Started for setup steps, or Navigation Flow for technical architecture diagrams.

Navigation Flow & Data Architecture

Understand how screens interact, transition, and connect with underlying controllers and persistence layers.

Application Screen Hierarchies

Dynamic rendering of transitions from startup to tab views and detail drawers.

graph TD
    A[Splash Screen] -->|Checks Questionnaire Completed| B[User Questionnaire]
    B -->|Persists Goals & Recalculates Targets| C[Main Navigation Screen]
    A -->|If Already Completed| C
    
    C -->|Tab 1| D[Diary Dashboard]
    C -->|Tab 2| E[Meal Plans List]
    C -->|Tab 3| F[Recipes Browser]
    C -->|Tab 4| G[Profile Settings]

    D -->|SelectedDateProvider syncs sub-widgets| H[Nutrition Panel]
    D -->|Meals Log sub-widget| I[Meals Screens Feed]
    D -->|Fluid logger sub-widget| J[Water Tracker Screen]
    D -->|Weight entries sub-widget| K[Weight Tracker Screen]
    D -->|Physical logs sub-widget| L[Activity Tracker Screen]

    E -->|Select Template| M[Meal Plan Detail Screen]
    M -->|Persist Active Plan in SQLite| C
    M -->|Extracts Ingredients| N[Grocery / Shopping List Screen]

    F -->|Select Recipe Card| O[Recipe Details Screen]
    O -->|Modifies Portions Dynamically| O
    O -->|Pushes Ingredients| N

    subgraph Firebase["Cloud Firestore"]
      FB1[(recipes)]
      FB2[(foods)]
      FB3[(meal_plans)]
    end

    F -->|RecipeService| FB1
    I -->|FoodService| FB2
    E -->|MealPlanService sync| FB3
    FB3 -->|Cache catalog + meals| E

    K -->|Click 'Manage Goals'| P[Goal Management Screen]
    P -->|Recalculates Basal Metabolic Rate| H
          
Entry & routing Onboarding wizard Main tab screens Detail / drawer screens Firebase catalog sync
How to read this diagram: Arrows show navigation direction. The Diary tab is the central hub β€” nutrition, meals, water, weight, and activity panels all sync to the selected calendar date via SelectedDateProvider. Detail screens (recipe, meal plan, food search) push on top of tabs and return without losing tab state.

Bottom Tab Navigation Map

Annotated map of the four persistent tabs in main_navigation_screen.dart.

flowchart LR
    subgraph Tabs["Main Navigation β€” 4 Tabs"]
      T1["πŸ“– Diary
diary_screen.dart"] T2["πŸ• Meal Plan
meal_plan_screen.dart"] T3["🍽 Recipes
recipes_screen.dart"] T4["πŸ‘€ Profile
profile_settings_screen.dart"] end T1 --> D1["Nutrition panel"] T1 --> D2["Meals feed"] T1 --> D3["Water tracker"] T1 --> D4["Weight tracker"] T1 --> D5["Activity tracker"] T2 --> M1["Meal plan detail"] M1 --> M2["Shopping list"] T3 --> R1["Recipe detail"] R1 --> R2["Shopping list"] T4 --> P1["Nutrition goals"] T4 --> P2["Goal management"]

Food Logging User Flow

How buyers reach meal logging from the Diary hub.

flowchart TD
    A[Diary β†’ Meals panel] --> B{Add food method}
    B -->|Search| C[Food Search Screen]
    B -->|Barcode| D[Scan Barcode Screen]
    B -->|Camera| E[AI Photo Recognition]
    C --> F[Meal Details Screen]
    D --> F
    E --> G[Food Recognition Details]
    G --> F
    F --> H[(SQLite meal log)]
    H --> I[Nutrition totals update on Diary]
            

GetX Routing & DI Registration

Navigation is mapped using named routes declared in lib/config/routes/app_routes.dart. Dependency Injection (DI) is handled on app startup via lib/config/bindings/initial_binding.dart, which lazily registers controllers globally to avoid boilerplate loading inside individual view sheets.

User Journey & Onboarding Flow

Step-by-step annotated flowcharts showing what first-time and returning users experience β€” from splash to daily tracking.

First Launch vs Returning User

Routing logic in splash_screen.dart and OnboardingMiddleware (app_routes.dart).

flowchart TD
    Start([App Launch]) --> Splash[Splash Screen]
    Splash --> Check{Questionnaire
completed?} Check -->|No β€” first time| Q[7-Step Onboarding Wizard] Check -->|Yes β€” returning| Home[Main Navigation / Diary] Q --> QDone[Save goals to SQLite
isQuestionnaireFinished = true] QDone --> Home Home --> Daily[Daily tracking loop:
log meals, water, weight, activity]
Onboarding completion is stored in localStorage under isQuestionnaireFinished. Returning users skip directly to the Diary tab. To test onboarding again during development, clear app data or remove this key.

Onboarding Wizard β€” 7 Steps

Sequence inside user_questionnaire_screen.dart. Each step collects data used for BMR and macro targets.

flowchart LR
    S1["1. Goal type
lose / build / maintain / health"] S2["2. Gender"] S3["3. Activity level"] S4["4. Current weight"] S5["5. Target weight"] S6["6. Height"] S7["7. Age β†’ Finish"] S1 --> S2 --> S3 --> S4 --> S5 --> S6 --> S7 S7 --> Calc["Mifflin-St Jeor BMR
+ activity multiplier"] Calc --> Save["Persist to SQLite
+ nutrition goals"]

Annotated screenshot β€” navigation map

The Diary screen is the home base. Numbered pins show where users navigate from here.

Diary with navigation pins Header stats Nutrition ring Meals panel β‘  Diary β‘‘ Meal Plan β‘’ Recipes β‘£ Profile
1Diary tab β€” daily hub with calendar, nutrition, meals, water, weight, activity
2Meal Plan tab β€” browse structured programs β†’ tap a plan for week/day schedule
3Recipes tab β€” search & filter recipes β†’ tap for ingredients, steps, add to meal
4Profile tab β€” language, theme, notifications, goals, account settings
+Center mascot button β€” quick-add shortcut (customizable in code)

Annotated journey timeline

1

Splash & route decision

App initializes Firebase, SQLite, notifications, and locale. Splash checks whether onboarding was completed, then routes to /questionnaire or /home.

2

Onboarding questionnaire (first launch only)

Seven animated steps collect goal, demographics, and measurements. On finish, daily calorie and macro targets are calculated and saved locally.

3

Diary dashboard β€” daily hub

User lands on the Diary tab. The week calendar drives all sub-panels (nutrition ring, meals, water, weight, activity) for the selected date.

4

Log food & track progress

From Diary β†’ Meals, users search foods, scan barcodes, or use AI photo recognition. Water, weight, and activity can be logged from their respective panels.

5

Meal plans & recipes

Meal Plan and Recipes tabs browse Firebase catalogs. Selecting a plan or recipe opens a detail screen; ingredients can be pushed to the shopping list.

6

Profile & goals

Profile tab manages language, theme, notifications, nutrition goals, and weight goal management. Changes can trigger macro recalculation prompts.

Application Modules

Direct links and overviews of the core components asked to deconstruct.

Onboarding

User Onboarding Questionnaire

user_questionnaire_screen.dart

Handles user demographic information gathering, weight goal setting, and computes initial caloric/macronutrient values on first setup.

  • Vertical Weight Sliders
  • Target Calorie Formulas
  • Measurement Unit Service
Explore Details →
Diary

Diary Dashboard Hub

diary_screen.dart

The primary landing dashboard displaying aggregate statistics (consumed calories, weight logs, active minutes) synchronized by date.

  • SelectedDateProvider Sync
  • Sub-trackers Assembly
  • TableCalendar Custom Styling
Explore Details →
Meal Plan

Meal Plan Details

meal_plan_detail_screen.dart

Renders detailed week-by-week calendar of recipes for weight loss, keto, or muscle building templates with lock/unlock filters.

  • SQLite Plan Subscriptions
  • Dynamic Checklist Persistence
  • Grocery List Compilation
Explore Details →
Recipes

Recipe Details & Walkthrough

recipe_details_screen.dart

Interactive ingredients viewer with dynamic servings modifier, cooking directions tabs, and advanced macro charts.

  • Serving Portion Multiplier
  • NestedScrollView Silver Layouts
  • Dynamic Ingredients Tab
Explore Details →
Weight Tracker

Goal Settings Management

goal_management_screen.dart

Weight goals manager that monitors unit conversions (kg & lbs) and recalculates macro requirements upon target variations.

  • Goal Settings Sync
  • MeasurementUnitService
  • recalculation Prompt dialog
Explore Details →
Firebase

Firestore Data Layer

lib/core/firebase/

Recipes, foods, and meal plan catalogs are loaded from Cloud Firestore. Seeders populate collections from mock/seed data on first launch.

  • RecipeService & FoodService
  • MealPlanService + SQLite sync
  • .env seed flags
Explore Firebase →
Seed Data

Mock & Seed Sources

lib/helpar/mock/ & lib/core/firebase/

Static recipe mock data and food/meal-plan seed files used to populate Firestore when collections are empty.

  • recipes-mock-data.dart
  • food_seed_data.dart
  • meal_plan_seed_data.dart
Explore Firebase →
Reference

Legacy Mock Services

lib/helpar/mock/recipes-mock-data.dart

MockRecipeService remains in the mock file for reference and Firestore seeding. Runtime recipe/food flows use Firebase services.

  • 24 recipe summaries
  • Full recipe template JSON
  • RecipeFirestoreSeeder source
Explore Firebase →

Deep-Dive Module Deconstruction

Click tabs to view the file analysis, code outlines, and architectural rules for each section.

Onboarding Questionnaire Flow

vertical_weight_slider Mifflin-St Jeor Formula GetStorage Persistence

The UserQuestionnaire screen maps a 8-step wizard form to register new users' parameters. Rather than generic text forms, it builds horizontal/vertical scroll dials using custom sliders.

  • State Flow: Stores progress in a local memory Map userAnswers (age, weight, height, goal, gender, activityLevel) and moves through pages via an animated PageView wrapper.
  • BMR Nutritional Equation: On complete, calculates target calories using the Mifflin-St Jeor formula:
    Male: BMR = (10 × wt_kg) + (6.25 × ht_cm) - (5 × age) + 5
    Female: BMR = (10 × wt_kg) + (6.25 × ht_cm) - (5 × age) - 161
  • Activity Multipliers: BMR is scaled according to activity:
    β€’ Sedentary: 1.2 | Lightly Active: 1.375 | Moderately Active: 1.55 | Very Active: 1.725
  • SQLite & Storage Sync: Saves goals in the local SQLite table via WeightTrackerController.addWeightGoal() and flags setup completion in GetStorage so splash directs them directly to dashboard on next boot.
Structure Summary
// user_questionnaire_screen.dart Outline
class UserQuestionnaire extends StatefulWidget { ... }

class _UserQuestionnaireState extends State<UserQuestionnaire> {
  Map<String, dynamic> userAnswers = {
    'goal': '',
    'currentWeight': 0.0,
    'targetWeight': 0.0,
    'height': 0.0,
    'age': 0,
    'gender': 'male',
  };
  
  List<QuestionnaireStep> steps; // 8 configuration wizard steps
  PageController _pageController;
  int _currentPage = 0;

  void _finishQuestionnaire() async {
    // 1. Compute Mifflin-St Jeor BMR base
    // 2. Scale by selected activity multiplier
    // 3. Save WeightGoal into Database via SQLite
    // 4. Save initial NutritionGoals
    // 5. Route to named Main Navigation screen
  }
}

Diary Dashboard Architecture

SelectedDateProvider TableCalendar Staggered Animations

The DiaryScreen acts as the central dashboard hub for the user. It aggregates sub-widgets mapping food calories, fluid tracker levels, weight metrics, and active minutes.

  • Date-Driven Binding: Rather than passing parameters down nested trees, the date is managed globally via SelectedDateProvider. Sub-widget controllers listen to date changes and dynamically reload SQLite tables.
  • Staggered Loading UI: Employs three distinct AnimationController instances (header, calendar, content components) executing slide/fade transitions on start to create a premium feel.
  • Developer Debugging: Features a cleanup button in the header that invokes DatabaseHelper.clearAllTables() and erases GetStorage preferences for reset testing.
Structure Summary
// diary_screen.dart Outline
class DiaryScreen extends StatefulWidget { ... }

class _DiaryScreenState extends State<DiaryScreen> {
  // Sync State Controllers
  WaterTrackerController waterController;
  WeightTrackerController weightController;
  MealsController mealsController;
  
  DateTime _selectedDay = DateTime.now();
  
  // 3-way staggered animations
  AnimationController _headerAnimationController;
  AnimationController _calendarAnimationController;
  AnimationController _contentAnimationController;

  // Assembles subcomponents inside body list
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        children: [
          _buildCustomAppBar(), // Display Quick stat indicators
          _buildCalendarStrip(), // TableCalendar week view
          _buildDashboardItems(), // Nutrition, Water, Weight panel views
        ]
      )
    );
  }
}

Meal Plan Calendar & Active Schedules

Firebase Sync SQLite User State Shopping Aggregation

The MealPlanDetailScreen reads meals from local SQLite (synced from Firestore). Catalog metadata and recipeIds come from the meal_plans collection; progress and active-plan state stay on-device.

  • Firestore catalog: MealPlanService fetches plans from collection meal_plans. MealPlanController.refreshMealPlans() upserts catalog rows and re-syncs meals when recipeIds change in Firebase.
  • Paywall Validation: Reads local variables to toggle premium intro sliders. If user is locked, details are hidden behind a premium banner.
  • SQLite Database Mapping: Completes items by persisting changes inside database:
    β€’ Calls DatabaseHelper.updateMealCompletion(rowId, status).
    β€’ Reflects completion states by rendering check indicators inside the Day Strip list.
  • Grocery Accumulator: Aggregates all ingredients matching the plan's duration and routes to MealPlanShoppingListScreen.
Structure Summary
// meal_plan_detail_screen.dart Outline
class MealPlanDetailScreen extends StatefulWidget { ... }

class _MealPlanDetailScreenState extends State<MealPlanDetailScreen> {
  int selectedWeek = 1;
  int selectedDay = 1;
  Set<String> _checkedMeals = {}; // Track checked items
  
  Future<void> _loadMealsForWeekMeals() async {
    final dbHelper = DatabaseHelper();
    // Fetch plan configurations matching week index
    final all = await dbHelper.getMealsForPlan(mealPlanId: widget.plan.id);
  }

  void _toggleMealCompletion(Map meal, String uniqueId, bool isChecked) async {
    final dbHelper = DatabaseHelper();
    await dbHelper.updateMealCompletion(meal['row_id'], isChecked ? 1 : 0);
    // Update calendar markers
  }
}

Recipes Details & Servings Multiplier

NestedScrollView Servings Modifier CachedNetworkImage

The RecipeDetailsScreen displays recipe directions, equipment needs, and scaling requirements using a TabBar layout.

  • Sliver Animation Layout: Embeds header images in a NestedScrollView with custom SliverAppBar headers that collapse into narrow navigation titles during scroll gestures.
  • Dynamic Serving Multiplier: Offers interactive buttons (+/-) to scale ingredient servings. Modifying serving count updates ingredient fractions dynamically:
    β€’ Display Amount = Base Amount × (New Servings / Base Servings)
  • Overview Analytics: Pulls macro variables from recipeNutritions array to build visual charts.
Structure Summary
// recipe_details_screen.dart Outline
class RecipeDetailsScreen extends StatefulWidget { ... }

class _RecipeDetailsScreenState extends State<RecipeDetailsScreen> {
  int servings = 2;
  int originalServings = 2;
  List<RecipeIngredient> originalIngredients;
  
  // Servings modification formula
  double getScaledAmount(double baseAmount) {
    return baseAmount * (servings / originalServings);
  }

  Widget _buildIngredientsTab(FullRecipe recipe) {
    // Loops through list and prints scaled values
    // Double tap scales list, routes shopping ingredients list
  }
}

Weight Target & Recalculate Trigger

GoalTypeEnum recalculate dialog MeasurementUnitService

The GoalManagementScreen handles user weight goals configuration, managing unit toggles (lbs/kg) and triggering calorie recalculations.

  • Unit Scaling Conversion: Uses MeasurementUnitService to run calculations:
    β€’ Lbs to Kg: kg = lbs / 2.20462
    β€’ Kg to Lbs: lbs = kg × 2.20462
  • Goal Recalculate Trigger: Compares updated weight entries against original goals. If changes to current/target weight or activity levels exceed 0.1, a prompt asks the user if they'd like to recalculate daily nutritional targets.
Structure Summary
// goal_management_screen.dart Outline
class GoalManagementScreen extends StatefulWidget { ... }

class _GoalManagementScreenState extends State<GoalManagementScreen> {
  TextEditingController currentWeightController;
  TextEditingController targetWeightController;
  GoalTypeEnum selectedGoalType;
  String selectedActivityLevel;

  // Validates change state
  bool _hasActualGoalChanges() {
    // Compare against stored _originalCurrentWeight, _originalTargetWeight
    // Returns true if delta > 0.1
  }

  Future<void> _recalculateNutritionGoals() async {
    // Re-trigger Mifflin-St Jeor formula
    // Save new goals inside NutritionController
  }
}

Firebase Architecture & Environment Variables

firebase_core cloud_firestore cloud_functions flutter_dotenv SQLite cache

Almond uses Cloud Firestore as the remote source of truth for recipes, foods, and meal plan catalogs. FirebaseInitializer runs at app startup (main.dart) when USE_FIREBASE=true.

Firestore Collections

  • recipes β€” Full recipe documents (summary fields + ingredients, directions, nutrition). Read by RecipeService via RecipeController and recipes_screen.dart.
  • foods β€” Food search items with nested servings arrays. Read by FoodService via FoodController and food_search_screen.dart.
  • meal_plans β€” Plan metadata plus recipeIds and macroProfile. Synced to SQLite by MealPlanController for meal_plan_screen.dart and meal_plan_detail_screen.dart.

Seeders (first launch only)

When a collection is empty, seeders upload default data if the matching .env flag is true:

  • RecipeFirestoreSeeder ← lib/helpar/mock/recipes-mock-data.dart (24 recipes)
  • FoodFirestoreSeeder ← lib/core/firebase/food_seed_data.dart (10 foods)
  • MealPlanFirestoreSeeder ← lib/core/firebase/meal_plan_seed_data.dart (3 plans)

.env Files

Environment files are loaded by flutter_dotenv in main.dart. Debug builds use .env.debug; release builds use .env.release.

  • USE_FIREBASE=true β€” Enables Firebase initialization and Firestore services.
  • SEED_FIREBASE_RECIPES=true β€” Seeds recipes if empty.
  • SEED_FIREBASE_FOODS=true β€” Seeds foods if empty.
  • SEED_FIREBASE_MEAL_PLANS=true β€” Seeds meal_plans if empty.
  • AI food recognition β€” routed through Firebase Cloud Function recognizeFoodImage; OpenAI key stored server-side only (see Publisher Setup).

Tip: Set all SEED_FIREBASE_* flags to false after the first successful seed to avoid unnecessary startup work.

.env.example
# .env.debug β€” loaded in debug builds
USE_FIREBASE=true
SEED_FIREBASE_RECIPES=true
SEED_FIREBASE_FOODS=true
SEED_FIREBASE_MEAL_PLANS=true

# .env.release β€” seed flags usually false in production
USE_FIREBASE=true
SEED_FIREBASE_RECIPES=false
SEED_FIREBASE_FOODS=false
SEED_FIREBASE_MEAL_PLANS=false
Data flow
// Recipes
recipes_screen β†’ RecipeController β†’ RecipeService β†’ Firestore recipes

// Foods
food_search_screen β†’ FoodController β†’ FoodService β†’ Firestore foods

// Meal plans (hybrid)
meal_plan_screen β†’ MealPlanController
  β†’ MealPlanService β†’ Firestore meal_plans
  β†’ DatabaseHelper (SQLite cache + is_active, is_completed)

// Startup (main.dart)
FirebaseInitializer.initialize()
  β†’ Firebase.initializeApp()
  β†’ RecipeFirestoreSeeder.seedIfEmpty()   // if SEED_FIREBASE_RECIPES
  β†’ FoodFirestoreSeeder.seedIfEmpty()     // if SEED_FIREBASE_FOODS
  β†’ MealPlanFirestoreSeeder.seedIfEmpty() // if SEED_FIREBASE_MEAL_PLANS
meal_plans document example
{
  "id": 4,
  "name": "My Custom Plan",
  "image": "assets/summerShred.jpeg",
  "weeks": 4,
  "category": "Weight Loss",
  "recipeIds": [163564, 10001],
  "macroProfile": "summerShred"
}

Seed Data & Mock Sources

RecipeFirestoreSeeder FoodFirestoreSeeder MealPlanFirestoreSeeder

Mock and seed files supply initial Firestore content. At runtime, the app reads from Firestore servicesβ€”not from mock services directly (except meal plan SQLite cache for user progress).

  • Recipes: lib/helpar/mock/recipes-mock-data.dart defines mockRecipeSearch, fullRecipeMockData, and MockRecipeService. Used by RecipeFirestoreSeeder.
  • Foods: lib/core/firebase/food_seed_data.dart holds FoodSeedData.commonFoods and full serving details for 10 foods.
  • Meal plans: lib/core/firebase/meal_plan_seed_data.dart defines 3 default plans with recipeIds and macroProfile.
  • Re-seeding: Seeders only run when the target collection has zero documents. Delete the collection in Firebase Console to force a re-seed.
Key files
// Firebase services (runtime)
lib/screens/main/recipes/services/recipe_service.dart
lib/screens/main/meals/services/food_service.dart
lib/screens/main/meal_plan/services/meal_plan_service.dart

// Seeders (startup, if .env flag true)
lib/core/firebase/recipe_firestore_seeder.dart
lib/core/firebase/food_firestore_seeder.dart
lib/core/firebase/meal_plan_firestore_seeder.dart

// Seed / mock data sources
lib/helpar/mock/recipes-mock-data.dart
lib/core/firebase/food_seed_data.dart
lib/core/firebase/meal_plan_seed_data.dart

// Environment
lib/helpar/environment/environment.dart
.env.debug / .env.release

Firebase Setup Guide

Configure Cloud Firestore, native platform files, and environment variables for recipes, foods, and meal plans.

Step 1

Create Firebase Project

Create a project at Firebase Console. Enable Cloud Firestore (test mode for development). Choose a European region if users are in Morocco/EU.

Step 2

Add Platform Config

Register Android (com.almond.userapp) and iOS apps. Place google-services.json in android/app/ and GoogleService-Info.plist in ios/Runner/. Or run flutterfire configure.

Step 3

Configure .env

Set USE_FIREBASE=true and seed flags in .env.debug. Hot restart the app (not hot reload) after changing env values.

Step 4

Verify Collections

After first launch, confirm recipes, foods, and meal_plans appear in Firestore. Turn seed flags off in .env.release for production.

Connect your own Firebase project

The package ships placeholder config in lib/firebase_options.dart, android/app/google-services.json, and ios/Runner/GoogleService-Info.plist. Run flutterfire configure to replace them with your project credentials before publishing.

Firestore Security Rules β€” seed then lock

The app seeds catalog data from the client when collections are empty (SEED_FIREBASE_* flags). Never leave Firestore in test mode (public read/write) in production β€” anyone could modify or delete your catalog.

Recommended workflow:

  1. Temporarily deploy firestore.rules.seed (open rules) β€” copy it over firestore.rules and run firebase deploy --only firestore:rules
  2. Launch the app once with SEED_FIREBASE_*=true to populate recipes, foods, and meal_plans
  3. Deploy production rules from firestore.rules (read-only catalog, no client writes)
  4. Set all SEED_FIREBASE_* flags to false in .env.release
rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /recipes/{document=**} { allow read: if true; allow write: if false; }
    match /foods/{document=**} { allow read: if true; allow write: if false; }
    match /meal_plans/{document=**} { allow read: if true; allow write: if false; }
    match /{document=**} { allow read, write: if false; }
  }
}

Both rule files ship in the project root. Deploy with: firebase deploy --only firestore:rules

Meal plan sync notes

Meal plans use a hybrid model: catalog and recipeIds sync from Firestore; is_active, meal completion, and shopping lists stay in SQLite. Pull-to-refresh on the meal plans screen re-fetches Firebase. Each plan document needs a numeric id field matching its document ID.

Local Development Setup

Follow these steps to run the Almond app on your local machine. Visual folder guides are included for first-time developers.

Visual setup walkthrough

1 Open the project folder

In Android Studio or VS Code: File β†’ Open β†’ select the unzipped Almond folder (the one containing pubspec.yaml).

πŸ“ Almond/
  πŸ“„ pubspec.yaml ← you are here
  πŸ“ lib/
  πŸ“ assets/
  πŸ“ android/
2 Copy environment file

Copy the debug template to create your active config file:

πŸ“„ .env.debug β†’ copy to β†’ .env

USE_FIREBASE=true
SEED_FIREBASE_RECIPES=true
3 Add Firebase config files

From Firebase Console, download and place:

google-services.json β†’ android/app/
GoogleService-Info.plist β†’ ios/Runner/
4 Run in terminal

Open the terminal inside your IDE (bottom panel) and run these commands one at a time:

$ flutter pub get
$ cd ios && pod install && cd ..
$ flutter run

Select a device/emulator when prompted. See screenshot below for expected first screen.

Expected first screen after flutter run

Command reference

bash - almond@macos:~
$ cd your-project-folder # Navigate to the unzipped project root
$ flutter pub get # Download required packages
$ cp .env.debug .env # Optional: copy env template
$ flutterfire configure # Link Firebase project (optional)
$ cd ios && pod install && cd .. # iOS Firebase pods
$ flutter run # Build and run (hot restart after .env changes)

Environment & Firebase Tips

Changes to .env.debug or .env.release require a full app restart. Seeders only populate empty Firestore collectionsβ€”delete documents in the console to re-seed. Set SEED_FIREBASE_*=false after initial data upload.

Getting Started (Non-Technical Guide)

A plain-language walkthrough for buyers who are new to Flutter. No advanced coding knowledge required for initial setup.

Step 1

Install Flutter

Download and install the Flutter SDK from the official site. Follow the install guide for your operating system (Windows, macOS, or Linux).

Step 2

Install Android Studio or Xcode

Android: Install Android Studio and accept SDK licenses.
iOS (Mac only): Install Xcode from the App Store and open it once to accept terms.

  • Android Studio β€” for emulator and APK builds
  • Xcode β€” required for iOS simulator and App Store builds
Step 3

Unzip & Open the Project

Extract the downloaded ZIP to a folder on your computer. Open that folder in Android Studio, VS Code, or Cursor using File β†’ Open.

Step 4

Configure Environment (.env)

The project ships with .env.debug and .env.release templates. Set at minimum:

  • USE_FIREBASE=true
  • SEED_FIREBASE_*=true on first launch only
  • Deploy Cloud Function for AI food recognition (see Publisher Setup)

Create Your Firebase Project

  1. Go to Firebase Console and click Create a project.
  2. Enable Cloud Firestore (start in test mode for development).
  3. Add an Android app β€” package name: com.almond.userapp β€” download google-services.json into android/app/.
  4. Add an iOS app β€” download GoogleService-Info.plist into ios/Runner/.
  5. Alternatively, run flutterfire configure from the project root to automate this step.
  6. Launch the app once β€” seed data will populate empty Firestore collections if seed flags are true.
bash β€” first run
$ cd your-project-folder
$ flutter pub get # Install dependencies
$ cd ios && pod install && cd .. # iOS only
$ flutter run # Run on connected device or emulator

External Service Costs

OpenAI food recognition requires a paid OpenAI API account β€” usage is billed per request by OpenAI, not included in this purchase. Firebase offers a free tier, but costs may apply as your user base and database reads/writes grow. Barcode scanning uses the free Open Food Facts API and needs no API key.

Project Environment Setup

Configure .env files before your first run. All paths below are relative to your unzipped project root β€” no machine-specific locations.

Two environment files

.env.debug β€” loaded when running debug builds (flutter run).
.env.release β€” loaded when building release APK/IPA. Set seed flags to false for production.

Step-by-step

  1. Unzip the package and open the project folder in your IDE.
  2. Open .env.debug in the project root.
  3. Set USE_FIREBASE=true after you have created your Firebase project.
  4. Deploy the recognizeFoodImage Cloud Function and set the OPENAI_API_KEY secret if you need AI food photo recognition (see Publisher Setup).
  5. Leave SEED_FIREBASE_*=true for the first launch only, then set them to false.
  6. Save the file and run a full app restart β€” hot reload will not pick up .env changes.

Environment variables reference

Variable Required Description
USE_FIREBASE Yes Set to true to enable Firebase and Firestore. Set false only for offline experiments.
SEED_FIREBASE_RECIPES First launch Seeds the recipes collection if empty (24 recipes). Set false after first successful seed.
SEED_FIREBASE_FOODS First launch Seeds the foods collection if empty (10 foods).
SEED_FIREBASE_MEAL_PLANS First launch Seeds the meal_plans collection if empty (3 plans).
.env.debug example
USE_FIREBASE=true
SEED_FIREBASE_RECIPES=true
SEED_FIREBASE_FOODS=true
SEED_FIREBASE_MEAL_PLANS=true
.env.release example (production)
USE_FIREBASE=true
SEED_FIREBASE_RECIPES=false
SEED_FIREBASE_FOODS=false
SEED_FIREBASE_MEAL_PLANS=false

External service costs

OpenAI β€” AI food recognition requires your own paid API account. Costs are not included in this item purchase.
Firebase β€” Google offers a free tier; charges may apply as reads/writes and storage grow with your user base.
Barcode scanning β€” uses the free Open Food Facts API; no key required.

Publisher Setup β€” Configure & Ship

End-to-end steps buyers need before publishing: OpenAI for AI food recognition, Firebase placeholders, bundle ID / package name, and Android release signing.

1. OpenAI API key β€” server-side only (Cloud Function)

AI food photo recognition calls OpenAI through a Firebase Cloud Function (recognizeFoodImage). The OpenAI key is stored as a Firebase secret and never ships inside the app binary.

Create an OpenAI account

Sign up at platform.openai.com and add a payment method. AI food recognition is billed per API request β€” not included in this purchase.

Generate an API key

OpenAI Dashboard β†’ API keys β†’ Create new secret key. Copy the key (starts with sk-).

Deploy the Cloud Function

From the project root, install Firebase CLI, link your project, and deploy:

npm install -g firebase-tools
firebase login
firebase use YOUR_PROJECT_ID
firebase functions:secrets:set OPENAI_API_KEY
cd functions && npm install && cd ..
firebase deploy --only functions

The Flutter app calls recognizeFoodImage via cloud_functions in food_image_recognition_service.dart. See functions/README.md for details.

Add food with AI recognition option

2. Firebase β€” use your own project (placeholders included)

The package ships with placeholder values in lib/firebase_options.dart, android/app/google-services.json, and ios/Runner/GoogleService-Info.plist. Replace them with your project:

  1. Install FlutterFire CLI: dart pub global activate flutterfire_cli
  2. From project root run: flutterfire configure
  3. Select or create your Firebase project and register Android (com.almond.userapp or your custom ID) and iOS apps
  4. This overwrites the three config files with your real keys automatically
  5. Set USE_FIREBASE=true in .env and do a full app restart
  6. Deploy Firestore security rules β€” see Firebase Setup for seed-then-lock workflow
  7. Deploy Cloud Functions for AI food recognition β€” see step 1 above

3. Change bundle ID / package name (Android + iOS)

Default ID on both platforms: com.almond.userapp. Change to your own reverse-domain ID (e.g. com.yourbrand.calorieapp) before registering Firebase apps or store listings.

Android android/app/build.gradle β†’ applicationId and namespace
Android android/app/src/main/java/.../MainActivity.java β†’ package line (move folder to match)
iOS ios/Runner.xcodeproj β†’ Runner target β†’ PRODUCT_BUNDLE_IDENTIFIER (or Xcode β†’ Signing & Capabilities)
iOS ios/Runner/Info.plist β†’ uses $(PRODUCT_BUNDLE_IDENTIFIER) automatically
Firebase Re-run flutterfire configure after changing IDs

4. Android release signing (Google Play)

Release builds need a signing keystore. An example config is at android/key.properties.example.

A Create a keystore (one time)
keytool -genkey -v -keystore upload-keystore.jks \
  -keyalg RSA -keysize 2048 -validity 10000 -alias upload

Store upload-keystore.jks in android/. Never commit the keystore or passwords to git.

B Create key.properties

Copy the example file:

cp android/key.properties.example android/key.properties

Edit android/key.properties with your real passwords and paths.

C Wire signing in build.gradle

Add before the android { block in android/app/build.gradle:

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

Inside android {, add a signingConfigs.release block and set buildTypes.release.signingConfig signingConfigs.release. See Flutter docs: Signing the app.

D Build for Play Store
flutter build appbundle --release

Upload build/app/outputs/bundle/release/app-release.aab to Google Play Console.

iOS App Store

Open ios/Runner.xcworkspace in Xcode β†’ set your Team, unique Bundle Identifier, and provisioning profile β†’ flutter build ipa --release. See the Build & Export section for full commands.

Branding & Customization Guide

Rebrand Almond as your own product β€” change the name, icon, colors, fonts, and onboarding visuals. Includes visual before-and-after examples.

Visual branding overview

The default Almond theme uses a purple accent (#534CFF) on a dark navy background (#0f1729). Below you'll find side-by-side mockups and code diffs showing exactly how a rebrand looks before and after editing two key files.

Where to find logos, colors & assets β€” annotated file map

Each numbered pin points to the exact file or folder to edit. Replace the file, save, then rebuild the app.

β‘  App icon & launcher image

assets/
ICON almond_app_icon.png ← replace with your 1024Γ—1024 PNG
almond.png ← in-app mascot image

After replacing the icon, run dart run icons_launcher:create to regenerate Android & iOS launcher icons.

β‘‘ Primary accent color (buttons, tabs, highlights)

lib/utils/
COLOR Colors.dart ← edit onbordingBlue = Color(0xFF534CFF)
THEME Dark_lightmode.dart ← dark/light background mappings

β‘’ App display name

NAME lib/main.dart ← title: 'Almond'
NAME android/app/src/main/AndroidManifest.xml ← android:label
NAME ios/Runner/Info.plist ← CFBundleDisplayName

β‘£ Onboarding illustrations

assets/Steps/
ART alomd_loosing_weight.png
ART almond-building-muscle.png
ART almond_maintain_weight.png
ART almond_better_health.png
lib/screens/onboarding/user_questionnaire_screen.dart ← image references

β‘€ Fonts

FONT fonts/ ← add .ttf files here
FONT pubspec.yaml ← register font families
FONT lib/main.dart ← fontFamily: "Mona Sans"

Before & after β€” logo & app identity

Replace assets/almond_app_icon.png and update the app name in main.dart + platform manifests. The mockups below show the default Almond look vs. a sample rebrand ("VitaFuel" with green accent).

Before β€” Default Almond
🌰
Almond
AI Calorie Tracker
Daily calories
1,840 / 2,100 kcal
Water intake
1.2 L / 2.5 L
Diary Plans Recipes Profile

Icon: assets/almond_app_icon.png
Accent: #534CFF

After β€” Sample Rebrand
πŸ₯—
VitaFuel
Smart Nutrition
Daily calories
1,840 / 2,100 kcal
Water intake
1.2 L / 2.5 L
Diary Plans Recipes Profile

Icon: your 1024Γ—1024 PNG
Accent: #10B981 (example)

Before & after β€” color palette

Primary accent color is defined as onbordingBlue in lib/utils/Colors.dart. Changing this one constant updates buttons, tabs, progress bars, and highlights across the app.

Before β€” Colors.dart
// lib/utils/Colors.dart
Color onbordingBlue = const Color(0xFF534CFF);
Color darkmode = const Color(0xff0f1729);
Color lightPrimary = const Color(0xFF4F46E5);
After β€” your brand colors
// lib/utils/Colors.dart
Color onbordingBlue = const Color(0xFF10B981);
Color darkmode = const Color(0xff0c1a14);
Color lightPrimary = const Color(0xFF059669);

Default color reference (editable in Colors.dart)

Primary accentonbordingBlue #534CFF
Dark backgrounddarkmode #0f1729
Light primarylightPrimary #4F46E5
Success / proteingradientColor #00D261
Snack / alertredgradient #FF6B6B
Warning / fatyelloColor #FFBB0D
Tip: After changing onbordingBlue, do a full restart (flutter run) β€” hot reload may not refresh all themed widgets. For light mode, also update lightPrimary, lightSecondary, and mappings in Dark_lightmode.dart.

Rebranding checklist

  • Replace assets/almond_app_icon.png β†’ run dart run icons_launcher:create
  • Update app name in main.dart, AndroidManifest.xml, and Info.plist
  • Edit onbordingBlue and background colors in lib/utils/Colors.dart
  • Swap onboarding illustrations in assets/Steps/
  • Replace mascot assets (assets/almond.png, emoji PNGs) if desired
  • Optional: change font family in pubspec.yaml + main.dart

File reference β€” what to edit

App Name

Change the Display Name

  • lib/main.dart β€” title: 'Almond' in GetMaterialApp
  • android/app/src/main/AndroidManifest.xml β€” android:label
  • ios/Runner/Info.plist β€” CFBundleDisplayName
App Icon

Replace the Launcher Icon

Replace assets/almond_app_icon.png with your 1024Γ—1024 PNG, then regenerate platform icons:

dart run icons_launcher:create

Config lives in pubspec.yaml under icons_launcher:.

Colors

Theme & Color Palette

  • lib/utils/Colors.dart β€” primary accent colors
  • lib/utils/Dark_lightmode.dart β€” dark/light theme toggle
  • lib/main.dart β€” ThemeData and darkTheme
Fonts

Typography (Mona Sans)

The app uses Mona Sans (SIL Open Font License) from the fonts/ folder. To swap fonts:

  • Add .ttf files to fonts/
  • Register families in pubspec.yaml
  • Update lib/utils/font_family_model.dart and lib/main.dart
Onboarding

Splash & Onboarding Images

Replace illustrations in assets/Steps/ (goal selection, weight loss, muscle building, etc.) with your own branded artwork. Update references in user_questionnaire_screen.dart if filenames change.

Bundle ID

Package / Bundle Identifier

Before publishing, change the app ID to your own:

  • Android: applicationId in android/app/build.gradle
  • iOS: PRODUCT_BUNDLE_IDENTIFIER in Xcode β†’ Runner target

Step-by-step rebranding walkthrough

1. Change app name

  1. Open lib/main.dart β†’ change title: 'Almond' in GetMaterialApp.
  2. Open android/app/src/main/AndroidManifest.xml β†’ update android:label.
  3. Open ios/Runner/Info.plist β†’ update CFBundleDisplayName.

2. Replace logo & app icon

  1. Replace assets/almond_app_icon.png with your 1024Γ—1024 PNG icon.
  2. Run from project root: dart run icons_launcher:create
  3. Rebuild the app β€” new icons appear on home screen and app drawer.

3. Customize colors & theme

  1. Edit accent colors in lib/utils/Colors.dart (primary blues, greens, backgrounds).
  2. Edit dark/light toggle logic in lib/utils/Dark_lightmode.dart.
  3. Adjust global ThemeData in lib/main.dart if you need Material 3 color scheme changes.

4. Swap fonts (optional)

  1. Add .ttf font files to the fonts/ folder.
  2. Register font families under fonts: in pubspec.yaml.
  3. Update lib/utils/font_family_model.dart and fontFamily in lib/main.dart.
  4. Run flutter pub get and restart the app.

5. Onboarding & splash images

  1. Replace images in assets/Steps/ with your branded illustrations.
  2. Update image paths in lib/screens/onboarding/user_questionnaire_screen.dart if filenames change.
  3. Replace assets/almond.png and other root assets as needed.

6. Change bundle ID before store release

  1. Android: change applicationId in android/app/build.gradle.
  2. iOS: open ios/Runner.xcworkspace in Xcode β†’ Runner target β†’ Signing β†’ set your Bundle Identifier.
  3. Register the new bundle ID in Firebase Console and re-download config files.

Troubleshooting

Common build, Firebase, and runtime issues with quick fixes.

Problem Solution
pod install fails (iOS) Run cd ios && pod repo update && pod install && cd ... Ensure Xcode Command Line Tools are installed.
Firebase not connecting / empty data Verify google-services.json and GoogleService-Info.plist are in the correct folders. Set USE_FIREBASE=true in .env.debug. Do a full app restart (not hot reload).
AI food recognition not working Deploy the recognizeFoodImage Cloud Function and set OPENAI_API_KEY via firebase functions:secrets:set. Ensure your OpenAI account has billing enabled.
.env changes ignored Stop the app completely and run flutter run again. Hot reload does not reload environment variables.
Gradle / Android build errors Run flutter clean && flutter pub get, then rebuild. Check Android SDK and Java versions with flutter doctor.
White screen on launch Check debug console for Firebase initialization errors. Confirm Firestore is enabled and config files match your Firebase project.
Barcode scan returns no product The product may not exist in Open Food Facts. Try a known barcode or use manual food search from Firestore.
Seed data not appearing Seeders only run when a collection is empty. Set SEED_FIREBASE_*=true and delete existing documents in Firebase Console, then restart.
iOS build signing errors Open ios/Runner.xcworkspace in Xcode β†’ Signing & Capabilities β†’ select your Team and a unique Bundle Identifier.
flutter pub get fails Run flutter clean, delete pubspec.lock only if needed, then flutter pub get again. Check internet connection and Flutter SDK version (flutter doctor).
Firestore permission denied During seeding, temporarily deploy firestore.rules.seed. After seeding, deploy production firestore.rules (read-only catalog). See Firebase section.
App crashes on startup (Android) Confirm google-services.json is in android/app/ and matches package name com.almond.userapp (or your updated ID).
App crashes on startup (iOS) Confirm GoogleService-Info.plist is in ios/Runner/. Run cd ios && pod install && cd .. after adding Firebase files.
Demo APK from demo/ won't install Enable "Install unknown apps" for your file manager. APK is Android-only. Rebuild with your Firebase config if cloud features fail.

Still stuck?

Run flutter doctor -v and share the output when requesting support via CodeCanyon comments or email at almonddev673@gmail.com.

Build & Export for Deployment

Step-by-step instructions to compile release builds and publish to Google Play and the Apple App Store.

Pre-release

Before You Ship

  • Set all SEED_FIREBASE_*=false in .env.release
  • Tighten Firestore security rules (see Firebase section)
  • Use your own Firebase project β€” never ship demo credentials
  • Change bundle ID / applicationId to your brand
Android

Google Play Release

  1. Create a upload keystore: keytool -genkey ...
  2. Configure signing in android/app/build.gradle
  3. Build AAB: flutter build appbundle --release
  4. Or APK: flutter build apk --release
  5. Upload to Google Play Console
iOS

App Store Release

  1. Enroll in Apple Developer Program
  2. Configure certificates & provisioning in Xcode
  3. Build: flutter build ipa --release
  4. Upload via Xcode Organizer or Transporter
IAP

In-App Purchases

Update product IDs in lib/screens/main/subscription/subscription_screen.dart:

  • App Store Connect β†’ create subscriptions
  • Play Console β†’ Monetize β†’ Products
  • Match IDs: almond_premium_monthly, quarterly, yearly

Android β€” build & export commands

bash β€” Android release
$ cd your-project-folder
$ flutter pub get
$ flutter build apk --release # Output: build/app/outputs/flutter-apk/app-release.apk
$ flutter build appbundle --release # Output: build/app/outputs/bundle/release/app-release.aab (for Play Store)

For Play Store signing, create a keystore with keytool -genkey -v -keystore upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload, then configure signing in android/app/build.gradle and android/key.properties (create this file β€” do not commit passwords to public repos).

iOS β€” build & export commands

bash β€” iOS release
$ cd your-project-folder
$ flutter pub get
$ cd ios && pod install && cd ..
$ flutter build ipa --release # Requires Apple Developer account & Xcode signing

Open ios/Runner.xcworkspace in Xcode to set your Team, Bundle Identifier, and provisioning profile. Upload the generated IPA using Xcode Organizer or Apple Transporter.

Production Firestore Rules

Shipped in firestore.rules at the project root. Catalog collections are read-only for clients:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /recipes/{document=**} { allow read: if true; allow write: if false; }
    match /foods/{document=**} { allow read: if true; allow write: if false; }
    match /meal_plans/{document=**} { allow read: if true; allow write: if false; }
    match /{document=**} { allow read, write: if false; }
  }
}

Use firestore.rules.seed only during initial catalog seeding, then deploy firestore.rules.