A few weeks ago, I started to take a tour of some of the Clojure web frameworks. To get to know them better, I'm going to pick a few frameworks and build a simple database-backed "Choose Your Own Adventure"-like story engine . I like this idea because the project is easy to understand and has a simple architecture but is complex enough that I'll need to understand how each framework works. I also thought the end product might be fun.
The first web framework on the tour is Luminus, a framework spearheaded by Dmitri Sotnikov (aka Yogthos). My initial project, called Adventure, can be found here, with the source hosted on GitHub. I also seeded the site with its first story titled "Cube Dweller".
Luminus refers to itself as a "micro framework". It is a Leiningen template that ties several open-source Clojure libraries together and provides the starting scaffolding for a project's initial code base. Luminus sits on top of lib-noir, but other libraries can be removed or swapped out with whatever you prefer. Luminus embraces flexibility, suggesting ways of doing things, but allowing you to change just about anything.
I found the scaffolding Luminus creates to be similar to what I had done in previous projects. The code layout is easy to understand, using common organization idioms. A starter project contains Bootstrap for the initial look and feel, as well as example routes and templates for a Home and About page so you can see how it all works together. Luminius also has support for generating scaffolding for specific databases, Clojurescript support and a few other features using profile hints.
Luminus also includes the recently-released Selmer templating library (also by Sotnikov). If you are familiar with Django, you will be right at home with Selmer since it is modeled after Django's template syntax. Selmer includes many of Django's tags and filters and makes adding new ones easy. It also includes some of the more advanced features like template inheritance and dev-time reloading. Selmer was great for me--someone familiar with Django who wanted to ease into Clojure web development. It's also fast and decently documented.
Although my project needs were modest, I found Luminus to be a big help. It let me quickly get in and move forward with my project rather than deal with starting-project ceremony. I feel like I have control of my project and can change whatever I want. I'm also interested in the support for introducing Clojurescript to Adventure. At the level I'm at with Clojure web development, I think starting with Luminus was a great decision.
So, go forth and Adventure with Luminus!
No comments:
Post a Comment