Skip to content

pbryon/accelerated

Repository files navigation

Accelerated

This is a character generator for roleplaying characters in:

It was built using F# and the SAFE stack with Feliz and Feliz.Bulma

Running the project

Docker

The bundled Dockerfile can be used to build and run the project without any prerequisites.

$ docker build --tag accelerated .
[...]
$ docker run -d accelerated

Point your browser to localhost:3000.

Locally

1. Install dependencies

If you haven't already, install the following dotnet global tools:

dotnet install -g fake-cli
dotnet install -g paket
# optional:
dotnet install -g femto

and install yarn

Pre-existing fake

If running under WSL with Ubuntu 16.04/18.04, you might run into an issue with a pre-existing fake command in /usr/sbin. To check for this issue, run:

sudo ls /usr/sbin/fake
# and if it exists:
sudo rm /usr/sbin/fake
dotnet tool uninstall -g fake-cli
dotnet tool install -g fake-cli

2. Restore the project

Then restore the project:

# restore NuGet packages:
paket restore
# alternatively, restore NuGet packages and their npm dependencies:
$ femto restore src/Client/Client.fsproj

3. Build the project

  1. through CLI: fake build -t Run
  2. from VS Code: run the Watch Client target (ctrl-shift-B).

To view the project in action, open your browser to http://localhost:8080.

This runs the app in watch mode with hot reloading when any source files change.

Editing the project

I prefer VS Code, but your mileage may vary.

Docker (dev container)

If you're using VS Code and haven't ever used a development container, follow these instructions

It comes pre-loaded with Ionide and a couple of extensions to make your life easier.

Locally

Depending on your editor:

  • VS Code: install the Ionide extension
  • Visual Studio has built-in support for F#
  • vim: have a look at F# support for Vim

If this is your first foray into F#, check out my F# resources or F# for fun and profit