Sunday, June 28, 2009

The WebFridge Project

A few months ago, in the spirit of our recessionary times, we decided to institute severe household financial austerity measures. Around the same time, I was interested in learning more about the latest java technologies that are being used in enterprise software and web applications. This resulted in . . .
Project WebFridge!

Our housing expenses are the biggest impact on our budget. But since our housing costs are relatively fixed, it seemed like the biggest opportunity for improvement was the food budget. But this has not been easy! I like food.

Here's our food expenditures over the past few months (credit goes to mint.com for the pretty graph):

A few notes:

  • In January, we took a vacation to New Orleans. Lots of good restaurants and bars there. So I view that spike as a special non-recurring charge.

  • Our general run rate appears to be in the $500-$800 range, and this reflects a major cutback in our restaurant/bar expenses. This still seems embarassingly high.

  • The green bars supposedly represent U.S. food spending according to Mint.com. Apparently people went on some kind of colossal diet in May.

  • Apparently the food stamp budget for two people averages around $6/day, or $180 per month. Whoa. We are nowhere close to that.

Anyways, what I decided to do was build a web application using the latest java technologies to keep an inventory of our foodstuffs.

We do throw out quite a bit of food that goes bad in our fridge or freezer because we basically forget that it's there. The goal of this application is to cut down on that waste. And also make it easier to plan our cooking menus and our shopping.

Here's a quick overview of how my application works. You can take a live look at our current inventory here!

Logging into the Website

The system requires a login but you don't have to do it every time if you select the Remember Me checkbox. There is an Administrator account that allows for managing user accounts. This all uses Spring Security, which is a great security/authentication toolset.

Reviewing Inventory

The inventory is displayed in a sortable list. You can also filter by item location (Fridge, Freezer, Pantry) or by Item Type (Pork, Canned Veggie, etc).

We often wonder, "what do we need to use in the freezer?". This can be answered easily by clicking the Freezer button and then sorting by the Days Until Expiration field.

Note the beautiful Fridge, Freezer, and Pantry icons that I drew. Need to make some prettier ones.

Adding Items using Barcodes and Auto-Lookup

When you add packaged items, the system lets you scan in the UPC barcode and the item's information will be entered automatically with the system's internal UPC product database. As soon as you scan in the barcode, the item description fields are automatically filled in.

This process really doesn't take too long. I don't enter everything. For example, individual pieces of fruit that sit in a fruit bowl on our counter, that's not worth tracking since we see it every day and know what's in there. Lots of the stuff we buy we immediately cook up for dinner so I don't bother entering that either.

I am using a $10 scanner from ebay, the infamous cuecat.

For other items that do not have official barcodes, I printed out on some removable barcode stickers using my laser printer. I put these on produce bags, tupperware containers, etc.

Of course those items are not in the built-in UPC product database, so I have to fill in the item info manually.

Note the Days Until Expiration field. That field is automatically filled as soon as you pick Item Type (ie- fruit is given 5 days, canned goods 700 days, etc), but you can of course override it.

Warning Tweets

When any item is 3 days from expiration, WebFridge automatically starts sending daily warning messages. This is really helpful in using up those things in the back of the fridge or freezer before they go bad.

I suppose I could have used regular email instead of going through twitter, but hey, it was fun figuring out how to call the Twitter API from my software.

Future Enhancements

  • Right now I don't bother filling in the item size and price. But it would be cool if I could have stats on item prices that I could check with my iphone when I'm at the store. I have a rough idea of prices for common things like a gallon of milk, but I am less sure of lots of things from apples to greek yogurt. I'd like to think of some way to make this price entry more automated (perhaps running OCR on the itemized grocery receipt) since this could be a PITA otherwise.
  • I want to make a special iphone web app interface. I already check this webpage in my iphone browser, but Apple has special html tags that allow you to make the page look like a native iphone app.
  • I'd like to be able to mark certain items as staples that would be automatically added to our shopping lists (right now we use Evernote for that) whenever they are removed from our inventory.

Tech Details

This application is a customization of the excellent AppFuse tutorial project. Appfuse is a great starting point for projects using java open source tools. I am using Hibernate to access a mySql database and Struts 2 for my web framework. It is wired together with Spring. This all running on a ubuntu linux server within Apache Tomcat. The code is automatically tested using jUnit and jMock and is built using maven.

I am not an html/css/graphic artist, so some of my customizations to the Appfuse web pages are not the prettiest ever.

0 comments:

Post a Comment