Takeaway Store – online ordering

This is part 1 of a slow burn series.

Looking at a local takeaway store website, to poke around and see what a customer can do who wants to order online. Speculate about where that goes, what the back-end integrations might look like.

Ultimately, it’d be good to create an online ordering website for a takeaway store that functions similarly, and see what the moving parts are that get it done.

What does the online store currently do for ordering?

Part 1, below: Browsing around and looking what it does.

What are the requirements for the takeaway store to go online?

Next up, I reviewed my own video and made a list – a rough spec sheet of things that would be missing if we started setting this up in WooCommerce. It’s in Notion, and I’ll keep referring to it to get a build happening. The end goal, at this point, is to set up a store with similar functionality, real details/real menu, real printing at the end, and document it over a series of videos.

I’ve glossed over functionality that I know is already rolled into the base install of WooCommerce, and instead called out the riskier parts of the setup.

The hardest part that I can see already will be getting the order received workflow (from a server off in the cloud) to hand off a print job to a receipt printer in store. I’ve made some notes about this, but expecting that to be a stuff around.

Closely followed by multi-store functionality, and local point-of-sale seeing what’s going on.

Remembering how to create stuff

In my 20’s, I always had a side project or two going. Most of them weren’t $10m businesses, but all of them would have customers now if I set them up and left them running.

Every single one of them was a sound idea in some sense.

Now that I’ve had 4 kids, reasonably happily employed as a contractor (working on stuff I enjoy), I just don’t have the kick to create anything now. Wondering if it’s actually a fear of failing, or a fear of not finishing, adding another thing to the pile.

So it’s probably been 3-4 years of not creating anything I’m not being paid to create. Every time I want to work on something, I shoot it down because it doesn’t have a business model or it’s like a google tool or it needs a front end or some other bullshit reason.

Pretty keen to jump in and work on some dumb ideas that don’t have a business model and won’t make me rich and just create and finish some projects again.

So, I’m gainfully employed, my family is happy, I want to spend some time creating stuff.

First up, I’m just looking at this local takeaway shop that has a nice online ordering stack down pat. What would it look like if I did it in WooCommerce? My first ever freelance client was building an online ordering system in WooCommerce, and it was a long and happy relationship.

Journal entry – May 28, 2020

I keep a personal journal sporadically. Last year I dropped off from ~March 2020 and picked it back up on May 28, 2020. It was the period that coronavirus was the worst it got in Sydney* (*Simpsons ref: worst it got in Sydney, so far.)

Every day I review the entry from a week ago, a month ago, and a year ago. I’m not 100% with journalling so pretty often there’s missing entries, but this one is my favourite so far. It’s from a year ago today.

I keep the journalling private to only myself. It’d be good to share somehow one day with my family/kids, but there’s already so much content that I guess it’d need a thorough review first.

It’s a point in time and only lightly edited. I remember the period very vividly and also it seems like forever ago. One day, I hope this post gets lost in a sea of hundreds of my daily posts (there’s currently 80).


Started at Thu May 28 13:20:51 UTC 2020


It’s been so long. I’m here just to try to start the habit.


In the meantime, Coronavirus hit, and Australia did really well. We as a family also did really well.


In USA, 100,000 people have died as at yesterday. 100 people here. All the countries in the world are handling it differently. My USA friends are a little bit pretty conservative so it’s interesting seeing it through their eyes (‘the people who are dying were going to die’, etc).


The kids had 2 weeks of home school and then school holidays. Then another 2 weeks of full home school, and then basically back full time. Krystal loved it. We all got a bit closer (e.g. we had lunch together every day, which was fantastic!). All the kids handled it differently though. Austin grew up very quickly having everyone around. Emmett didn’t miss real life at all. Hudson just wasn’t himself. A bit moody, a bit withdrawn. He thought he probably needed to see his friends and we thought so too.


We did a good job of isolating ourselves. I went out for a takeaway coffee most days and that was it. A few times we went out for takeaway and ate it in the car — the Kebab Van in the Mitre 10 carpark, or McDonalds in the shopping centre carpark. Restrictions are lifting slowly now. 10 people are allowed in restaurants and cafes. NRL started again tonight.


We didn’t see Rod & Bronwyn for the whole time. The family all stayed away. We finally got to have a catch up and had the nicest night. Tom and I pulled an old couch out to the fire and we chilled on it with Krystal.


Scarlett had her 4th birthday under the lockdown. Her friends from dancing decorated their cars and came for a drive down our street. It was at the absolute height of the lockdown. The neighbours all watched from their windows. The mums passed Scarlett’s presents out the windows and basically yelled out the windows in conversation. The whole thing probably lasted 15 minutes and then they were gone. It was so amazing, one of those things that won’t ever happen again.


The neighbours house caught fire last week. Krystal ran down and told me, and we ran out and helped with the efforts. I really do think we stopped the place from fully burning down, once I saw the photos. Poor buggers.. We don’t see much of them, but the more we have seen them over the xmas fires and stuff the more they seem alright.

Spatie QueryBuilder/Eloquent – filter based on child attribute

One of those ‘all the time’ patterns I can never quite remember that is hard to google for.

The piece of code:

QueryBuilder::for(Entity::class)->whereHas('entityType', function($q) {
            $q->where("entity_types.is_task", true);

Explanation:

QueryBuilder::for(<Parent Class>)->whereHas('<relationship name of child/relative>', function($q) {
            $q->where("<table name>.is_task", true);

In this case, the child/relative is defined like this:

    public function entityType()
    {
        return $this->belongsTo(EntityType::class);
    }

Copying small startups, test #1

It’s all going to take a while to work out.

I’ve got an old online campsite booking tool that I charge the original customer $1k/year to keep switched on. It looks, feels and quacks like a SaaS, so will be useful to get some re-exposure to a lot of the side pieces to running the micro-SaaS.

Things like:

  • Applied formula SEO
  • Support as Marketing
  • Awful youtube how-tos as Marketing
  • Science of screenshots / pricing / features / waiting list
  • Analytics
  • Getting a marketing site template sorted
  • Forgotten steps like buying a domain

There’s no dev required to do any of these on this particular product, so it’s now Copying Small Startup Test #0. Revenue goal is $0. They’re all pretty light tasks in and of themselves, and might take me a month of 1 hour a night to knock a few off.

There’s no startup being copied here, but I assume there’s 10 others out there that I can be inspired by later.

Swagger to Laravel Library

Given an OpenAPI API endpoint, if you can export the OpenAPI JSON specification, it can easily be turned into a client library for use in laravel.

Download the swagger.json file to the current folder.

Run:

docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -i "/local/swagger.json" -g php -o /local/out/php

Under the ./out/ folder is now a client library to work against the API.

I made use of this post when working through:

Firebase – searching where string starts with

Firebase doesn’t have a nice way to say .where(searchField, ‘startsWith’, searchTerm)

The easiest way is to search for text strings that are greater than the search term, and smaller than the next string after the search term.

E.g. when searching for rows that start with “Rhys”, we really want everything greater or equal than Rhys, and everything less than or equal to RhysZ (to oversimplify).

Here’s a quick and easy way to do that, using \uF8FF (a high unicode code point) as the trailing character.

 return usersCollection
  .limit(perPage)
  .where('email', '>=', searchText)
  .where('email', '<=', searchText + '\uF8FF')
  .get()

Properly adding v-model support to a component (vue.js)

This is one of those things I always forget that’s hard to google properly.

In a child component, adding v-model support starts with a ‘value’ prop. This is the input value arriving at the child component. In the example below, I’m expecting to work with an array.

  props: {
    value: {
      default: () => [],
      type: Array,
    },
  },

We don’t want to mutate the underlying passed in value when it gets changed in the component, so the value prop is cloned into a data property.

  data() {
    return {
      editingRow: false,
      sections: [...this.value]
    }
  },

From here on in, we manipulate only the sections data, never touching the input value prop.

 saveSection(){
      this.sections.push(this.editingRow);
      this.editingRow = false;
}

When it’s time to notify the parent and sync the changes (on clicking save, or just on a practical point within the app), we emit a ‘input’ event with the new contents of the value.

this.$emit('input', this.sections);