1. HTTP Server: yada

Coordinate

juxt.edge/yada.ig {:local/root "../lib/edge.ig.yada"}

Integrant components
  • :edge.yada.ig/listener

    Parameters

    Takes a map that is passed almost verbatim to yada.yada/listener, except for the special :handler key which is passed as the first argument.

    Example
    :edge.yada.ig/listener {:handler #ig/ref :edge.bidi.ig/vhost
                            :port 80}
  • :edge.yada.ig/redirect Creates a yada redirect resource by calling yada.yada/redirect.

    Parameters
    :target

    The first argument to yada.yada/redirect, the :id of the resource to route to.

    :opts

    The second argument to yada.yada/redirect

    Example
    ;; Route to login
    :edge.yada.ig/redirect {:target :acme.app/login}
    
    :edge.yada.ig/redirect {:target :acme.app/user-profile
                            :route-params {:profile "me"}}
  • :edge.yada.ig/classpath-name

    Calls yada/as-resource on the io/resource of the :name of the options provided. Equivalent to (yada/as-resource (io/resource (:name opts))).

    Parameters
    :name

    Name of classpath resource to target

    Example
    :edge.yada.ig/classpath-name {:name "cljsjs/pikaday/development/pikaday.css"}
  • :edge.yada.ig/webjar

    Calls yada.resources.webjar-resource/new-webjar-resource with the given options map. The special key :webjar is used as the first argument.

    Parameters
    :webjar

    Provided as the first argument, name of the webjar to target, e.g. "swagger-ui".

    Example
    :edge.yada.ig/webjar {:webjar "swagger-ui"}
  • :edge.yada.ig/webjars-route-pair

    Calls yada.resources.webjar-resource/webjars-route-pair with the given options map.

    Parameters

    A value, which is passed in whole as the only argument to the function. Can be either nil or a map of options to be passed to new-webjar-resource.

    Example
    :edge.yada.ig/webjars-route-pair nil
    
    :edge.yada.ig/webjars-route-pair {:index-files ["index.html"]}

2. bidi (Web Router)

Coordinate

juxt.edge/bidi.ig {:local/root "../lib/edge.ig.bidi"}

Integrant component
:edge.bidi.ig/vhost
Parameters

Takes a list of vhosts to apply to bidi.vhosts/vhosts-model.

Example
;; Only route to example.com
:edge.bidi.ig/vhost [["http://example.com"
                     [""
                      [["/" #ig/ref :acme.app/homepage]]]]]

;; Different routes for example.com and example.org
:edge.bidi.ig/vhost [["http://example.com"
                      [""
                       [["/" #ig/ref :acme.app/homepage]]]]

                     ["http://example.org"
                      [""
                       [["/" #ig/ref :acme.app/other-homepage]]]]]

;; Same routes for example.com and example.org
:edge.bidi.ig/vhost [[["http://example.com" "http://example.org]
                      [""
                       [["/" #ig/ref :acme.app/homepage]]]]]

3. lib.app

Coordinate

juxt.edge/lib.app {:local/root "../lib/edge.app"}

Description

A meta package, depending on a base set of packages needed for developing any app. This allows us to extend this set of dependencies in the future, without requiring you to modify your application.

Contained sub-packages
  • edge.system

  • edge.logging

4. lib.app.dev

Coordinate

juxt.edge/lib.app.dev {:local/root "../lib/edge.app.dev"}

Description

Provides application dev-related utilities.

Has a dev-extras namespace for requiring into your dev namespace like so:

(ns dev
  (:require
    [dev-extras :refer :all]))

Also provides a development-oriented logging setup with filtering and file rotation.

5. lib.app.prod

Coordinate

juxt.edge/lib.app.prod {:local/root "../lib/edge.app.prod"}

Description

Utilities for a production environment.

Depends on lib.socket-server to make Socket REPL setup possible in production.

Also provides a namespace, edge.main, which:

  • Starts your application with a :profile of :prod.

  • Updates the variable edge.main/system to the value of the started system (useful for debugging!)

6. Crux-integrant

A convenient crux/integrant integration, for creating your crux systems with pure data.

6.1. Usage

As well as this library, you will need a dependency on crux and either rocksdb or lmdb:

juxt.crux/ig {:local/root "../lib/crux.ig"}
juxt/crux {:mvn/version "19.04-1.0.2-alpha"}

;; Only one of these required:
org.rocksdb/rocksdbjni {:mvn/version "5.17.2"}
;;
lmdb {:TODO TODO}

6.1.1. System components

System components all derive from :juxt.crux.ig/system.

Parameters take configuration as defined in Crux docs: https://juxt.pro/crux/docs/setup.html#_configuration

Derivations from standard Crux config
event-log-dir

If unspecified, will be a temporary directory that is consistent for the JVM

db-dir

If unspecified, will be a temporary directory that is consistent for the JVM

System Components
  • juxt.crux.ig.system/standalone

  • juxt.crux.ig.system/local-node

Example:

:juxt.crux.ig.system/standalone {:kv-backend "crux.kv.rocksdb.RocksKv"}
:my-web-server {:system #ig/ref :juxt.crux.ig/system}

6.1.2. Embedded Kafka

TBD