Console is a web app that allows you to query Crux and see data from different perpectives.
It can be used as a standalone analytics tool or as an educational tool.
Console comes with a set of example queries but you can make it load your own
set by providing a url param examples-gist=gist-raw-url, like
here
This way Console will import this file.
Important note : link must point to raw gist content.
Preset queries example:
[{:title "Space Stocks"
:query {:find [e]
:where [[e :crux.db/id _]]}}
{:title "Add space stocks"
:query [[:crux.tx/put {:crux.db/id 33 :title "Company 3"}]]}]Can be used as an analytics tool For nginx – the following redirects may be used
# in a server block
location /console {
# don't forget about at least basic auth
proxy_pass http://localhost:5000;
}
location /crux {
rewrite ^(/crux)(/.*)$ $2 break;
proxy_pass http://localhost:4889/;
}
--frontend-port 5000
--embed-crux false
--conf-file crux-console-conf.edn
--crux-http-port 8080
All builds require node and yarn to be installed.
yarn is, at the moment, a much better alternative to npm.
Yarn ROI is that in 2-3 uses it will save more time than you spent
installing and learning it, compared to 2-3 runs of npm install.
lein buildwill produce you production ready assetslein build-ebsdoes the build above and packs it into Elastic Beanstalk package which we upload to AWS to see console.crux.cloud
To launch development REPL
lein cljs-dev # will install all the node modules, launch cljs compiling guard with code hotswapping
lein repl # will launch edge rebel repl# once
yarn install
dev/shadow-dev &
# will launch shadow-cljs watch build
# it runs a local version
lein repl
# will launch the serverNote that Plotly has its own packaging model (due to heavy weight beneath), so search for different packages on npm if you need more fine-grained control. e.g.
- All-in-one https://www.npmjs.com/package/plotly.js-dist
There are a few things we can look at
-
Pikaday
- looking nice and simple
- no deps
- url https://github.com/timgilbert/cljs-pikaday
- no timepicker, but that's an easier fix
-
React datetime picker
- demo url http://projects.wojtekmaj.pl/react-datetime-picker/
- gh url: https://github.com/wojtekmaj/react-datetime-picker
- good UX, has timepicker
- claimed test cov 92%
- seemingly lots of deps :(
-
Hacker one datepicker
- demo link: https://reactdatepicker.com
- gh link: https://github.com/Hacker0x01/react-datepicker/
- Lots of options, arguable best datepicker-timepicker combination
- quite heavy :(
Things to be aware of
- YouCanBookMe/react-datetime
- drags moment.js as a dep
- UX is questionable
Can be improved with skipping with uberjar build and just updating the jar with
jar uf jar-file input-file(s)