Skip to content
This repository has been archived by the owner on Apr 1, 2022. It is now read-only.

A basic template for a SAFE stack application, managing multiple urls with Fable.Remoting, while also maintaining the model, update, view framework. Based on SAFE 1.14.0

Notifications You must be signed in to change notification settings

Freymaurer/MultiUrl-SAFE-Template

Repository files navigation

ARCHIVED

We got a lot more nice documenation since i created this repo. Please check out the awesome work from @Zaid-Ajaj in his Elmish Book.

SAFE Template

This template can be used to generate a full-stack web application using the SAFE Stack. It was created using the dotnet SAFE Template. If you want to learn more about the template why not start with the quick start guide?

Problems during implementation into SAFE-stack:

1: I had to update package.json, otherwise the following function would give no output

let inline elmishView name render = FunctionComponent.Of(render, name, equalsButFunctions)

Changes to package.json:

"react": "16.8",
"react-dom": "16.8",

2: Without the following change to the webpack.config, it was not possible to directly connect to any url with variable input. Like for in this example the detail/int url path.

output: {
     path: resolve(CONFIG.outputDir),
     filename: isProduction ? '[name].[hash].js' : '[name].js',
     publicPath: '/'

The last part about publicPath was missing in the SAFE-stack template.

Install pre-requisites

You'll need to install the following pre-requisites in order to build SAFE applications

  • The .NET Core SDK
  • FAKE 5 installed as a global tool
  • The Yarn package manager (you an also use npm but the usage of yarn is encouraged).
  • Node LTS installed for the front end components.
  • If you're running on OSX or Linux, you'll also need to install Mono.

Work with the application

To concurrently run the server and the client components in watch mode use the following command:

fake build -t Run

SAFE Stack Documentation

You will find more documentation about the used F# components at the following places:

If you want to know more about the full Azure Stack and all of it's components (including Azure) visit the official SAFE documentation.

Troubleshooting

  • fake not found - If you fail to execute fake from command line after installing it as a global tool, you might need to add it to your PATH manually: (e.g. export PATH="$HOME/.dotnet/tools:$PATH" on unix) - related GitHub issue

About

A basic template for a SAFE stack application, managing multiple urls with Fable.Remoting, while also maintaining the model, update, view framework. Based on SAFE 1.14.0

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published