DB prototyping web services - WormBase/db-prototypes GitHub Wiki

The pseudoace package contains a web server which implements a number of potentially-interesting prototypes, notably. There's usually an instance running at db.wormbase.org:8120.

  • TrACeView: A "tree view" display and editor of Wormbase-ish objects in Datomic.
  • Colonnade, a simple query-builder interface inspired by TableMaker.
  • Implementations of the WormBase REST API for most gene-page widgets.
  • A few direct HTML widget implementations (not currently maintained).

Running the server

Requirements are:

Check out:

    https://github.com/wormbase/db

Then:

      ;; start a screen or tmux session for the server to run in
      % screen -S repl_server -h 10000
      % cd pseudoace
      ;; need to set the name of the URI for the database
      % export TRACE_DB="datomic:free://localhost:4334/WS250"
      % /mnt/data/bin/lein deps             # Fetch dependencies
      % /mnt/data/bin/lein cljsbuild once   # Build JS for TrACeView and Colonnade
      % /mnt/data/bin/lein repl             # Will download dependencies then start an interactive clojure session.
      ;; At the clojure prompt:
      ;; leave this running in the screen or tmux session
      (use 'web.core)

Environment variables

   TRACE_PORT                   Port to bind (default 8120)
   TRACE_SSL_PORT               Port on which to run an HTTPS service (optional)
   TRACE_SSL_KEYSTORE           Path of a .jks file containing certificates
   TRACE_SSL_PASSWORD           Password to use when accessing the keystore

   TRACE_OAUTH2_CLIENT_ID       From OAuth provider (if using federated login)
   TRACE_OAUTH2_CLIENT_SECRET   From OAuth provider (if using federated login)
   TRACE_OAUTH2_REDIRECT_DOMAIN Public URL that the server is running on.

   TRACE_DB                     URI of a Datomic database
   TRACE_REQUIRE_LOGIN          Require authentication for all pages.
   TRACE_ACCEPT_REST_QUERY      Provide an /api/query end-point compatible with the standard Datomic REST adapter.
   TRACE_ENABLE_CURATION_FORMS  Enable "name-server" style curation forms.

If you intend to have two or more databases being served by different peers (e.g. colonnade for both geneace and WS250 databases) then set a different TRACE_PORT and TRACE_SSL_PORT number for each database. TRACE_ENABLE_CURATION_FORMS should only be set to '1' (it is a Boolean) for the geneace database as it doesn't make sense to have the curation form running on the full database.

For curation.wormbase.org we use:

   TRACE_PORT=8130
   TRACE_SSL_PORT=8131

Extra bits of schema for supporting prototype curation tools.

    (use 'web.users)
    (use 'wb.curation-schema)
    (require '[datomic.api :as d])

    @(d/transact con users-schema)
    @(d/transact con (butlast curation-schema))
    @(d/transact con (butlast curation-init))
    @(d/transact con (butlast curation-fns))

User accounts

see User Account Management

User accounts are needed to access Colonnade and the editor functionality of TrACeView.