Skip to content

khode-io/flutter-starter-mororepo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Flutter Khode Starter

A modern Flutter monorepo starter template with Firebase App Distribution, automated build pipelines, and development tooling.

πŸš€ Features

  • Monorepo Structure: Organized Flutter workspace with Melos for package management
  • Firebase Distribution: Automated app distribution to testers with Firebase App Distribution
  • Multi-platform Support: Build for Android (APK/AAB) and iOS (IPA)
  • Development Tooling: Comprehensive scripts and Makefile for development workflows
  • CI/CD Ready: Pre-configured build and distribution pipelines
  • Code Quality: Static analysis, testing, and formatting tools

πŸ“ Project Structure

flutter_khode_starter/
β”œβ”€β”€ apps/
β”‚   └── sample_app/          # Sample Flutter application
β”œβ”€β”€ packages/
β”‚   └── common/              # Shared Dart package
β”œβ”€β”€ config/                  # Build and distribution configuration
β”œβ”€β”€ scripts/                 # Build and automation scripts
β”œβ”€β”€ pubspec.yaml             # Workspace configuration
└── Makefile                 # Development commands

πŸ› οΈ Getting Started

Prerequisites

  • Flutter: SDK ^3.9.0
  • Dart: SDK ^3.9.0
  • FVM (Flutter Version Management): Recommended
  • Firebase CLI: For app distribution
  • Node.js: For Firebase CLI
  • Xcode: For iOS development (macOS only)

Setup

  1. Clone the repository

    git clone <your-repo-url>
    cd flutter_khode_starter
  2. Verify environment setup

    make verify
    # or
    ./scripts/verify-setup.sh
  3. Install dependencies

    make get
    # or
    melos get
  4. Setup Firebase (for distribution)

    # Copy environment file
    cp .env.distribute.example .env.distribute
    
    # Edit configuration with your Firebase settings
    # See apps/sample_app/README.md for detailed setup

πŸš€ Development

Available Commands

Use the Makefile for common development tasks:

# Setup and dependencies
make setup          # Verify environment and get dependencies
make get            # Get dependencies for all packages
make upgrade        # Upgrade dependencies

# Code quality
make format         # Format code
make analyze        # Run static analysis
make test           # Run tests
make quality        # Full quality check (format + analyze + test)

# Building
make build-apk      # Build Android APK
make build-aab      # Build Android App Bundle
make build-ipa      # Build iOS IPA
make build-android  # Build Android app
make build-ios      # Build iOS app

# Distribution
make distribute-android  # Build and distribute Android
make distribute-ios      # Build and distribute iOS

Using Melos

The project uses Melos for workspace management:

# Common commands
melos get           # Get dependencies for all packages
melos test          # Run tests across all packages
melos analyze       # Run static analysis
melos format        # Format code

# Build commands
melos build-android # Build Android
melos build-ios     # Build iOS
melos distribute    # Build and distribute

πŸ“± Building and Distribution

Firebase App Distribution

This project includes pre-configured Firebase App Distribution for automated testing:

  1. Configure Firebase: Follow setup in apps/sample_app/README.md
  2. Build and distribute:
    make distribute-android  # Android
    make distribute-ios      # iOS

Build Artifacts

After building, find artifacts at:

  • Android APK: apps/sample_app/build/app/outputs/flutter-apk/app-release.apk
  • Android AAB: apps/sample_app/build/app/outputs/bundle/release/app-release.aab
  • iOS IPA: apps/sample_app/build/ios/ipa/sample_app.ipa

πŸ—οΈ Architecture

Apps Structure

  • apps/sample_app/: Main Flutter application
    • Cross-platform mobile app
    • Firebase integration ready
    • Pre-configured build pipelines

Packages Structure

  • packages/common/: Shared Dart package
    • Reusable utilities and components
    • Can be published to pub.dev
    • Follows Dart package conventions

Development Tools

  • Melos: Workspace management and automation
  • FVM: Flutter version management
  • Firebase CLI: App distribution and deployment
  • Makefile: Simplified development commands

πŸ”§ Customization

Adding New Apps

  1. Create new app in apps/ directory:

    cd apps
    flutter create my_new_app
  2. Update workspace configuration in root pubspec.yaml:

    workspace:
      - packages/common
      - apps/sample_app
      - apps/my_new_app  # Add your new app
  3. Configure build settings in .env.distribute:

    APP_NAME=my_new_app
    PLATFORM=both

Adding New Packages

  1. Create package in packages/ directory:

    cd packages
    flutter create --template=package my_package
  2. Update workspace configuration in root pubspec.yaml

πŸ“‹ Scripts Overview

  • scripts/verify-setup.sh: Environment verification
  • scripts/flutter-build.sh: Multi-platform build script
  • scripts/firebase-distribute.sh: Firebase distribution script
  • scripts/configure-firebase.sh: Firebase configuration helper

πŸ§ͺ Testing

Run tests across all packages:

make test
# or
melos test

πŸ“Š Code Quality

Ensure code quality with:

make quality
# or
make format && make analyze && make test

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run quality checks: make quality
  5. Submit a pull request

πŸ“– Documentation

  • Sample App: apps/sample_app/README.md - Detailed Firebase setup and distribution
  • Common Package: packages/common/README.md - Package documentation
  • Scripts: See inline comments and help in each script

πŸ› Troubleshooting

Common Issues

  • Firebase CLI authentication: Run firebase login
  • iOS build issues: Ensure Xcode and provisioning profiles are configured
  • Android build issues: Check Android SDK and build tools
  • Environment setup: Run make verify to check prerequisites

Getting Help

  1. Check existing documentation
  2. Review Firebase Console for distribution issues
  3. Verify environment setup with make verify
  4. Check build logs for specific errors

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Flutter team for the amazing framework
  • Firebase for distribution tools
  • Melos for workspace management
  • Open source community for tooling and inspiration

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published