lgessler / glam

(WIP) a webapp for language documentation
Eclipse Public License 2.0
40 stars 3 forks source link

Introduction

Glam is an app for linguistic data annotation that's still under construction. It's built using Clojure(Script), Material-UI, Fulcro, and XTDB. Check back soon 🚧

Resources:

Installation

(These instructions are a sketch--more detailed instructions will be given later.)

  1. Secure a server that will run the app. We will assume you are using an Ubuntu machine.
  2. Download a JAR from the latest release.
  3. Configure the JAR as a service.
  4. Set up HTTPS. If you do not set up HTTPS, your instance of Glam will be vulnerable to password-stealing attacks. Fortunately, this is fairly easy--we recommend running Glam on the default port (8080) and using a reverse proxy like Nginx with certbot to provide HTTPS.

Development

First, take care of dependencies. You will need to:

  1. Install Clojure CLI tools
  2. Install NPM and Node
  3. Install Yarn

Running: Command Line

# install dependencies
$ yarn
# start compiling CLJS--leave this running in a terminal session...
$ yarn client
# and in a separate session, start a server repl--note you'll have to type `(start)`
$ yarn server
clojure -A:dev
Clojure 1.10.1
user=> (start)
# navigate to localhost:8085, and see package.json for more

Running: IntelliJ + Cursive

On the terminal:

yarn client

Clojure Server Profile:

  1. Make a new profile based on "Clojure REPL > Local"
  2. Select "Run with Deps"
  3. Put dev in Aliases
  4. Run and write (start)
  5. See src/dev/user.clj for development tools.

ClojureScript Client Profile:

  1. Make a new profile based on "Clojure REPL > Remote"
  2. Connection type: nREPL
  3. Connection details: "Use port from nREPL file"
  4. Project: glam
  5. Make sure you're entered (start) in the server.
  6. Navigate to localhost:8085
  7. Run your client profile and enter:
    (require '[shadow.cljs.devtools.api :as shadow])
    (shadow/repl :main)
  8. Write (js/console.log "hi") and ensure that it was printed out to the console in your browser session

Yarn Commands

Note: all docs command will require additional dependencies for asciidoctor. Use gem to get them.

Swagger UI for REST API

Navigate to http://localhost:8085/rest-api/v1/docs/index.html

XTDB Inspector

Set the environment variable XTDB_INSPECTOR_URI_PREFIX=/_inspector (e.g. XTDB_INSPECTOR_URI_PREFIX=/_inspector yarn server), and see http://localhost:8085/_inspector/attr