Inspiration
Studying alone is boring, and most study apps turn maths into multiple choice. We wanted the feeling of racing a friend at a whiteboard: same problem, same second, real working by hand, and someone fair deciding who got there first.
What it does
Reef is an iPad app for head-to-head study battles. One player creates a six-letter code, a friend joins, and both get the same problem at the same instant. You solve it by hand with Apple Pencil on an endless page. A judge on our server reads both pages continuously while you write. It shows each player a live progress bar, ticks off the solution steps your opponent has completed, and ends the match the moment someone's final answer is right. Any equivalent form wins, you never have to simplify, but you do have to finish the work. There is no submit button. If you are stuck you can ask for a hint, your opponent has to allow it, and the hint is written from your own working without giving away the answer. After the match you see both pages side by side, can rematch, and can review past matches, your record and your rivals.
How we built it
The app is SwiftUI and PencilKit with our own design system, shipped through TestFlight. Pen strokes stream over WebSockets to a Cloudflare Worker, where each match is a Durable Object that owns the clock, both pages and the verdict. Handwriting is turned into LaTeX with Mathpix. Final answers are confirmed by an exact symbolic and numeric checker, so a win is never a model’s opinion. A small scoring model we built scores each player’s progress against a worked answer key with named steps, and a larger language model writes hints when the opponent approves one. Accounts, match history and ratings live in Supabase, with sign-in by emailed code.
Challenges we ran into
Judging handwriting live is hard to make both fast and fair. Early versions made players simplify sometimes and not others, showed 100 percent progress without a win, and lost matches to a dropped connection. We fixed it by mining our own match logs, building an offline benchmark of about 37,000 generated pages, judging every line on its own, and letting the exact checker, not a model, decide wins. We also had to fit every screen on a 2021 iPad, survive reconnects, and ship eleven TestFlight builds in two days.
Accomplishments that we're proud of
A full match loop that works on real iPads over the internet: code, join, write, live progress, opponent-approved hints, automatic win, both pages revealed, rematch. Zero false wins on our benchmark with 98.8 percent of correct answers accepted in every form we tried. Rendered maths everywhere, including what the judge read from your handwriting.
What we learned
Ask models the right question and give them the answer key. Keep anything that decides a winner deterministic. Log everything, because the bugs that matter only show up in real matches between real people.
What's next for Reef
Questions generated on the fly for any subject, an untimed tutor mode on the same writing surface, named-mistake feedback, ranked competitions between schools, and a public TestFlight beta.
Built With
- cloudflare-workers
- durable-objects
- mathpix
- pencilkit
- postgresql
- resend
- supabase
- swift
- swiftui
- testflight
- typescript
- websockets
- xcode
Log in or sign up for Devpost to join the conversation.