Monthly Archive for September, 2006

New App - Purchase Tracker

I've been using GnuCash for my money management for a long while, and quite like it.  But certain transactions cause problems.  In particular, when Heather goes to the store and buys apples and laundry detergent, the transaction needs to be split between groceries and household expenses.  You can imagine that when there are 30 different line items, that split gets cumbersome.

I've also oft wondered what the price of different things is over time.  For example, how much has the price of milk fluctuated over the past 12 months.  Being the good programmer I am, I built a very simple purchase tracking app, and make the 0.1 release available for download.  Installation is simple: unzip somewhere, and ensure you've got a MySQL DSN set up that matches the name in act_setappvars.cfm, and that CF has the ability to create/edit tables within.  Note that I've only tested on CFMX 7 and MySQL 4.1.  It should work on any Java-based CFML runtime with CFC support and on MySQL 4.1 or newer, but I haven't tested that.

Basically, it's a place to record the individual line items for a purchase, and the software will track the price of the items as well as split up the total purchase into different product categories.  Everything's dynamic, of course, and it works pretty well.

It's got a couple neat extra features as well:

  • Database auto-upgrade.  Check the database.cfc file for an automated upgrade script.  If/when you upgrade the code, that file will transparently ensure your schema is up to date as well.
  • Externalized strings.  All strings are externalized in standard Java properties files (and loaded through Java's PropertyResourceBundle class).  Note that locale support is NOT enabled, as I didn't want to introduce classpath dependancies, but it would be simple to add it manually.
  • Multiple configurations.  Built on top of the externalized strings is the ability to run the same code in multiple configurations.  In act_setappvars.cfm, you'll see an 'invoices' configuration that is commented out.  Uncomment it and you'll get a second copy of the database (with a different table prefix), and different strings throughout the UI so the same code can be used as a simple invoicing application.  The number of configurations is limitless.
  • Mollio for the UI.  Nothing particularly special here, but saved lots of time and still provides a professional look and feel.
  • Scriptaculous/Prototype for JS remoting.  A lot of the UI is centered around Scriptaculous's Ajax.InPlaceEditor, which saves a lot of page loads, and a lot of UI work.  A good example of how an HTML UI can be made a lot more usable with just a few simple additions.

Notably lacking is ColdSpring and Reactor support.  I greatly dispise their required server-level (ed. or at least webroot-level, per Kurt's comment below) configuration.  CF apps that are distributed as a pile of CFML should be neutral.  If you're distributing a WAR, no such qualms, of course.  If CF allowed for per-application (i.e. request-configured) mappings, that'd fix the issue.