A reference app and Leiningen template for building SPA in Clojurescript with Garden, Ring, and Om.
- sane project structure
- workflows for api, design, and user-interface
- live reloadable-code and brepl with figwheel
- static analyzers with kibit and eastwood
- curated ring middleware
- curated lein plugins
- curated cljsjs libraries
- om-i instrumentation
- async server with http-kit
- core.async integration, no ajax
- visual debugger with prone
- asset pipeline and tasks in leinigen
- automatic sourcecode formatting with cljfmt
- environment variables with environ
- up to date dependencies!
lein new mala chant
cd chant
The generated src looks like this:
env
├── dev
│ └── repl.cljs
src
├── api
│ ├── db.clj
│ ├── router.clj
│ ├── server.clj
│ └── utils.clj
├── design
│ ├── components.clj
│ ├── layout.clj
│ ├── styles.clj
│ └── typography.clj
└── ui
├── client.cljs
├── components
│ ├── hello.cljs
│ └── typeahead.cljs
├── main.cljs
├── pages.cljs
├── router.cljs
├── state.cljs
├── types.cljs
└── utils.cljs
Start figwheel, watch garden, and fire a ring api server for live coding:
lein dev
Open/refresh http://localhost:3449/
for a Cljs brepl on the prompt.
Ready to deploy? Generate an uberjar:
lein prod
Test with foreman:
foreman start
Preview staging http://localhost:5000/
A guide with installation, workflows, and best practices is under doc.
A minimal lein-template, based on this reference app, is under lein
. Significant changes in the project structure and dependencies will be updated both in the reference app and leiningen template.
A big thanks to @swannodette for pushing the limits of Clojurescript and Om, @weavejester for creating Ring, Joel Holbrooks for Garden, and Bhauman for Fighweel.
Best practices and code inspired and taken from:
An ideal reference app would be similar to the likes of React-Starterkit, Flask-Heroku, and Express.
0.1.x versions included a Less workflow with plain old cljbuld.
Copyright © 2015 Priyatam Mudivarti, and others.
Released under the Eclipse Public License, same as Clojure.