This is a template repository that can give you a start in modelling a boardgame with a web UI.
Besides the necessary parts of the Haskell model, this template also contains the basis for a web UI build with WebPack.
To get your own copy of this repository you should "clone" it in one of the following ways:
Click the "Use this template" button and follow the instructions.
From GitHub Docs: Creating a repository from a template
If you are use the GitHub CLI you can enter the following command:
gh repo create <repo-name> --template Boardgame-DSL/Web-Boardgame-Template
If you don't use GitHub, you can simply download the template as a zip or a tarball.
This template uses Cabal, npm, and WebPack, familiarize yourself with these tools on their respective web pages.
Before you start coding you should probably customize the project files so that they match you project.
To build the Haskell model targeting WebAssembly you'll need a special compiler, the god old GHC can't help you here. This other tool is called asterius and is most easily used in a docker container.
More information about how build targeting WASM can be found in
HOW-TO-WASM.md
.
In the view of this project we have a npm project. To get started with that, run
npm install
. Write HTML in view/index.html
and
JavaScript in the view/src
folder (starting in the
view/src/index.js
file). use npm start
to open a
local development server (standard on port 9090
, change the in
view/webpack.config.js
), and npm run build
to
produce exportable HTML and JavaScript files in the dist
folder.