Mojo Wonk Blog.

A semi-offical blog dedicated to the Mojolicious web framework

Day 12: Using Minion in Dancer Apps

Stylistic photograph of Disney-style minion toys

At $work, we have built an API with Dancer that generates PDF documents and XML files. This API is a critical component of an insurance enrollment system: PDFs are generated to deliver to the client in a web browser immediately, and the XML is delivered to the carrier as soon as it becomes available. Since the XML often takes a significant amount of time to generate, the job is generated in the background so as not to tie up the application server for an extended amount of time. When this was done, a homegrown process management system was developed, and works by fork()ing a process, tracking its pid, and hoping we can later successfully reap the completed process.

There have been several problems with this approach: - it's fragile - it doesn't scale - it's too easy to screw something up as a developer

In 2019, we have to ramp up to take on a significantly larger workload. The current solution simply will not handle the amount of work we anticipate needing to handle. Enter Minion.

Note: The techniques used in this article work equally well with Dancer or Dancer2.

Continue reading Day 12: Using Minion in Dancer Apps...

Day 9: Add a theme system to your Mojolicious app

Four lines of paint drawn on a roller, in green, red, orange and blue

You wrote an awesome Mojolicious app, and people use it. Marvellous! But users may want to modify the theme of your app: change the logo, use another CSS framework, such sort of things.

Modifying the theme of a Mojolicious app is quite easy: add, modify or delete things in public and templates. But all those direct modifications may not survive on update of the app: they will simply be erased by the files of the new version.

Let's see how we can provide a way to have a theme system in a Mojolicious application, that allows users to have a custom theme without pain and without risk of losing it on updates.

Continue reading Day 9: Add a theme system to your Mojolicious app...

Day 8: Authenticating with LDAP

Who goes there?

There are still quite a few people using LDAP in production, but for those who are new to it, LDAP is a directory with a tree-structure that's optimised for very fast lookups. It used to be very common as a centralised authentication system and if you're using Active Directory, you're using LDAP (mostly). I wander through the wilderness of authentication, ending with my solution on how to add LDAP authentication to your App.

Continue reading Day 8: Authenticating with LDAP...