This is simple example of reactive frontend in Haskell using reflex-dom. The web application helps to calculate amount of sugar in a lunch in bread units (quantity of a product containing 12 grams of net carbs) and demonstrates basic usage of reflex-dom components and design choices.
The project is entangled with slides (see reveal.js folder) and talk (Russian language, sorry) given on FPConf 2016 Moscow.
- Clone the repo with
--recusiveor rungit submodule update --init --recusive - Install nix package manager (the simplest way is
curl https://nixos.org/nix/install | sh) - Build frontend:
cd bread-units-frontend && ./build.sh - Build backend:
nix-build release.nix - Run server with:
nix-shell - Go to http://localhost:8081
- Start backend:
cd bread-units-backend && bread-units-backend - Start slides server:
cd reveal.js && npm build && npm start
- Build frontend:
cd bread-units-frontend && ./old_build.sh - Build backend:
cd bread-units-backend && stack install
- You need
cabal-install-1.24in your path, not1.25. - You need
npmandnode.jsinstalled in your OS (needed for ghcjs). - You need
libtinfolibrary withdevelversion installed in your OS.