Gibet
An opinionated (i.e. decidedly eccentric) "scaffold"/example for full-stack F# web-app development using Fable, Elmish, Fulma / Bulma, Fable.Remoting, Elmish.Bridge, Giraffe and ASP.NET Core.
Install / Use
/learn @aornota/GibetREADME
| gibet (ρ)
An opinionated (i.e. decidedly eccentric) "scaffold"/example for full-stack F# web-app development using Fable, Elmish, Fulma / Bulma, Fable.Remoting, Elmish.Bridge, Giraffe and ASP.NET Core.
The example web-app is running on Azure - albeit on a free service plan (F1), which limits the number of concurrent websocket connections to a paltry 5.
And yes, I know that a gibet (gibbet) is not the same as a scaffold - but I love Ravel's Gaspard de la nuit, especially Le Gibet.
Development prerequisites
- Microsoft .NET 5.0 SDK: I'm currently using 5.0.400
- Yarn: I'm currently using 1.22.5
- Node.js (LTS): I'm currently using 14.17.5
Also recommended
- Microsoft Visual Studio Code with the following extensions:
- Google Chrome with the following extensions:
- (Microsoft .NET Framework 4.7.2 Developer Pack: this appeared to resolve problems with Intellisense in build.fsx)
History
- Installed SAFE templates for .NET Core: dotnet new -i "SAFE.Template::*"
- Created from template: dotnet new SAFE --server giraffe --layout fulma-basic --communication remoting --pattern default --deploy azure --js-deps yarn
Running / building / publishing / deploying
- Before first running:
- dotnet tool restore
- dotnet paket install
- Build targets:
- Run/watch for development (debug): dotnet fake build -t run
- Build for production (release): dotnet fake build -t build
- Publish for production (release): dotnet fake build -t publish
- Deploy to Azure (release): dotnet fake build -t deploy-azure; see Registering with Azure and Deploy to App Service
- Run the dev-console (debug): dotnet fake build -t run-dev-console
- Help (lists key targets): dotnet fake build -t help (or just dotnet fake build)
Unit tests
There are no unit tests yet ;(
However, the repository and web API services have been designed to work with ASP.NET Core dependency injection, which should also facilitate unit testing.
See test-users-repo-and-users-agent.fs for an example of "testing" IUsersRepo (e.g. fake implementation) and UsersApi (e.g. UsersAgent) from a console project.
To do
- [ ] extend functionality, e.g. Sqlite users repository? | &c.
- [ ] unit tests? AspNetCore.TestHost?
- [ ] additional documentation, e.g. (currently non-existent) gh-pages branch?
