SAFE Template overview
The template gets you up and running with the most common elements of the stack:
- Saturn or Giraffe
- Fable for client-side F#
- Elmish for web UI
- Fulma for consistent web styling
- Docker or Azure App Service deployment models for hosting.
Using the template
Refer to the Quick Start guide to see basic guidance on how to install and use the template.
- Create a SAFE application using all defaults:
dotnet new SAFE
- Create a SAFE application using Giraffe with Fable Remoting:
dotnet new SAFE --server giraffe --communication remoting
- Create a SAFE application using Giraffe with Fulma 'Landing':
dotnet new SAFE --server giraffe --layout fulma-landing
The template provides the ability to customise the created application. You can see template version and available options by running
dotnet new SAFE --help.
Configures the SAFE app to use one of two different back-end hosting platforms.
dotnet new SAFE --server <server>
<server> is one of:
saturn: Creates a SAFE app running on Saturn on top of Giraffe (default).
giraffe: Creates a SAFE app running on Giraffe only.
Configures the SAFE app to apply a CSS Framework to the UI template. Currently supports just Fulma bindings
dotnet new SAFE --layout <layout>
<layout> is one of:
none: don't add any CSS framework.
fulma-basic: adds Fulma basic template (default).
fulma-admin: adds Fulma with the 'Admin' Bulma template.
fulma-cover: adds Fulma with the 'Cover' Bulma template.
fulma-hero: adds Fulma with the 'Hero' Bulma template.
fulma-landing: adds Fulma with the 'Landing' Bulma template.
fulma-login: adds Fulma with the 'Login' Bulma template.
Configures the SAFE app to use one of available means of communication between client and server. Currently supports only Fable.Remoting. If this argument is not supplied, client / server communication will be handled through the standard routing and serialization mechanism of the server. See here for an overview of Fable Remoting and the alternatives for sharing data between client and server.
dotnet new SAFE --communication <communication model>
<communication model> is one of:
none: don't add any additional libraries for client-server communication (default)
remoting: add Fable.Remoting to the template.
Configures Client app to use one of available patterns. Currently supports only either default Elmish architecture with Commands or simple (no Commands) Elmish Architecture with conjunction with Fable.Reaction library for Reactive programming
dotnet new SAFE --pattern <pattern model>
<pattern model> is one of:
default: use standard Elmish architecture with Commands (default)
reaction: use simple Elmish architecture without Commands + Fable.Reaction for reactive pattern
Optionally configures the SAFE app to elements needed for deploying to one of two different hosting models. If this argument is not supplied, no explicit support for any hosting model will be provided.
dotnet new SAFE --deploy <hosting model>
<hosting model> is one of:
none: don't add FAKE targets to deploy (default).
docker: Adds FAKE targets that bundles and build a Docker image. See here for more details about Docker deployment.
azure: Adds FAKE targets and an Azure Resource Manager (ARM) template that allows deployment to the Azure App Service plus an Azure Application Insights instance. See here for more details about Azure deployment.
Configures the SAFE app to use either Yarn or NPM for JS package management.
dotnet new SAFE --js-deps <package manager>
<package manager> is one of: