Skip to content

irshadio/melos

Repository files navigation

WAC Flutter monorepo

Two Flutter apps — app_one and app_two — built on one shared, dogmatic MVVM architecture. Managed with Melos 7 over Dart pub workspaces (a single shared lockfile; one resolve for the whole repo).

melos/
  pubspec.yaml            workspace root + Melos scripts
  analysis_options.yaml   shared very_good_analysis baseline
  packages/
    core/                 package:core — shared infra, UI kit and services
  apps/
    app_one/              package:app_one — app/ + features/, com.wacmob.app_one
    app_two/              package:app_two — app/ + features/, com.wacmob.app_two
  docs/                   ARCHITECTURE.md · FLAVORS.md

What is shared (in package:core)

Both apps depend on core and reuse it wholesale:

  • Servicesremote_client HTTP client, sembast LocalStore, flutter_secure_storage SecureStore, DNS-probe connectivity, envied config.
  • State spineViewState<T> / SubmissionState<T> + the RemoteStateMixin / MutationStateMixin that drive every ViewModel.
  • UI kitAppTheme, the shared Poppins font + AppTextStyles, common widgets (ViewStateSwitcher, state views, ConnectivityBanner, PoweredByBadge), context/ref extensions.
  • CompositionbuildCoreOverrides() (the core half of the DI root), Routes, Failure + failure_mapper, AppLogger, ErrorReporter.
  • Shared assets/fonts — bundled in core and consumed by both apps with the package: core prefix (packages/core/Poppins, packages/core/assets/...).

Each app owns only its lib/app/ (composition + routing) and lib/features/ (its own splash + posts). Apps brand themselves via a different theme seed (app_one indigo, app_two teal) over the same shared theme builder.

Prerequisites

  • Flutter 3.44+ / Dart 3.12+ (pub workspaces).
  • Melos: dart pub global activate melos.

Setup

flutter pub get          # resolves the entire workspace (or: melos bootstrap)
melos run gen            # build_runner in every package (codegen is git-ignored)

Generated *.g.dart / *.freezed.dart are not committed. Run melos run gen after cloning or after editing any annotated file — missing generated files before codegen are expected, not errors.

Run an app

cd apps/app_one   # or apps/app_two
flutter run --flavor dev     -t lib/main_dev.dart     --dart-define=APP_ENV=dev
flutter run --flavor staging -t lib/main_staging.dart --dart-define=APP_ENV=staging
flutter run --flavor prod    -t lib/main_prod.dart    --dart-define=APP_ENV=prod

See docs/FLAVORS.md. Android flavours are wired; iOS schemes are a documented manual step.

Quality gate

melos run gate           # gen + analyze + boundaries + loc + test, every package

Individual steps: melos run analyze, melos run boundaries, melos run loc, melos run test. Each runs per-package via melos exec.

Architecture

The rules are intentionally rigid so an agent can add a feature by copying one shape. Read docs/ARCHITECTURE.md and the per-package conventions in CLAUDE.md. The reference single-app scaffold this monorepo is derived from lives at ../mvvm.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages