Fast start for a Clojure + Pedestal + Vase + Fern project
Fork this to your project, then fire up a Codespace to get started.
You'll probably want to change "dawn" to your project's name. Be sure to make
the same change in deps.edn
, shadow-cljs.edn
and the various folder names.
Vase embedded here is a derivative work originally created as Vase. Vase was licensed under EPL v1.0. This fork is licensed under EPL-2.0
These instructions are for a codespace using VS Code (either in a browser or running locally with a remote connection).
To get a Clojure REPL:
- Configure your .m2/settings.xml for access to download Datomic. (See below for instructions.)
- Click the nREPL badge in the status bar
- Select the "jack in" option
- For project type, select "Clojure CLI"
- Use the
:dev
alias
To get a CLJS REPL:
- Click the nREPL badge in the status bar.
- Select the "jack in" option
- For project type, select "shadow-cljs"
- Use
:app
for the build to start
Shadow-cljs will run an HTTP server at http://localhost:8020. To access this port, select the "Remote Explorer" tool from the left-hand navigation in your VS Code window. Under "Codespace Details" you will see "Forwarded Ports". Click "Port: 8020" to open a new tab connected to the shadow-cljs server.
To change this port number, modify forwardPorts
in
.devcontainer/devcontainer.json
and the value at [:builds :app :dev-tools]
in shadow-cljs.edn
. After making this change, you must commit it, push it to
your fork of Dawn, and start a new codespace.
To get a Clojure REPL:
- Configure your .m2/settings.xml for access to download Datomic. (See below for instructions.)
- In a terminal, run
clj -A:dev
To get a CLJS REPL:
- Ensure you have npx installed
- In a terminal, run
npx shadow-cljs watch app
Your app will be on http://localhost:8020
and a Shadow CLJS
dashboard (for monitoring builds) will be on http://localhost:9630
If you want to merge upstream changes into your application in the
future, then it's best not to change the code under framework/
.
If you want to include other repositories as submodules, use the
vendor/
directory and add a reference in deps.edn
.
Of course, ordinary dependencies work just fine too.
dawn/src
is the intended place for your application's code. You'll
want to rename dawn
to your app's name. Or just rename it to
app
... either way is fine.
- :dev - Start a friendly REPL
- :test - Run all tests
- :app - Build the main application,
Vase depends on Datomic. You will need to set up ~/.clojure/deps.edn
and ~/.m2/settings.xml
according
to the instructions at my.datomic.com in order to
fetch the Datomic Pro jar file from repo.datomic.com
.
Codespaces users will want to look at setting up personal dotfiles to make that easier.
If you do not want to use Datomic, remove both com.cognitect/vase
and
com.datomic/datomic-pro
from deps.edn.