Skip to content

Features

ConnectSoft.Blazor.MicrofrontendLibraryTemplate (connectsoft-blazor-mfe) scaffolds a Blazor Server solution: a Shell host, a shared shell core RCL, UIKit theme adapters, and two sample microfrontends composed in-process as referenced Razor Class Libraries. It is standalone (UIKit-based), not derived from ConnectSoft.BaseTemplate.

Scope vs README

Earlier README/nuspec revisions mentioned a Bff.Api and Shared.Contracts project; these are not present in the current template source and never have been part of the in-process composition model. The two sample MFEs are Razor Class Libraries hosted via Interactive Server render mode — not separate WebAssembly apps and not separate processes.

Shell host

  • Shell.BlazorServer - the host: Program.cs and configuration only, zero .razor files of its own.
  • Shell.BlazorServer.Core - RCL owning the actual UI: App.razor, Routes.razor, MainLayout.razor, plus Composition/ShellMfeRegistry.cs, which aggregates every composed MFE's assembly and navigation items.
  • Hosting uses the modern Blazor Web App modelAddRazorComponents().AddInteractiveServerComponents() in Program.cs, and app.MapRazorComponents<App>().AddInteractiveServerRenderMode().AddAdditionalAssemblies(ShellMfeRegistry.Assemblies) — not the legacy MapBlazorHub() + MapFallbackToPage("/_Host") pattern.

Sample MFEs (Razor Class Libraries, composed in-process)

Each MFE ships a static {X}Mfe descriptor (exposing Assembly and NavigationItems) and an Add{X}Mfe(IServiceCollection, IConfiguration) DI extension that registers the MFE's own services (and, by convention, its own authorization policies — not the Shell's job).

MFE Descriptor / DI extension Nav routes
Mfe.Identity.Admin.Blazor IdentityAdminMfe / AddIdentityAdminMfe /admin, /admin/users
Mfe.Identity.SelfService.Blazor IdentitySelfServiceMfe / AddIdentitySelfServiceMfe /self-service, /self-service/profile

Both sample Add{X}Mfe extensions currently register no services and no authorization policies — they explicitly document that the host owns authentication and that the sample pages render mock data.

UIKit adapters and theming

  • Built on the ConnectSoft.Blazor.UIKit NuGet package plus adapter packages.
  • uiKitAdapter parameter (Tokens | Flowbite | DaisyUI, default Flowbite) drives conditional compilation (UseTokens/UseFlowbite/UseDaisyUI) in Program.cs and .csproj — only the chosen adapter project ships in the generated solution.
  • theme (Light/Dark), density (Default/Compact/Comfortable), and enableRTL parameters set defaults at generation time.
  • Adapter projects: Shell.BlazorServer.Tokens / .Flowbite / .DaisyUI.

Security

Shell.BlazorServer.Security provides security-related cross-cutting helpers; Shell.BlazorServer.SecurityAnalyzers ships Roslyn analyzers enforcing markup-safety conventions.

Ports

ShellPort (default 7000) is the only port symbol that actually affects generated output — it replaces the port literals in Shell.BlazorServer's launchSettings.json. BffApiPort, SelfServiceMfePort, AdminMfePort (defaults 7001/7002/7003) still exist as symbols but predate the in-process composition model: there is no BFF project or separate MFE host process for them to configure. Don't present them as configuring anything real.

See also