Inspiration

The hackathon says innovation should not depend on location. In practice a lot of it depends on something smaller: whether the lesson can reach you. A student may have a phone or an old laptop and still have no reliable connection at home. A classmate or a teacher has the material but cannot hand it over without a network, a messaging app or a paired device. I wanted a way to pass a lesson from one screen to another using only what every phone already has, a display and a camera.

What it does

LessonBeam packs a lesson, which is text up to 6,000 characters plus an optional quiz of up to five questions, into a looping sequence of QR codes. A second device opens the same app, points its camera at the screen and rebuilds the lesson. It checks that every part arrived intact, and only then saves it. The learner can read it, take the quiz, and beam it onward to the next person. One download in a place with a connection can spread through a class that has none.

After the first load the app works fully offline and can be installed like an app. There are no accounts and no server, and nothing leaves the device.

How I built it

It is a static site in plain JavaScript with no build step.

  • The lesson is compressed with the browser's CompressionStream and split into chunks. Each frame carries a transfer ID, its index, the total and a CRC-32 of its payload.
  • A header frame carries the length and the SHA-256 of the whole lesson. The receiver accepts frames in any order, shows a grid of which parts have arrived, and verifies the hash with SubtleCrypto before saving.
  • QR rendering uses qrcode-generator and decoding uses jsQR. Both are bundled locally so the app has no network dependency.
  • A service worker caches every file. A strict Content-Security-Policy is set, and lesson text is always inserted as text, never as HTML.
  • A self-test on the Beam tab reads the sender's QR canvas in the same page, so anyone can watch the whole pipeline work on one device. The app labels it as a loopback test.

I used Claude as an AI coding assistant. I decided what to build and tested it.

Challenges

  • A camera joins the loop at a random frame and misses some. The protocol had to work with frames in any order and with repeats, which is why every frame describes itself.
  • A CRC catches a damaged frame but not a wrong lesson, so I added the whole-lesson SHA-256. In testing, a payload altered to keep a valid CRC was rejected by the hash check.
  • Testing a camera without a camera. I recorded the sender's frames, fed them to the browser as a fake capture device, and the lesson was rebuilt through the real camera code.

Accomplishments

  • The full path works on the live site: create, beam, receive, verify, quiz, save, beam onward.
  • It reloads and passes its self-test with the network switched off.

What I learned

Most of the work in a one-way channel goes into deciding what the receiver can trust. I also learned how much a service worker and a content security policy constrain how you write the rest of the page.

What's next

  • Testing on real phones in a real room. So far the camera path has only been tested with the browser's fake capture device, so frame size and speed are untuned for glare and distance.
  • Images and audio, and more languages.
  • A classroom trial. No users have tried it yet.

Built With

Share this project:

Updates

Submission history