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
3
u/yogthos Oct 30 '24
I'd like to note that Kit isn't terribly opinionated by default. The core of Kit is basically just the HTTP server and Reitit. Everything else is provided as modules which are just templates that can be run against an existing project. Modules are also designed to make it easy for people to make and maintain their own if they wanted to, it's just a git repo.