/train-table

VR R-Train Table Prototype

Primary LanguageClojure

Train Table

A small project in ClojureScript. Fetches R-train information from rata.digitraffic.fi API and displays it in an SVG. A prototype of a real table with LEDs.

Train Table

Getting started

  1. Install the Clojure build tool Leiningen.
  2. Run lein figwheel dev to start the server
  3. Wait a bit, then browse to http://localhost:3449.
  4. Change the code (browser refreshes automatically thanks to Figwheel)

Project structure

Useful documentation

Interactive development

Interactive development means having a REPL (command prompt) where you can interact with the code and try out things, while also running the server.

While you can run Figwheel with lein figwheel dev you can also run a regular REPL and start Figwheel in it.

  1. Start an interactive clojure environment, for example:
    • run lein repl in a terminal
    • use M-x cider-jack-in-clojurescript in Emacs (requires cider)
    • install a Clojure IDE like Cursive for IntelliJ
  2. After the REPL is running
    • (use 'figwheel-sidecar.repl-api)
    • (start-figwheel!)
  3. Try out things and edit code
  4. Code is automatically refreshed thanks to Figwheel
  5. (Optional) Connect to the browser
    • (cljs-repl))
  6. Check that you are there (.alert js/window "hello from browser")