Open Sourcing Rafiki

Francesco Sardo
3 min readMar 20, 2020

--

TLDR: Rafiki is an internal Clojurescript apps we use as part of the Wefarm network. We decided to make an open source fork and share it with the community. We hope you find rafiki useful.

Wefarm ❤️ Clojure. Our engineering team uses Clojure and Clojurescript for the core platform that powers a network of two million farmers and in a variety of tools and apps that we use internally to make our day to day tasks easier.

The year 2019 has been a good year for Clojure. The ecosystem kept on growing and maturing, and the latest releases significantly improved the beginner experience with better error reporting. Which was good news for us since our team includes everything from Clojure experts to novices.

State of Clojure 2019 survey

State of Clojure 2019 survey. It highlighted the importance of ironing out the error messages for the community.

Having hired many people who recently started working with Clojure, the main pain point we hear about is not about the language itself: the language core is simple and easy to understand, and even unfamiliar forms or macro become familiar after seeing them over and over. And there’s always the cheatsheet if you get stuck.

What is really puzzling from a new Clojure developer perspective is: how do I go about and do X? I understand the language, but how do I create a web server? How do I write a single page app? How do I talk to the database?

The usual answer is: we don’t need frameworks! You’re free to pick and choose any library you like and combine it with all the other libraries out there to create what you need. It’s all just data in — data out, isn’t it?

Every Clojure library documentation ever

Every Clojure library documentation ever. Except a few notable exceptions, understanding how to put the pieces together is an exercise left to the reader.

While this answer is in principle correct, it doesn’t solve the problem. We, as part of the community, have a duty to show that most technical problems are already solved and there’s good, working code out there that demonstrates how to accomplish most things. There are plenty of templates aimed at getting people up to speed (projects like pedestal, luminus and re-frame) but few real word applications that show how all these libraries interact together in production (with some noteworthy exceptions: 1, 2).

So we’ve decided to add our little contribution to the available resources online and share our opinionated way of building Single Page Apps. This might help you answer questions like: How do I integrate a Google Login? How do I do logging and analytics? How do I maintain a frontend + backend monorepo? How do I run snapshot tests?

A screenshot of our Rafiki app

You can jump straight into the code or have a look at the docs, which we will keep on updating. And if you have any comments or suggestions get in touch via Github, we’d love to hear from you!

Wefarm is always hiring experienced Clojure engineers or fresh starters that are interested in the language, so if you’re interested in working on similar project and want to help us kickstart the next agricultural revolution, get in touch!

--

--