This workshop requires the following software:
- JDK 7
- a modern webbrowser such as the latest Chrome, Safari or Firefox
Leiningen is the de facto build tool for Clojure. In this workshop we use it to download dependencies for front- and backend.
To edit Clojure code we will use IntelliJ and the Cursive plugin. If you like, you can skip this step and use your favorite editor with Clojure support. Code changes are auto-compiled, so you don't need IntelliJ for Clojure compilation.
Download and install IntelliJ via this link. The community edition of IntelliJ is free. Version 15 is preferred.
Install the Cursive plugin for IntelliJ.
Open IntelliJ and open Preferences.
Proceed with the instructions on this page
to install the Cursive plugin.
You might need to restart IntelliJ after the plugin has been installed.
To open a leiningen project, just open the
project.clj file with IntelliJ.
Download project and dependencies
cd ~/projects # or any other directory you prefer git clone https://github.com/borkdude/immutable-webapp cd immutable-webapp lein deps # forces leiningen to download dependencies # not needed as a separate step, # but a good test to see if # leiningen works
Running the project
To compile Clojurescript open a terminal window and cd into immutable-webapp's directory.
lein do clean, cljsbuild auto. Changes in the Clojurescript code of this project are
automatically picked up. For live reloading, do
lein do clean, figwheel.
In another terminal window again cd into immutable-webapp's directory and run
lein ring server.
http://localhost:8090/index.html and you should see "Hello world!"
The final slides for this workshop can be found here.
Copyright © 2014
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.