How bethmassi/hybridmauiapp works
Project Type and Purpose
• This is a cross-platform, full-stack demo app built with .NET MAUI 9.
• It showcases the HybridWebView control in two scenarios:
a. A “raw” HTML/JS sample (HybridSamplePage).
b. A React “Todo” app embedded via HybridWebView (ReactTodoApp).
• Runs on Android, iOS, Windows, MacCatalyst, and Tizen.
Core Components
A. MAUI Core Layer
• AppShell / Shell navigation
• MauiProgram.cs (service registrations)
• App.xaml / App.xaml.cs
B. UI Pages (XAML + Code-behind)
• MainPage.xaml (+ MainPage.xaml.cs) – hosts HybridSamplePage content
• ReactPage.xaml (+ ReactPage.xaml.cs) – hosts ReactTodoApp content
C. HybridWebView Control
• Embedded in each page
• Loads local assets from Resources/Raw
• Two sub-folders: HybridSamplePage and ReactTodoApp
D. Local Web Content
• HTML/CSS/JS in Resources/Raw/HybridSamplePage
• Built React assets in Resources/Raw/ReactTodoApp (_next folder, etc.)
E. .NET Data Layer
• TodoTask.cs (data model)
• TodoDataStore.cs (in-memory store; JSON serialization)
F. Platform-Specific Projects
• Android, iOS, Windows, MacCatalyst, Tizen subfolders
• Platform entry points and manifests
G. Build/Deployment Artifacts
• Solution file (HybridMauiApp.sln), NuGet.config
• Next.js build pipeline (npm install → npx next build → copy to Resources)
Relationships and Data Flows
• User taps UI element in XAML page → HybridWebView sends a message to .NET (invoke .NET method)
• .NET code (MainPage or ReactPage handler) processes call, perhaps via TodoDataStore
• .NET returns data (JSON) back to JS context in WebView
• JS updates HTML UI accordingly
Architectural Patterns & Principles
• Shell-based navigation from AppShell
• MVVM-style separation (Views in XAML; View logic in .cs code-behind or view models)
• Hybrid Web architecture: local file system assets + bidirectional message–passing API
• Cross-platform abstraction: one codebase, multiple platform entry points