A small Google Apps Script web app that shows the week's dinners from your Google Calendar and lets you schedule recipes from a Google Sheet.
recipe-box-apps-script/: the app sourceApp.html,Calendars.js,Helpers.js,Recipes.js: the finished app1-*files: workshop starting point, with numberedTODOs2-Recipes.js: the recipes file to add partway through the workshop
apps-script-presentation.md,apps-script-deck/: workshop slides and notes
There's no build step. You copy and paste the files into the Apps Script editor.
- Create a Google Sheet. Name one tab
Menuand give it aDishcolumn with a few recipes in it. - In the Sheet, open Extensions → Apps Script. The script has to be bound to the Sheet because it uses
SpreadsheetApp.getActive(). - For each file in
recipe-box-apps-script/(the non-prefixed versions):.jsfiles: add a Script file with the same name (no extension) and paste the contents in.App.html: add an HTML file namedAppand paste the contents in.doGet()loads it by that name.
- Click Deploy → New deployment, choose Web app, and authorize the Calendar and Sheets permissions when asked.
- Open the web app URL.
- Set up the Sheet and Apps Script project as described above, but paste in the
1-prefixed files instead of the finished ones. Drop the1-prefix from the file names in Apps Script; the HTML file still needs to be namedApp. - Work through the
TODOs in numeric order: everyTODO 1, then everyTODO 2, then everyTODO 3. For each one, copy the matching code from the non-prefixed file (for example,TODO 1in1-Calendars.jscomes fromCalendars.js). - When you get to
TODO 2, add the recipes file from2-Recipes.js. It reads fromSheet1, so either rename your tab or change the name in the code toMenu. - After each round of TODOs, redeploy (or use Deploy → Test deployments) to show the app growing.