MEAL PLANNER

generating a shopping list from a meal plan

My wife loves to be organised and plan ahead. She asked me if it's possible to choose meals for the week ahead, then automatically generate a shopping list based on the meals.

I made a web app using PHP and MySQL.

The app stores our recipes in a database, so it can list what's needed for each meal, then combine the lists into one shopping list on a web page, which we print.

PHP and MySQL worked well, but we wanted to be able to easily add items to the shopping list as we thought of them during the week, as well as read and edit the shopping list after it was generated, like a Google Doc. I thought, "I wonder if the app can actually generate Google Docs?"

I wrote the web app again, this time using Google Apps Script.

I decided to try moving the recipes data from a MySQL database to Google Sheets.

At first I wanted to access the Google Sheets spreadsheet using SQL statements, but I found it made more sense to write my own JavaScript library based on accessing the spreadsheet with JSON.

The new app uses the Google Apps Script HTML Service to make a web interface, which accesses the Google Sheets spreadsheet, and generates a meal plan Google Doc and a shopping list Google Doc.

Now we can easily add items right on the shopping list Google Doc during the week, then use the meal planner app to generate a meal plan and add all the necessary ingredients before we go shopping.

Our meal planner web app keeps us organised and saves time every week!