I’ve been trying to get a grip on web development with Clojure for a while. And I’ve found Duct to be great, in general. It provides a structured whole that makes it simple to write clear, reloadable code. At the same time, I don’t think it gets in your way.
But getting started has been … challenging. I’ve been scratching my head lots of times, not really understanding how all of Duct’s parts fit together. Because Duct spans broadly – it’s a dependency injection framework [**] that abstracts away lots of things, and at the same time, it’s a foundation for doing web development, with handlers and routing, for APIs and web pages.
Recently, a lot of the small things have clicked for me, thanks a solid guide by CircleCI. Advantages:
- It works with a clear, realistic web application task
- It doesn’t take “very clever shortcuts” when you need to figure out the normal path regardless
- It follows up on deployment, showing you how to set up continuous integration (obviously, that’s what they do), and put your application into a running state.
In short, it bridges the gap between “Duct is a powerful platform with lots of potential” to “See how well Duct performs with this web application”.
So if you’re interested to learn about how you could work with a reloaded workflow where dependencies like the database are passed in for you, you might want to have a look at Duct with this guide.
[**] Technically, that’s not Duct, but Integrant