hix - An example front-end in Re-frame and CLJS
This repo contains an example front-end application. Mainly for me to learn Re-frame.
This front-end is matched with the hax
backend server.
The pair hix
and hax
form a simple application that allows a new
user to register for a service, and then allows users to login and
logout.
Prequisites
Note that these notes are for MacOS and emacs
(with cider
installed).
- Install node and sass
brew install node
brew install sass
- Install shadow-cljs globally.
npm install --global shadow-cljs
- Make sure you are running
hax
before startinghix
otherwisehix
will have nowhere to connect to.
Installation
- Clone this repo.
git clone https://github.com/bombaywalla/hix.git
- Set up node packages.
npm install --save
- Run the
sass
processor to generate the CSS forhix
.
sass -I node_modules/bulma -I node_modules/bulma-pricingtable/dist/css \
resources/sass/hix.sass resources/public/css/hix.css
Starting the hix app
-
Make sure you are running
hax
. -
Start
emacs
and visit thedeps.edn
file. -
Fire up a cider cljs repl
C-c C-x j s
-
Answer
y
when you are asked if you want to open a web browser.
Running tests
$ shadow-cljs -A:test compile test
$ karma start --single-run
Expect some re-frame warnings about overwriting handlers.
Running production
- Run a report for the release build.
npx shadow-cljs -A:prod run shadow.cljs.build-report app /tmp/report.html
- Create a production release build.
$ shadow-cljs -A:prod release app
Credits
I took inspiration and code from
Please look at them as additional examples.
License
Copyright © 2020 Dorab Patel
Distributed under the MIT License.