Skip to content

How to Use Calva with Polylith

Polylith is an architecture for backend projects that maximizes development ergonomics and code reuse.

Polylith logo

When developing a Polylith application you use one REPL for everything. And as such it is a rather vanilla deps.edn project, so there is really not much more to using Calva with Polylith than:

  1. Jack in, selecting the deps.edn project type
  2. Select aliases, most often :dev and :test
  3. Hack away!

The RealWorld Example

Select Polylith RealWorld REPL project

To make it easy to try Polylith out with Calva, the Polylith RealWorld example implementation has some Calva config to get the server started and Calva connected to its REPL quickly:

  1. Fork the project and open it in VS Code
  2. Jack-in, selecting the Polylith RealWorld Server REPL project type
  3. Wait for the REPL prompt to read clj꞉dev.server꞉>
  4. Evaluate (start! 6003)
  5. Hack away!

Try it with a Frontend

A ClojureScript frontend, of course:

  1. Fork the jacekschae/conduit project and open it in VS Code
  2. Edit the api-url definition in events.cljs file to be
    (def api-url "http://localhost:6003/api")
    
  3. Jack-in, selecting to start and connect to the :app build
  4. Wait for it to compile and then open http://localhost:3000
  5. Hack away!