https://github.com/alefcarlos/blazor-server-mud-template
Blazor templates for "production-ready" apps using MudBlazor
https://github.com/alefcarlos/blazor-server-mud-template
blazor csharp mudblazor template
Last synced: 4 months ago
JSON representation
Blazor templates for "production-ready" apps using MudBlazor
- Host: GitHub
- URL: https://github.com/alefcarlos/blazor-server-mud-template
- Owner: alefcarlos
- Created: 2025-05-14T21:15:51.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-09T23:41:57.000Z (about 1 year ago)
- Last Synced: 2025-09-01T07:21:32.275Z (10 months ago)
- Topics: blazor, csharp, mudblazor, template
- Language: C#
- Homepage:
- Size: 77.1 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# blazor-server-template
## Get Started
```sh
dotnet new install AlefCarlos.Blazor.Templates
```
## Build
To install using local directory:
```sh
dotnet new install .\
```
## Templates
### mudblazor-server-solution
#### Using
```sh
dotnet new mudblazor-server-solution -n AppName -o ./app
```
This templates add common features to the Basic Blazor template. It ensures a production-ready application
#### features
- [x] Auth using OIDC
- [x] NotFound capability
- [x] Localization
- [x] Sync with browsertime
- [x] Global error catcher
- [x] User Session Management
- [x] Aspire Integration
- [x] Keycloak
#### Authentication
> This template offers a [keycloak](http://localhost:8080) resource using Aspire and a realm import as well
Start creating an user on `local` realm to [log the application in](https://localhost:7212)
#### User Session Management
##### Session Store
[Duende Blazor Server Access Token Management](https://docs.duendesoftware.com/accesstokenmanagement/blazor-server/) adds User Session management for Blazor safely.
> There is a in-memory store(ServerSideTokenStore.cs) for tokens, but you should user a persisted one.
##### Propagate token into http requests
Add the handler to the httpclient using [Http Client Factory](https://docs.duendesoftware.com/accesstokenmanagement/workers/#http-client-factory) and the token will be automaticaly injected, if the token is expired, it refreshes it befor sending the request
```csharp
builder.Services.AddHttpClient(client =>
{
client.BaseAddress = new Uri("https://apis.company.com/catalog/");
}).AddUserAccessTokenHandler(); //<-- this one
```
##### Back-Channel Logout
This template implements RemoteSignOut following the [RFC](https://openid.net/specs/openid-connect-backchannel-1_0.html)