Repository navigation
Scaffold: .NET MAUI + React HybridWebView with clean architecture - #1
Merged
Merged
Conversation
Creates AppName.Maui project: MAUI app with HybridWebView (HybridRoot="web", DefaultFile="index.html") serving React from Resources/Raw/web. MauiProgram wires AddApplication() + AddInfrastructure(dbPath). App resolves MainPage from DI. Workload: maui-android (includes MAUI core, controls, templates).
Override CreateWindow(IActivationState?) returning new Window(_mainPage) to replace the soft-deprecated Application.MainPage setter (Obsolete in .NET 10).
…rnal-target coupling)
- Switch Infrastructure DI to AddDbContextFactory<AppDbContext> (singleton factory, each operation creates+disposes its own DbContext — safe in MAUI's single-scope env) - UserRepository now injects IDbContextFactory and uses await using per method - UserRepositoryTests uses a TestDbContextFactory for a genuine cross-context round-trip - Add trailing newlines to Domain and Infrastructure test csproj files - Remove dead .counter CSS selector from index.css (no .counter elements rendered) - Normalize tab indentation in AppName.Maui.csproj hand-added Target/PropertyGroup blocks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Scaffolds a cross-platform .NET MAUI app that hosts a React (Vite + TypeScript) UI via the native
HybridWebView, organized with clean-architecture layering. One end-to-end vertical slice (Users) proves the architecture and the JS↔C# bridge work together.Architecture
Inward dependency rule: Domain ← Application ← Infrastructure ← Maui
src/AppName.DomainUser,IUserRepository) — zero dependenciessrc/AppName.ApplicationGetUsersUseCase,AddUserUseCase),UserDto, DIsrc/AppName.InfrastructureAppDbContext,UserRepositoryviaIDbContextFactory), DIsrc/AppName.MauiHybridWebView, DI composition root,CreateWindow,UsersBridge(JS↔C#)src/webUsersListfeaturetests/*src/AppName.Maui/Resources/Raw/web(gitignored); an MSBuild target (BuildReactApp) runs it before the MAUI build, skippable via-p:SkipReactBuild=true.Directory.Packages.props); shared props (Directory.Build.props).DbContextusesIDbContextFactory(no captive long-lived context, since MAUI has no request scope).Tests
window.HybridWebView).github/workflows/ci.yml):dotnet-tests+web-testson every PR.Known issue
NU1903— transitiveSQLitePCLRaw.lib.e_sqlite3high-severity advisory (GHSA-2m69-gcr7-jv3q) via EF Core SQLite. Affects all published versions (no upstream patch); inherent to EF Core SQLite. Documented in the README with mitigation options.Notes
docs/superpowers/.🤖 Generated with Claude Code