AdminApp is a multi-platform administrative interface for managing the MagicPets system. Built using Blazor with MVVM architecture, it supports both web deployment (Blazor WebAssembly) and cross-platform mobile/desktop deployment (.NET MAUI). The application provides tenant and user management capabilities with a shared UI codebase.
AdminApp/
├── ViewModels/ # Business logic and data management (MVVM layer)
├── BlazorUI/ # Shared Razor components and pages
├── WASMApp/ # Blazor WebAssembly entry point
├── MAUIApp/ # .NET MAUI mobile/desktop entry point
├── Config/ # Configuration project
└── MakeRelease/ # Build and release tooling
Purpose: Contains the MVVM business logic layer with ViewModels that manage application state and data operations.
Key Classes:
SessionViewModel
: User session state, implements authentication and current user contextISessionViewModel
: Interface defining session operationsTenantUsersViewModel
: Collection manager for tenant users, provides CRUD operationsTenantUserViewModel
: Individual tenant user data and operations with validationSubtenantsViewModel
: Collection manager for subtenantsSubtenantViewModel
: Individual subtenant data and operationsConfigureViewModels
: Dependency injection setup for all ViewModels and API clientsAppConfig
: Static application configuration holderDependencies:
Purpose: Shared Blazor Razor components and pages used by both Web and Mobile applications.
Key Components:
MainLayout.razor
: Primary application layout with MudBlazor theming, navigation drawer, and app barNavMenu.razor
: Dynamic navigation menu that shows/hides based on authentication stateMain.razor
: Application root component with router and initialization logicHomePage.razor
: Landing page with authentication component (/
)Sessions.razor
: Application entry point that creates and manages user sessionsUsersPage.razor
: CRUD interface for tenant users with data table display (/UsersPage
)UserEditPage.razor
: Form for creating/editing tenant users with validation (/UserEditPage
)SubtenantsPage.razor
: CRUD interface for subtenants (/SubtenantsPage
)SubtenantEditPage.razor
: Form for viewing/editing subtenant details (/SubtenantEditPage
)StringList.razor
: Generic editable string list component with add/edit/delete functionalityApisEditor.razor
: Inline editor for API configurationsAssetsEditor.razor
: Inline editor for asset configurationsWebAppsEditor.razor
: Inline editor for web app configurationsUnitsToggle.razor
: Component for toggling measurement unitsPet.razor
: Pet display componentConfigureBlazorUI
: Service registration and dependency injection setup for UI layerDependencies:
Purpose: Blazor WebAssembly application entry point for web deployment.
Key Classes:
Program
: Static entry point that configures WebAssembly host, handles JavaScript interop for app configuration, and starts the Blazor runtimeFeatures:
Purpose: .NET MAUI hybrid application for cross-platform deployment.
Target Platforms:
net9.0-android
)net9.0-ios
)net9.0-maccatalyst
)net9.0-windows10.0.19041.0
)Key Classes:
App.xaml/App.xaml.cs
: MAUI application lifecycle managementMainPage.xaml/MainPage.xaml.cs
: Primary page hosting Blazor WebViewMauiProgram
: Application factory that configures platform-specific servicesPlatform-Specific Features:
Entry Point (WASM/MAUI) → Service Registration → Session Creation → Page Navigation → ViewModel Injection → API Communication
UI Components ↔ ViewModels ↔ API Clients ↔ Backend Services
↑ ↑ ↑
Data Binding → State Mgmt → HTTP Calls
SessionViewModel.AuthProcess
IsSignedIn
propertyLzItemViewModel<T>
or LzItemsViewModel<T>
base classesLzComponentBase
variants for ViewModel binding[Factory]
attribute for automatic code generationITenantUserViewModelFactory.Create(parent, data)
SaveEditAsync()
, DeleteAsync()
, CancelEditAsync()
Multi-level validation approach:
Both WASM and MAUI entry points call:
builder.Services.AddAppViewModels(); // ViewModels project services
builder.Services.AddBlazorUI(); // BlazorUI project services
cd AdminApp
dotnet build AdminApp.sln
cd WASMApp
dotnet run
cd MAUIApp
dotnet build -f net9.0-windows10.0.19041.0
.\DeleteObjAndBin.ps1