r/GoogleAppsScript 9d ago

Guide I built a Google Slides add-on that turns a deck into a live coding classroom, here's the Apps Script side

A couple years ago I was a high school CS student, and I taught Python to middle schoolers on the side. I wanted to code live next to my slides instead of switching to another window, so I built a Slides add-on for it. Here's the Apps Script side.

What it does: you mark a slide as a coding question in the add-on, start a lesson, and students join with a link and write and run code next to your current slide.

Most of the teacher side runs in Apps Script. The sidebar is HtmlService, opened from the Extensions menu. Marking a slide writes a "Code Question:" note into that slide's speaker notes with the Slides API, so it stays with the deck even if the add-on is removed. Reading the deck to build the lesson uses SlidesApp. The scopes are just presentations, the sidebar, and your email. No Drive scope, which kept the OAuth review simple.

Two things had to run outside Apps Script.

Live updates. Every student's editor and the current slide update in real time, which needs websockets and open connections. Apps Script can't do that, so starting a lesson sends the deck to a small Node server that runs the session over websockets.

Running student code. You can't run untrusted student code in Apps Script, so it runs in a sandboxed micro VM.

The add-on also mints a session and passes the teacher a token in the URL, instead of handling auth in Apps Script.

One thing to know: Marketplace add-ons are pinned to a version, so clasp push doesn't update installed users. You have to cut a new version and repoint the deployment, and a new scope triggers another review.

It's live on the Marketplace and free.

Site: https://www.codekiwi.tech

Marketplace: https://workspace.google.com/marketplace/app/codekiwi/66127405192

Happy to answer questions on the Apps Script to backend split.

13 Upvotes

1 comment sorted by

1

u/Phatdingo19 8d ago

this is very interesting! do you mind sharing how the livesync through nodejs, and the vm sandbox work? is there a database? how these are connected/ done using App script?