Skip to content

critocrito/ncube

Repository files navigation

Ncube

Enter the hypercube.


This project is in an early stage and probably not working right now.

Installation

Linux

Currently there is only a deb package for Ubuntu 18.04. For any other Linux distribution build Ncube from source.

Install the provided deb package by either double-clicking it in the file browser or using a terminal:

sudo dpkg -i ncube_<version>_amd64.deb

macOS

Ncube can be installed using the DMG installer image. You can install Ncube by double-clicking the Ncube_<version>.dmg file and dragging the application into your Applications folder. Newer versions of macOS might refuse to install the package since Ncube is not verified by Apple. To install Ncube follow the following steps:

  1. Try to run Ncube.
  2. On your Mac, choose Apple menu > System Preferences, click Security & Privacy, then click General.
  3. Click the lock icon to unlock it, then enter an administrator name and password.
  4. Click on Open Anyway to allow Ncube on your computer.

macOS Security & Privacy preferences

From Source

The following prerequesites are required to build Ncube from source:

  • A recent version of Rust. Rustup is a great way to do so. The minimum supported version is 1.40.0+.
  • The UI is developed in ClojureScript and therefore requires Java and Clojure. Ncube is tested using Clojure 1.10.1 and ClojureScript 1.10.597. Not that ClojureScript 1.10.753 does not work right now.
  • The CSS stylesheets are compiled using PostCSS which requires NodeJS and
    npm/yarn. Run yarn install (or npm install) to fetch all dependencies.
$ cargo --version
rustc 1.42.0 (b8cedc004 2020-03-09)

$ java -version
openjdk version "13.0.2" 2020-01-14

$ clojure -e '(clojure-version)'
"1.10.1"

$ node --version
v12.16.1

$ yarn --version
1.22.0

Once all the dependencies are in place build Ncube:

make

The build produces a single binary and can be started like this:

./target/release/ncube

Documentation

All documentation can be found in the doc directory.

The HTTP endpoints of ncubed are described in the HTTP API documentation.

The architecture choices for Ncube are described as a series of architecture decision records. They are supported with a series of diagrams. To re-generate the architecture diagrams install fc4 and regenerate the images:

fc4 -fsr doc/diagrams

Development

Ncube consists of several parts:

  • ncubed is the backend of Ncube that exposes all functionality of Ncube.
  • The frontend UI is a single page web app that communicates to ncubed.
  • ncube is the full desktop app including ncubed and wrapping the frontend UI in a local browser window.

See the installation from source section to setup all the build dependencies.

Setup

Begin by compiling the stylesheets. I usually leave this command running in a terminal. It will watch the stylesheets for any changes and recompile if needed.

yarn css

The UI development environment is based on Figwheel. The dev.cljs.edn configuration starts a development REPL for the UI development. Emacs users can place a .dir-locals.el file to make the integration with Cider easier.

((nil
  (cider-default-cljs-repl . figwheel-main)
  (cider-figwheel-main-default-options . ":dev")
  (cider-clojure-cli-global-options . "-A:fig-deps:dev-deps:cards-deps")))

Alternatively start a development REPL manually in another terminal window:

clj -A:fig-deps:dev-deps:cards-deps:dev

This opens the browser at port 9500 on localhost.

Since the backend delivers the frontend using it's own HTTP server, the frontend assets must be available when compiling the backend. This is the case even if you use Figwheel to load the UI on port 9500 and have it communicate with the backend on port 40666 since they produce different assets in a different locations. Open yet another terminal and run the following:

make ui
cargo run --bin ncubed

Tests

The tests can be run by executing the following command:

make test

This project provides devcards to display its design system. They can be inspected at http://localhost:9500/figwheel-extra-main/devcards.

A standalone version of devcards is build when compiling the production distribution (make/make build). The output directory is resources/dist.

License

All code is copyrighted by [email protected] and licensed under the GPL3.