Skip to content

Latest commit

 

History

51 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MAUI + Blazor Solution Template

Build - Blazor Build - WebApi Build - MAUI apps Deploy - Blazor Deploy - WebApi

.NET 10 MAUI Gitmoji

A pragmatic starting point for an app that runs on web, mobile, and desktop from a single Razor component library — backed by an ASP.NET Core Web API.

🏆 A bit of history: For years there was no official Microsoft template for sharing UI across MAUI and Blazor Web — this repo filled the gap and was the go-to starting point. Microsoft finally caught up in .NET 9 with the first-party dotnet new maui-blazor-web template, which is a great choice for greenfield projects. This template still differs in shape (separate ASP.NET Core Web API project + NSwag-generated typed client) and remains useful when you want that split out of the box.

🏛 Solution structure

📦 MauiBlazor.sln
 ┣ 📂 src
 ┃ ┣ 📂 MauiBlazor.UI
 ┃ ┃ ┣ 📂 MauiBlazor.UI.Core     # Shared Razor components (RCL)
 ┃ ┃ ┣ 📂 MauiBlazor.UI.Mobile   # MAUI Blazor Hybrid host (Android/iOS/Mac/Windows)
 ┃ ┃ ┗ 📂 MauiBlazor.UI.Web      # Blazor WebAssembly host
 ┃ ┣ 📂 MauiBlazor.Shared        # DTOs shared between API and clients
 ┃ ┗ 📂 MauiBlazor.WebApi        # ASP.NET Core Web API + NSwag client gen

🚀 Quickstart

# Prereqs: .NET 10 SDK + MAUI workload
dotnet workload install maui

git clone https://github.com/bradystroud/MauiBlazorTemplate.git
cd MauiBlazorTemplate

# Run the API
dotnet run --project src/MauiBlazor.WebApi

# Run the Blazor web app
dotnet run --project src/MauiBlazor.UI/MauiBlazor.UI.Web

# Run the MAUI app (pick a framework)
dotnet build src/MauiBlazor.UI/MauiBlazor.UI.Mobile -f net10.0-maccatalyst

🧰 Stack

  • .NET 10 — single SDK across all projects
  • MAUI Blazor Hybrid — native shell, Razor UI
  • Blazor WebAssembly — same UI in the browser
  • ASP.NET Core Web API with NSwag for OpenAPI + typed client generation
  • GitHub Actions for CI/CD to Azure Static Web Apps + Azure App Service

📖 Background

Read the original write-up: MAUI Blazor Template on Medium.

Feedback and PRs welcome 😊

— Brady

Sponsor this project

Used by

Contributors

Languages