Preface
Most books that teach a web stack teach a tour: they introduce a framework, wire up a few routes, render a page, and stop where a real project starts – the moment the convenient defaults would have to be undone to ship. This book takes the hard but unavoidable route. It builds one application, a multi-tenant SaaS, the way it would actually be built if correctness, security, and the daily experience of working on it were the only things that mattered. It never trades the quality of that application for the ease of a chapter. Where the honest choice is harder to explain, the book takes it and explains it properly. The opening chapters make that case in full; this is only the promise it rests on.
The book is inseparable from the thing it describes. The prose and the application are one repository: every listing here is lifted from a server that runs, and every screenshot is of that server running. The text carries the reasoning that matters – why this option over that one, what it costs, where you would choose otherwise. The repository carries the complete, current code, down to the incidental details a page should not show. Where the two could drift, the book says so. You can read it straight through, or check out the repo, start the REPL, and tinker with the live system as you go; it was written to be read both ways.
It is an opinionated book, and the opinions are the point: server-rendered HTML over a client framework, Datomic’s immutability mined for the history it already keeps rather than fought as a constraint, strict compilation from the first commit and a Content-Security-Policy that is strict the day it arrives, and developer tooling built as real infrastructure and built early. None of these is offered as the only way. Each is laid out with its alternatives visible behind it, because a choice you can see the reasons behind is one you can re-make when your constraints differ from ours, and a choice handed down as an answer is one you can only obey.
The book assumes you can read Clojure and have met HTML, CSS, and JavaScript, and that you are at home with the infrastructure an application sits on (containers, TLS, a reverse proxy), which it treats as tools you already own rather than topics it teaches from scratch; it does not assume you have built a web application in Clojure before. It pushes hard in a few places and is honest about where. The first chapter names the steep chapters and how to read them. What it leaves you with is not a demo that works for an afternoon but a complete application you understand all the way down: from the reproducible environment it is built in, through the data model and the server-rendered HTML and the hardened pipeline that ships it, to operating, defending, and scaling the box once it is live. That is what the rest of this book builds.