Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Sep 28, 2020. It is now read-only.

xtdb-labs/crux-console

Repository files navigation

Crux Console

Console is a web app that allows you to query Crux and see data from different perpectives. Screenshot of Crux Console

It can be used as a standalone analytics tool or as an educational tool.

Educational use

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"}]]}]

Deployment scenarios

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/;
}

Command line flags

--frontend-port  5000
--embed-crux     false
--conf-file      crux-console-conf.edn
--crux-http-port 8080

How to build or develop

Prerequisites

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.

Release flow

  1. lein build will produce you production ready assets
  2. lein build-ebs does the build above and packs it into Elastic Beanstalk package which we upload to AWS to see console.crux.cloud

Dev flow

To launch development REPL

Preferred

lein cljs-dev  # will install all the node modules, launch cljs compiling guard with code hotswapping
lein repl      # will launch edge rebel repl

Alternative

# once
yarn install

dev/shadow-dev &
# will launch shadow-cljs watch build
# it runs a local version

lein repl 
# will launch the server

Sidenotes

Plotly

Note 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.

Datepickers

There are a few things we can look at

Things to be aware of

  • YouCanBookMe/react-datetime
    • drags moment.js as a dep
    • UX is questionable

Potential extension points

Build

Can be improved with skipping with uberjar build and just updating the jar with

jar uf jar-file input-file(s)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6