Deployment

Building and deploying the app to Web, Android, and iOS

Deployment

BabyShopHub is built with Flutter and supports cross-platform deployment. Follow these steps to generate release builds for production.

Prerequisites

  • Ensure all environment variables and API keys (Firebase, Groq, Cloudinary) are set for production.
  • Run flutter clean and flutter pub get to ensure a fresh environment.

Web Deployment

Flutter Web builds a highly optimized single-page application (SPA).

  1. Build Command:

    flutter build web --release --web-renderer canvaskit

    Note: We use CanvasKit for better performance and fidelity, though it increases the initial load size.

  2. Hosting: The output is generated in build/web/. You can deploy this directory to Firebase Hosting, Vercel, or any static file server.

    firebase deploy --only hosting

Android Deployment

  1. Update Version: Update the version field in pubspec.yaml (e.g., 1.0.0+1).

  2. Sign the App: Ensure you have configured key.properties and your build.gradle is set up to sign the release APK/AAB with your production keystore.

  3. Build Command:

    # For Play Store
    flutter build appbundle
     
    # For direct distribution
    flutter build apk --release

iOS Deployment

Building for iOS requires a macOS machine with Xcode installed.

  1. Update Version: Update the version in pubspec.yaml.

  2. Xcode Setup: Open ios/Runner.xcworkspace in Xcode.

    • Set your Team and Provisioning Profile in the "Signing & Capabilities" tab.
    • Increment the Build Number if necessary.
  3. Build Command:

    flutter build ipa --release
  4. Distribution: Upload the generated .ipa file using the Transporter app or Xcode's Organizer to App Store Connect.

On this page