SAFE template
A dotnet CLI template for SAFE-Stack projects.
This is a basic template to get started with 3 core components of the stack:
The template does not include any Azure / other Cloud integration. Refer to SAFE-Bookstore to see an example of deploying to Azure and for more details about this stack.
Prerequisites
- dotnet SDK 2.0.0 together with dotnet CLI
- node.js
- yarn
Using the template
-
Install or update the template:
dotnet new -i SAFE.Template
-
Create a new project from the template:
dotnet new SAFE
-
Build and run the project:
build.cmd run
/./build.sh run
. This command:- Fetches all necessary dependencies
- Builds Server and Client code
- Runs
dotnet fable webpack-dev-server
in src/Client (note: the Webpack development server will serve files on http://localhost:8080) - Runs
dotnet run --project src/Server/Server.fsproj
in root directory (note: Suave is launched on port 8085) - Opens browser with url to Webpack development server (5 second delay after running client)
-
In case that dotnet -i fails with an 'Reference not set' error on Linux, try
- Uninstall a previous version:
dotnet new -u SAFE.Template
- Install the new template with its path: `dotnet new -i ./nupkg/SAFE.Template.<>.nupkg
- Uninstall a previous version:
Contributing
Refer to Contribution guideline