- clone this project (or if you want more magic create-react-app like framework have a look at luminus)
- install JDK and clojure cli tools
- run
clj -Msanity
- clj should download any necessary dependencies now and run the short script
- if you see "Good job!" you are ready
File > New > Project from Existing Source
- choose the
deps.edn
in the repo - next next next... (defaults should be good) but choose up to date JDK (at writing used 15)
- check
File > Project Structure
to make sure- should have set
Sources
andTests
paths - libraries are correctly downloaded and resolved (you should see probably more, because I'm writing this in the beginning,but most importantly NO LESS, and there should be an explicit dependency for clojure version)
- if some of above is not correct there are probably some popups from IDEA which should aid you to download/index/...
- should have set
- open some
.clj
file and make sure symbols are resolving, if not troubleshoot - setup and try out REPL
-
Run > Edit Configurations...
-
the default config should be fine, you can play with the options later
-
when started try to write and paste
(+ 1 2)
to the REPL -
open some
.clj
file and right click on a piece of code The most important commands you should remember, use and abuse, are:Load File in REPL
load/eval the file and all its dependenciesSwitch REPL NS to Current File
to use the functions without require and or full pathSend ... to REPL
to eval your current selection
-
- GL HF
- somewhere to star
- 3rd party, a bit outdated but might have some useful info more info
- if you need more libraries
- your most important resource the docs
- run (look in
deps.edn
for the magic):clj -Msanity
to make sure you have the bare minimum workingclj -Mtest
to run testsclj -Mexchange
to run the project
- most of your REPL problems will be from forgetting to LOAD some file or being in incorrect namespace
- startup times are long, for development start the code from the REPL
- the REPL by default starts in namespace
user
use this to your advantage, add helpers there - start with
(start-app)
- router is set to hot-reload with middleware
- for changes in other files reloading the file in REPL should be enough
- the REPL by default starts in namespace
- logging is not straightforward, if it has some problems for you, just live with it / use println / or try to fix it, but you might skip this until necessary