Looking at grain from behind the scene

As reported by Elaine Huang at e27 on 16 September 2014. More details can be found here.

Two weeks ago, I decided to visit Singapore-based food startup Grain to get a better understanding of its operations. 
For background, Grain is a food delivery service that caters to the busy working professional in Singapore’s Central Business District. It was launched about six weeks ago. As of August 20, it has served more than 5,000 meals.
Its opening hours are Monday to Friday, from 11 AM to 2 PM.
Customers order online, pay via Stripe, and pick up their lunches at a specific timing or in 15 minutes’ time.
Here’s my experience shadowing the startup for half a day: By 8 AM, chefs Ahjie and Isaac are ready for war with apron strings tied. Carefully, they sort out food items prepared last evening, knowing that most of the meals will have to be packed by 10.45 AM.
Most days, Grain’s menu is made up of two options. That very Thursday, the chefs were preparing Seared Flank Steak Salad with Blue Cheese and Assam Chicken with Black Rice.
/** * helper function to take the form and * get back a js object with field/value mappings * ignoring submit fields and fields whose name we can't ascertain */ function serialize(form){ return Array.prototype.slice.call(form.elements) .filter(isInputElement) .filter(isNotSubmit) .filter(hasFieldName) .reduce(function(data, node, index) { data[getFieldName(node)] = node.value return data; }, {}); } /** * Check if this form element is of type input */ function isInputElement(node) { return node.tagName.toLowerCase() === 'input'; } /** * Check if this is a 'submit' input element */ function isNotSubmit(node) { return node.type !== 'submit'; } /** * Ensure field has a derived name */ function hasFieldName(node) { return getFieldName(node) !== 'unknown'; } /** * Attempt to ascertain "name" of field. * * they don't give inputs real `name` attributes, so * best guess is to hack around the element's label text, * falling back to the placeholder text. (their html is * not semantic and often labels erroneously reference * parent divs instead of sibling input elements) * * strip out the stars they show when validation fails * * if label is misplaced _and_ there's no placeholder, * this function is insufficient */ function getFieldName(input) { if (!input.labels.length) return input.placeholder || 'unknown'; var labelText = input.labels[0].textContent.trim(); return ~labelText.indexOf(' *') ? labelText.slice(0, labelText.indexOf(' *')) : labelText; } /** * Listen for form submissions and send identify * if you'd like an event too, just delete the '//' in the track line */ document.forms[0].addEventListener('submit', function(e) { analytics.identify(serialize(e.target)); // analytics.track('Submitted Form'); });