Skip to content

Setting Up the Home SDK

What you'll learn

  • Generating the Home SDK with dashboard, profile, and settings pages
  • Understanding the dual-GetIt DI pattern for feature-scoped dependencies
  • Customizing the generated pages for your app's needs
  • Connecting the home feature to your navigation graph

Prerequisites

Step 1: Generate the Home SDK

bash
archipelago generate home_sdk

You will be prompted for:

  • appNameMyApp (must match your monorepo app name)
  • isForMonorepotrue (uses workspace path resolution)

Or use a config file:

json
{
  "appName": "MyApp",
  "isForMonorepo": true
}
bash
archipelago generate home_sdk --config home_config.json

Step 2: Understand the Generated Structure

The Home SDK generates a feature module with three pre-built pages:

features/
└── home_sdk/
    └── lib/src/
        ├── home_sdk.dart                # FeatureSDK entry point
        ├── data/
        │   ├── datasources/             # Local/remote data sources
        │   ├── models/                  # Data models
        │   └── repositories/            # Repository implementations
        ├── di/                          # Scoped GetIt registration
        ├── domain/
        │   ├── repositories/            # Repository contracts
        │   └── usecases/                # Business logic
        ├── presentation/
        │   └── ui/pages/
        │       ├── dashboard_page.dart  # Main landing page
        │       ├── profile_page.dart    # User profile
        │       └── settings_page.dart   # App settings
        └── router/                      # Route definitions

Step 3: Register the Home Feature

In your shell app's bootstrap.dart:

dart
import 'package:home_sdk/home_sdk.dart';

FeatureRegistry.register(HomeSdk());

The Home SDK uses the dual-GetIt pattern: global GetIt for shared infrastructure (auth state, network client) and a local GetIt instance for feature-scoped dependencies (home repositories, usecases).

Step 4: Customize the Dashboard

The generated dashboard page is a starting point. Add your own widgets:

dart
// home_sdk/lib/src/presentation/ui/pages/dashboard_page.dart
class DashboardPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        children: [
          // Add your dashboard widgets here
          const WelcomeHeader(),
          const QuickActions(),
          const RecentActivity(),
        ],
      ),
    );
  }
}

Common Customizations

CustomizationWhere to Change
Add dashboard widgetspresentation/ui/pages/dashboard_page.dart
Edit profile fieldsdata/models/ and profile_page.dart
Add settings optionspresentation/ui/pages/settings_page.dart
Change navigation tabsrouter/ route definitions
Add bottom navigationhome_sdk.dart shell route

Next Steps

Built by Banua Coder