GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ServiceStackApps/blazor-wasm: This template integrate ServiceStack with Blazor on .NET 6 and ServiceStack. The blazor wasm app is served through the main ServiceStack web host so you can deploy a single package with both api and client ux.

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

64 Commits
64 Commits

Folders and files

NameName
Last commit message
Last commit date
.deploy
.deploy
 
 
.github/workflows
.github/workflows
 
 
MyApp.Client
MyApp.Client
 
 
MyApp.ServiceInterface
MyApp.ServiceInterface
 
 
MyApp.ServiceModel
MyApp.ServiceModel
 
 
MyApp.Tests
MyApp.Tests
 
 
MyApp
MyApp
 
 
.gitignore
.gitignore
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
MyApp.sln
MyApp.sln
 
 
NuGet.Config
NuGet.Config
 
 
README.md
README.md
 
 
blazor-servicestack-desktop-app.png
blazor-servicestack-desktop-app.png
 
 
blazor-wasm-servicestack.png
blazor-wasm-servicestack.png
 
 

Repository files navigation

Blazor WASM & ServiceStack for .NET 6.0 RTM

This template integrate ServiceStack with Blazor on .NET 6 RTM and ServiceStack 5.13.

The blazor wasm app is served through the main ServiceStack web host so you can deploy a single package with both api and client ux.

Quick Start

Use the x tool to install this template

$ dotnet tool install -g x

$ x new nukedbit/blazor-wasm-servicestack ProjectName

This template come with sqlite db preconfigured so it work out of the box.

The blazor example provide a login page with the following default credentials.

[email protected]
p@55wOrd

Once logged in you can test calling protected endpoints on call hello page.

ServiceStack auth is integrated with blazor on ServiceStackStateProvider and I have provided a StackBaseComponent to use as a base component in your project, so it provide the JsonHttpClient with the bearer token once authenticated.

Inside the client project you can see this.

        builder.Services.AddScoped<JsonHttpClient>(s =>
        {
            return BlazorClient.Create("https://localhost:5001");
        });

Maybe i will make this automatically get the base url in the future, any contribution is appreciated :).

Code Sharing

Right now I have got dto sharing by using MyApp.ServiceModel project with success as suggested on Physical Project Structure

Running your app

There are two launch profiles for VSCode, the firt one it will launch the app with blazor debugging, the other one it will launch only the WebHost Debugging.

  1. Launch and Debug Blazor WebAssembly
  2. .NET Core Launch (web)

If you don't know ServiceStack give it a try it come with a AGPL 3 license, but you can get a commercial license for cheap and it will make your day more productive and enjoyable :)

Check the following links for more info

Executing Blazor and ServiceStack as a Standalone Desktop app

@mythz Published an update to the app dotnet tool that allow you to embedd this in a Windows Chromium Desktop App very easily with the latest v0.0.81+ app tool.

$ dotnet tool update -g app
$ x new nukedbit/blazor-wasm-servicestack Acme
$ cd Acme\Acme
$ dotnet public -c Release
$ cd bin\Release\net6.0\publish
$ app Acme.dll

When it will launch this is the end result.

As he suggested here

You can also create a Windows Desktop Shortcut.

$ app shortcut Acme.dll

References

  • https://docs.servicestack.net
  • https://servicestack.net

About

This template integrate ServiceStack with Blazor on .NET 6 and ServiceStack. The blazor wasm app is served through the main ServiceStack web host so you can deploy a single package with both api and client ux.

nukedbit.dev

Resources

Readme
MIT license
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.