Delicious Menus With Hatchware and CouchApps on Cloudant

By Mike Broberg

Innovative applications continue to emerge from Cloudant’s customers. Hatchware’s digital menu board project stands out for its use of CouchApps to design a CMS that’s JavaScript all the way down the stack, as well as probably the best application architecture diagram ever.

Jeff Charette, Developer and Principal, Hatchware

Hatchware logo

We recently spoke with Jeff Charette, the Developer and Principal behind Hatchware. Jeff, along with Designer & Principal Emily Charette, founded Hatchware to help restaurants make menus more accessible and functional for their customers. With elegant design of their CMS -- visually and architecturally -- they created Hatchware to help restaurants easily digitize their menus on large video panel installations. Menus can be easily updated, and users can pull down the latest updates to that content, tailored for their mobile browser to be easily searchable while they’re waiting in line.

Hatchware video board, in restaurant


Hatchware video board, up close


Cloudant: What led up to Hatchware?

Jeff: I started out with Oracle & MySQL, and I’m even a little embarrassed to say I have experience with COBOL, working with business computer information systems for 10 years. I’ve done some great stuff, and it’s always been heavy on database management.

I’ve always been passionate about content management systems (CMS). I got into building little PHP / MySQL applications a few years ago. I was building the third iteration of my CMS, and I wrote, what I’ll call a "non-relational, schema-driven application-layer database" on top of -- believe it or not -- MySQL. I was learning as I went. I didn’t do it because I was learning about NoSQL at the time. I did it because I was tired of my applications not scaling and not being able to easily update basic things like rows and columns without affecting the entire application. I wanted to grow my schemas more organically. So I had a separate indexer on the backend, and every record was kind of its own self-contained thing, and I just relayed them back and forth and BOOM.

I finished this third version of my CMS, and then I heard about NoSQL. I thought, "Well holy crap! This is like my work, but it’s actually performant!" For the next version of my CMS, I started tinkering with CouchDB. That was four years ago.

Cloudant: So you’ve followed CouchDB since its early days. How did you come to Cloudant?

Jeff: My first attempts with CouchDB stunk. Then CouchApps came along, and I started getting really excited. But it was a mind warp going from relational to non-relational. The whole time this was happening, I was writing tons of front-end stuff in JavaScript at my day job. Then Node.js came out and was getting big. I saw some talks by Mikeal Rogers and that were inspiring -- seeing CouchDB working with Node.js. At this point, I decided that, logically, I needed a hosting service for my CMS and it had to be reliable. I looked at Iris Couch, and at Cloudant, and also considered building my own, but the hook-line-and-sinker for me with Cloudant was that you guys have built-in Lucene search. So I don’t have to work on building that myself, and that’s great.

I started learning about the way Cloudant does things. And right at that time, you released support for CouchApps. When I initially built my CMS on Cloudant, I wasn’t able to push my CouchApps with you guys. So I talked to your team -- I just emailed and asked some of your top people, "Hey, do you support CouchApps?" -- and they were like, “No. But we will, next week.” That kind of accessibility was awesome.

So then I wrote a schema-driven, dynamic CMS in CouchDB and ported it over for Cloudant. How Cloudant works with the _users database in CouchDB is totally different, but other than that, the port went great. And that’s what Hatchware is built on today.

Cloudant: How has it been building your platform?

Jeff: We’ve only been at it since April 2013, and we’re still focused on building a big platform. We want to be able to put that platform in place immediately so people can start amplifying it. We have a few proof-of-concepts out there. You can see one above. These guys update their menus every day and change their prices every couple months.

I got the idea standing in line at my favorite smoothie place. I was like six people back, and I could barely read the menu. So I’m going through emails and I thought, "I wish I could pull up this menu on my phone." Then I thought, “I probably can, but, why don’t I? Well, it’s probably inaccurate, it will be hard to find stuff, and then I can’t even order from it.” I’m always looking for the same things on a menu: I know I like stuff with bacon in it, smoothies with blueberries, etc. So why can’t I just find that quickly?

We realized that there’s a huge opportunity to make a digital menu with the same experience on your phone, computer, or any personal device -- and to make that menu searchable so I can find that smoothie with blueberries immediately. What’s cool for restaurant owners is that they can update their menus easily with Hatchware’s CMS. What’s even cooler is that CouchDB supports replication. So we can replicate a menu to all restaurant locations in a franchise and have it served from a specific location. We’re also experimenting with pushing replications to specific regions. Say if McDonald’s brings back the McRib, but only in the Southwest. They can make that change and it will replicate out into menus across the region.

My wife Emily and I also run a design-development studio, We are Charette. All day long we build applications and brands for people. So that’s what pays the bills while we’re bootstrapping Hatchware.

Cloudant: What does the application architecture of your CMS look like?

Jeff: We’re using all Web technology. The CMS is entirely written as a CouchApp. It’s all contained within CouchDB, so it’s all portable, which is nice. Restaurant owners use their personal devices to update menu items in the CMS. There’s a Node.js listener watching the _changes feed for when documents hit a certain state. It does stuff that CouchDB can’t do, like trigger an email. Then we have all our Android clients (the digital menus themselves) that have this listener. The listener checks Cloudant for changes and pulls down the new menu when there’s an update. We’re using long polling for this piece right now, and it’s good for low-frequency updates, but we plan to redesign the process in the future.

I didn’t plan to use all this new technology. It just happened to be the best fit for our idea, which was a nice bonus. Here’s an infographic that outlines our stack:

Hatchware app stack infographic, with Cloudant

CouchApps make the platform easy to manage for Hatchware customers (restaurant owners), and performance is wicked fast. In the future, we’re considering an ad-supported freemium model. Even though we can do this at a cost-per-menu rate for restaurant owners today, owners love free. But for now, we need something that’s extremely reliable and fast. All those things align themselves to CouchDB.

Overall, the technology has been working very well. I don’t feel like I’ve leveraged all the horsepower on Cloudant, just because we haven’t had the time to use it. But we’re on CouchDB for the long haul, and Cloudant, too, for some of the different things it does with Lucene. I’m also interested in the view chaining you can do on Cloudant. I’ll be looking into that next.

Cloudant: What’s the thinking behind using CouchApps?

Jeff: I see a lot of people putting caching layers in front of CouchDB, and that’s cool, but I like to put CouchDB up front. I believe that if you’re hitting CouchDB, that means using a CouchApp. Anytime I need to do something more, it’s done on the backend, with state. And that’s Node.js listening for state on the _changes feed.

What’s cool is that whenever I check in my code, it’s 99.9 percent JavaScript (whether it’s Node.js or writing lists and views in CouchDB). The other 0.1 percent is HTML and CSS. I have package management built into the CouchApps, which are are going into Cloudant. Anytime I need to do something more, I use Node on the backend. I’m writing in JavaScript, and it all just feels the same -- on the front-end, backend, and in CouchDB. That’s really nice, not to have to be shifting gears all the time.

On that note, I’m also excited about the work Jan Lehnardt is doing on the Hoodie JavaScript framework for front-end-only Web apps. I’m hoping to integrate some Hatchware stuff with Hoodie in the near future.

Cloudant: How are you using Lucene search on Cloudant?

Jeff: There are a lot of fragmented services on the Web for finding restaurants and processing your order. Yelp is great at where to go, not what to get. Square has payments, but you can’t get menus. I see Hatchware as the platform for integrating these services for restaurants on the Web, and Cloudant Search will be a big part of that.

Our other property is Menuat. It’s a platform we’re launching on top of the Hatchware CMS. It will be like About.me: mini websites, but for restaurants. You’ll be able to find locations, search the menus, see ratings and social media content, and place your orders. Our goal is to get every restaurant in the U.S. on Menuat. It’s a big undertaking, and we’re going to need Cloudant and Lucene search, because we’ll be crunching lots of data. The integrated geospatial indexing Cloudant is working on also seems like something we could use down the road.

Cloudant: Any closing thoughts?

Jeff: To me, Cloudant’s one of the only NoSQL services out there solving real-world problems and providing a production-ready database. Having Lucene built in, along with geospatial indexing and chainable MapReduce, is compelling.

I’m eager to see what comes out of the BigCouch merge with the Apache CouchDB project, and, working with Cloudant now, I feel this community is taking CouchDB into the future. We’re in the right spot, technologically. We’re a small group, but we’re growing. It’s the right time to be involved.


Here’s to Emily and Jeff for making your next restaurant experience that much better. Thanks, guys. Order up!

-- Mike Broberg, marketing communications manager, Cloudant

Create an account and try Cloudant yourself

Sign Up for Updates!

Recent Posts