SAFE Introduction

What is SAFE?

As name suggested it is SAFE way to make next generation web application. Using statically typed functional language F#, and sharing the code between Client and Server.

Covering every aspect of SAFE stack is out the scope for this book. So, we will cover only last part of it. Here is brief introduction for all pieces of SAFE Stack.

Saturn

There are officially two framework supported. Giraffe and Saturn. Both are running on dotnet core. But you can always swap things. That is beauty of this stack. You an always use any one of your favorite server side framework. Only kind of condition that they should be running on dotnet core.

Here are other options

It is limited list but as I said you can use almost any thing. I am using ServiceStack in production app without any issue.

For this project we will use Giraffe, as we are focusing more on Elmish side instead of Server side.

Azure - Cloud

As dot net core is simply awesome and very easy to deploy using Docker. You can ship your application to any cloud. Here are some options that provides Docker support inbuilt or using other services

Fable

Best thing happen in F# after F# is Fable . It is F# to JavaScript transpiler. It will convert your beautiful code to beautiful very much readable JavaScript code. Go on check out REPL, compiler is running in the browser it self.

Elmish

If I may say The Elm Architecture brought simplicity in SPA - Front end development then Elmish brought Nirvana to SPA-Front End. It is basically a patter (way simpler than GOF design pattern) we can use for front end development. Current many other languages are having libraries following similar or same patter.

In next chapter we will take test drive of classically wonderful functional language F#.