Full stack web apps with F# and Bolero

Using the Elmish Architecture and F# with Bolero to develop full-stack web applications with .NET and Web Assembly

Updated: 03 September 2023

Bolero is a framework for building full stack web application using F# on the server in .NET and in the browser with WASM and is based on Blazor and makes use of the Elmish application architecture

Create a new app

To create a new Bolero application you need to:

  1. Install .NET CLI templates
Terminal window
1
dotnet new -i Bolero.Templates
  1. Create an app

To create an app with server and client you can use:

Terminal window
1
dotnet new bolero-app -o MyBoleroApp

This will output the following:

Terminal window
1
MyBoleroApp
2
|- src
3
|- MyBoleroApp.Client
4
|- MyBoleroApp.Server

You can then build the app with:

Terminal window
1
dotnet restore
2
dotnet build

Or run it using:

Terminal window
1
dotnet run -p src/MyBoleroApp.Server

Which will automatically use the hot reloading for the HTML template files

If you want full rebuilding on changes you can use dotnet watch like so:

Terminal window
1
dotnet watch -p src/MyBoleroApp.Server run