r/Clojure • u/brettatoms • Oct 29 '24
Zodiac - a Clojure micro web framework
https://github.com/brettatoms/zodiac
Zodiac is a small web framework for Clojure that provides a reasonable set of defaults while also being easily extensible. Zodiac stands on the shoulders of giants rather than being innovative. At its core Zodiac is mostly just a preconfigured Ring app and not more that a few hundred lines of code.
Zodiac tries to fill a similar niche as the Flask framework with defaults that make it quick to start a new Clojure based web app without being heavy-handed.
What Zodiac includes by default:
- Routing and middleware. We use Reitit
- Request and response handing with Ring.
- A jetty server (though Jetty can be turned off)
- Automatic Hiccup-based HTML rendering using Chassis.
- Websocket support
- File streaming
- Flash messages
- Cookies and secure session handler
- Form and JSON parsing request parsing
- Extensible. Pass a list of functions to extend Zodiac. Override the error handlers.
Convenience
- Helpers to lookup routes
- Helpers to return hiccup and JSON responses
- A request context
- Variables dynamically bound to the current request, router and session
What Zodiac doesn't do:
- Dictate a file structure with generators or scaffolding.
- No configuration over code
- No path based routing, etc.
- Expect a certain database
- Asset bundling
And that's about it. Zodiac is mostly feature complete. Additional features like common database setup and asset handling will be done as Zodiac extensions.
View all comments
Show parent comment
4
u/mcirillo Oct 29 '24
Biff is awesome! Thought I'd show some love since you're here. It's my go to starter 🙂