After Framework

Build products on a shared operating framework.

Build once. Ship across domains.

After Framework gives products a shared foundation: architecture, identity, AI, design systems, tooling, and reusable domain modules.

supercore/packages7 packages · 2 product lines · 1 composition contract
SuperGarageAfterHubSuperHospitalafter_ecosystemafter_aiafter_consumerafter_enterpriseafter_firebaseafter_coreafter_design_system
Legend:pubspec dependencydocumented reference stack

01 · Framework architecture

One kernel. Two product lines. Thin products on top.

Every product shares the same layers. Adding a Life Domain or Industry Domain adds a module at the top — the layers below do not change.

Product-specific

Shared platform

Composition-root adapters

Select a layer to see what it owns and what it depends on.

after_core

Shared kernel

Auth, hardened networking, storage, Riverpod DI, flags, remote config, BYOK AI SDK, premium entitlements, notifications, deep links, and the dashboard, plugin, search and settings engines.

Depends on
None — base layer
Used by
Product domain layer · Ecosystem layer · AI capabilities · Consumer modules · Enterprise modules · Design system · Firebase adapters

Shared reuse, product-specific experience

The platform doctrine targets ninety percent or more of runtime capability inherited per product. A product owns its domain, vertical features, AI profile, catalogs and branding — nothing else.

Rules that keep the system standing

  1. 01Ports over SDKs: vertical code depends on After interfaces, never on vendor SDKs.
  2. 02Vertical modules live only in product repos under lib/features/.
  3. 03Every port ships with a mock, so scaffolds run without a backend.
  4. 04Generate, don't greenfield: new products start from a spec, not a new architecture.

02 · Product factory

From idea to working product on a reusable foundation.

The product factory turns a small product.spec.yaml into a sibling Flutter app that depends on the shared packages. The spec holds only what is unique to the product.

  1. 01

    Idea

    Name the product and pick a line: consumer or enterprise, with SuperGarage or SuperHospital as the reference.

  2. 02

    Domain

    Write product.spec.yaml: domain, vertical features, tabs, permissions, dashboard widgets, AI skills, branding, locales.

  3. 03

    Modules

    Everything not in the spec — auth, membership or org, RBAC, calendar, tasks, notifications, search — is inherited.

  4. 04

    Product shell

    generate_product.ps1 emits the manifest, composition root, feature catalog, shell, l10n files and a CI workflow.

  5. 05

    Deployment

    The generated CI workflow runs format, analyze and tests with coverage on every push and pull request to main.

The product owns

  • Name, package, bundle, product line
  • Vertical features and i18n keys
  • Navigation tabs
  • RBAC permission strings
  • Dashboard widgets
  • AI skills and tool bindings
  • Accent color and monogram

The platform provides

  • Auth and superadmin
  • Membership or organization
  • RBAC engine and audit log
  • Calendar, tasks, documents
  • Notifications and analytics
  • Workflow, dashboard and search engines
  • Design system, splash, CI

Re-running the generator with an evolved spec updates skeleton files without destroying human-authored feature code.

03 · Packages and capabilities

Seven packages. Explicit dependencies.

All packages are version 1.0.0 in the supercore repository and are consumed through path dependencies. Select a package to trace what it depends on and what depends on it.

Shared kernel

after_core

Ports and default implementations for auth, networking, storage, DI, analytics, feature flags, remote config, AI, notifications, deep links and premium entitlements. Products override Riverpod providers with their own adapters.

Depends on
None — base layer
Used by

Key APIs

  • AppPlatformManifest
  • PlatformConfig
  • AfterStandardOverrides
  • AfterBootstrapMode
  • AfterAuthRepository
  • AfterApiClient
  • AfterHttpClientFactory
  • AfterFeatureFlags
  • AfterRemoteConfig
  • AfterAiCredentialVault

Notable third-party dependencies

flutter_riverpod · dio · flutter_secure_storage · shared_preferences · google_sign_in · app_links · flutter_local_notifications

after_ecosystemafter_aiafter_consumerafter_enterpriseafter_firebaseafter_coreafter_design_system

Example

dart
import 'package:after_core/after_core.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:shared_preferences/shared_preferences.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  final prefs = await SharedPreferences.getInstance();

  runApp(
    ProviderScope(
      overrides: [
        afterSharedPreferencesProvider.overrideWithValue(prefs),
        afterAuthRepositoryProvider.overrideWithValue(MyFirebaseAuthRepository()),
        afterAnalyticsProvider.overrideWithValue(MyFirebaseAnalytics()),
        // ... store-specific adapters
      ],
      child: const MySuperApp(),
    ),
  );
}

Source supercore/packages/after_core/README.md (opens in a new tab)

04 · CLI and developer workflow

Scripts and Flutter commands, not magic.

Tooling lives in supercore/scripts as PowerShell scripts, alongside the standard Flutter toolchain. There is no separate packaged CLI binary.

Initialize

Validate a spec without Flutter, then generate the sibling app and bootstrap it.

validate_product_spec.ps1
powershell -File scripts\validate_product_spec.ps1 -SpecPath factory\specs\examples\super_airport.product.spec.yaml

Source supercore/factory/README.md (opens in a new tab)

generate_product.ps1
# From a spec
powershell -File scripts\generate_product.ps1 -SpecPath factory\specs\examples\super_airport.product.spec.yaml

# From a name only (quick starter)
powershell -File scripts\generate_product.ps1 -Name SuperAirport -Reference SuperHospital

# Preview without writing files
powershell -File scripts\generate_product.ps1 -SpecPath factory\specs\examples\super_airport.product.spec.yaml -DryRun

Source supercore/factory/README.md (opens in a new tab)

flutter
cd ..\superairport
flutter create .
flutter pub get
flutter analyze
flutter test

05 · From framework to real products

Shared capabilities become product-specific experiences.

SuperGarage is the shipping consumer reference. Every screen below is a real store screenshot; the overlay shows which parts come from the platform and which the product owns.

SuperGarage screenshot: Vehicle health score and reminders on the garage dashboard.

SuperGarage capability map

Identifiers imported by supergarage/lib, grouped by owning package.

after_core

  • AfterUserPlan
  • AfterAiCredentialVault
  • AfterLocalNotifications

after_consumer

  • FamilyShellHeader
  • AfterRegionalLocation

after_firebase

  • AfterFirebaseBootstrap

Product features

  • features/vehicle
  • features/maintenance
  • features/obd
  • features/expenses
  • features/fleet
  • features/trips
  • features/assistant
  • features/community

Product family

Status as recorded in supercore/catalog/products.yaml. Only SuperGarage is marked shipping.

  • SuperGarage icon

    SuperGarage

    Consumer · Reference

    Mobility: vehicles, maintenance, insurance, fuel, OBD, fleet

    after_core · after_design_system · after_firebase · after_consumer

  • AfterHub icon

    AfterHub

    Consumer · OS shell

    Consumer OS shell: identity, dashboard, AI, calendar, search, After+

    Scaffold

    after_ai · after_consumer · after_core · after_firebase · after_design_system · after_ecosystem

  • SuperHospital icon

    SuperHospital

    Enterprise · Reference

    Hospital operations — enterprise reference

    Scaffold
  • SuperHealth icon

    SuperHealth

    Consumer

    Personal health: medications, records, sleep, nutrition

  • SuperFinance icon

    SuperFinance

    Consumer

    Personal finance: subscriptions, budgets, investments

    Scaffold
  • SuperHome icon

    SuperHome

    Consumer

    Property and household: maintenance, utilities, warranties

    Scaffold
  • SuperTravel icon

    SuperTravel

    Consumer

    Travel: trips, flights, hotels, itineraries

    Scaffold
  • SuperPet icon

    SuperPet

    Consumer

    Pets: veterinary care, food, health records

    Scaffold
  • SuperNews icon

    SuperNews

    Consumer

    AI-personalized news with summaries

  • SuperSports icon

    SuperSports

    Consumer

    Sport and performance: fitness, scores, fixtures

  • SuperAirport icon

    SuperAirport

    Enterprise

    Airport operations: flights, gates, runways

    Scaffold
  • SuperMaritime icon

    SuperMaritime

    Enterprise

    Port and vessel operations

    Scaffold
  • SuperFactory icon

    SuperFactory

    Enterprise

    Factory floor MES and maintenance

    Scaffold
  • SuperFarm icon

    SuperFarm

    Enterprise

    Farm operations: crops, livestock, equipment

    Scaffold

06 · Design system

Consistency without sameness.

after_design_system gives every product the same chrome, density and motion. Products change their accent, monogram, features and copy — not the system.

Tokens

Color, spacing, radius and motion are Dart constants, shared by consumer and enterprise.

Color

  • accent#38BDF8
  • accentDeep#0284C7
  • graphite950#0B0C0F
  • graphite800#222831
  • steel#8A919D
  • lightBackground#FAFBFC
  • success#22C55E
  • warning#F59E0B
  • danger#EF4444

Spacing · 4pt scale

  • xs4
  • sm8
  • md12
  • lg16
  • xxl24
  • xxxl32
  • massive48
  • hero64

Radius

  • 6
  • 8
  • 12
  • 16
  • 20

Motion

  • instant100ms
  • fast · micro180ms
  • normal · page280ms
  • slow · modal420ms
  • emphasis560ms

Components

Buttons, cards, inputs, navigation, dialogs, charts, dashboard, empty and loading states, settings sections and the shell top bar.

  • buttons.dart
  • cards.dart
  • inputs.dart
  • navigation_bar.dart
  • dialogs.dart
  • charts.dart
  • dashboard.dart
  • empty_states.dart
  • loading.dart
  • settings_section.dart
  • shell_top_bar.dart

Accessibility

Light and dark color schemes ship together. Chart series are ordered to stay distinguishable, and motion tokens keep transitions short and purposeful.

Responsive behavior

Page padding and content width adapt to the viewport width through AfterSpacing.

Viewport widthContent maxPage padding
< 360width14 / 10 / 14 / 28
360 – 41952016 / 12 / 16 / 28
420 – 71964020 / 12 / 20 / 28
≥ 72076020 / 12 / 20 / 28

Brand extension

Each product spec declares an accent and monogram. The theme takes the accent through accentOverride; everything else stays in the family.

  • SuperGarage#22D3EE
  • SuperKids#F472B6
  • SuperHospital#F43F5E
  • SuperFactory#F59E0B

07 · Documentation

Documentation built for scanning.

Every page is derived from the supercore repository and links back to its source file.

  • Instant search with keyboard shortcut
  • Sticky table of contents with deep links
  • Copy buttons and syntax highlighting in both themes
  • Package pages with dependency graphs
  • Architecture diagrams with static fallbacks
  • Available in ten languages, with right-to-left support
Open the documentation

08 · Enterprise boundaries

Boundaries that fail closed.

Enterprise isolation is enforced in code and recorded in architecture decision records.

  • Fail-closed tenancy

    Org-scoped enterprise ports require an EnterpriseScope. A missing organizationId throws — they never return all tenants.

  • Permissions before persistence

    Vertical features check PermissionSet.allows(...) before any mutating call. Products declare their own permission strings.

  • Append-only audit

    Every mutating enterprise action must append an AuditLogEntry to the append-only AuditLogRepository.

  • Secure interop only

    Cross-product calls go through AfterSecureInteropBridge: After ID audience, scopes, RBAC and org membership, then a mandatory audit entry.

  • Fail-fast bootstrap

    In production mode a missing adapter throws at startup, so mock providers cannot silently reach production.

  • Modular by construction

    Real backends replace MockEnterpriseRepository at the composition root. The OS layer never learns the vendor's name.

enterprise_scope.dart
/// Fail-closed tenant + actor context for enterprise ports (ADR-002).
class EnterpriseScope {
  final String organizationId;
  final String actorId;
  final PermissionSet permissions;

  /// Throws if [organizationId] is missing/blank — never allow all-tenant lists.
  static String requireOrganizationId(String? organizationId) {
    final id = organizationId?.trim() ?? '';
    if (id.isEmpty) {
      throw StateError(
        'EnterpriseScope: organizationId is required (fail-closed tenancy).',
      );
    }
    return id;
  }
}

Source supercore/packages/after_enterprise/lib/src/scope/enterprise_scope.dart (opens in a new tab)

These are architectural controls documented in the supercore repository. After Framework makes no claims of certification or regulatory compliance.

Enterprise boundaries

Make the product smaller. Make the foundation stronger.

Start with the architecture, read the package docs, or explore the source.