New revamped version of the AnyMeal recipe management software30 Jun 2020
More than 15 years ago after leaving university I developed a GNU/Linux software called AnyMeal for managing a large amount of recipes. The software was based on the MealMaster file format which is a popular file format for sharing recipes.
The website of Episoft Systems, which provided the original MealMaster software for DOS, is not online any more. Fortunately a copy of the website is still available on the Internet Archive.
The AnyMeal software used the recode library to convert recipe text files to the UTF-8 encoding. A fast Flex parser then converted the MealMaster recipes to XML. An XSLT script was used to generate SQL commands for inserting the recipe into a MySQL database. For setting up the database and user account, the software had a step-by-step wizard. The KDE password manager was used to store the user credentials.
The recipe search was performed using a complicated search dialog with multiple tabs. The graphical user interface used multiple windows to display recipes and lists of search results. A recipe editor was implemented for modifying existing recipes or adding new ones.
However life happened and eventually I stopped maintaining the software. The software was developed using Qt3 and when Qt4 came out, there were breaking changes with list views and the software didn’t work on new systems any more.
Now many years later it still looks like there is a space for a fast recipe management software which can handle a large amount of MealMaster recipes. So I decided to use my past experience and do a rewrite of the old software.
This time I used the Qt5 framework to implement the graphical user interface. Instead of the old list view items, Qt5 now uses an item model and a list view widget to view the model. Also Qt5 provides cross-platform support for printing which is a great feature for a recipe management software. Like that it is not necessary to have a computer in the kitchen any more ;)
Instead of MySQL, I used the SQLite3 embedded database. This greatly simplified the software because SQLite3 does not require the setup of user accounts and databases. Also the user does not have to run a database server in the background. Furthermore without user credentials there is no need for interfacing with the KDE password manager any more.
For the internal representation of recipes I decided to use a more conservative approach. For representing recipes I used a C++ class instead of XML data. Like that it is not necessary to depend on the Xalan XSLT processor and Xerces-C XML library any more.
I also changed the order of UTF-8 conversion and parsing of recipes. Now the recipes are first parsed with an Flex MealMaster parser and stored as C++ objects. The strings of the C++ object then get converted to UTF-8 using the recode library. Like that it is not necessary for the Flex parser to be UTF-8 aware any more thus simplifying the implementation.
The search was also simplified. A search can be performed on title, category, or ingredient. It is possible to narrow down the search result by using several searches one by one. I.e. it is not necessary any more to implement a complicated search dialog which builds a complex search query.
Back then I used CVS for version control. This time the version control was done using Git. AnyMeal is still hosted on SourceForge however the source repository is now on Github, Gitlab, and BitBucket (after all Git is a distributed version control system!). The main project page is on Github (which displays the content of the gh-pages branch of the repository).
After simplifying the software architecture like that, it was possible to implement the software in less than 100 hours. Most of the work of the rewrite was implementing a simpler Flex parser and reimplementing the recipe editor. In contrast to back then, I implemented the internals of the application using test-driven development (TDD). I used Google Test which is Google’s C++ test framework. Also, unlike back then, now there is Travis CI which provides free automated testing for software libre.
I am planning to add a few more small features but I think the software is more or less ready to be used for cooking.
Let me know what you think in the comment section below.
Article was submitted to Hacker News.
I also forgot to mention that I used Docker and debuild to create a package for Debian Sid.