Example of full-stack Clojure/Script project which uses shadow-cljs for clojure-script compilation.
It allows using any arbitrary NPM dependencies, like "@blueprintjs/core"
which is
close to impossible with lein-cljsbuild
.
clojure
<3timbre
for loggingmount
for state managementpedestal
for web server andgeheimtur
for Oauth2 protectionhiccup
for HTML generation on server sidewrench
for managing configuration via environment variabesgarden
for generating CSS withgarden-gnome
to watch changesshadow-cljs
for compiling clojure-script and hot code reloadreagent
for rendering hiccup-like forms as React componentsre-frame
for frontend state-managementbidi
&pushy
for single-page-app navigation
Copy dev/config-example.edn
to dev/config.edn
and fill empty variables.
Install both NPM and Leiningen:
brew install leiningen node yarn
Now you are ready to start the project locally
yarn install
lein repl
> (reset)
This would
- start a local web-server on 8080 port
- start shadow-cljs server with hot-reload of your javascript
- start garden-gnome, which will compile your styles and watch for changes (shadow-cljs will pick up those changes on frontend)
Styles are compiled from src/css/styles.clj
with Garden.
Copyright © 2018 Anton Chebotaev
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.