A Knights of Columbus assembly near me has run a football raffle for more than 35 years. Each year about 200 paper booklets go out, each one a book of tickets. Every ticket lands on a 10×10 grid, every row and column gets a digit in a sealed draw, and at the end of each game the last digit of each team’s score picks the winning ticket. Then it repeats, every game, all season, from one ticket sold once.
The treasurer carries all of it: who sold which booklet, the draw, watching every game to find the winners, mailing checks, and the state’s raffle registration and annual report. California Penal Code §320.5 sets the terms. At least 90% of gross goes to charitable purposes, and raffle tickets cannot be sold online or by any electronic means. So the one thing this software must never do is digitize the sale. That constraint shaped every decision that followed.
SundaySquares is the treasurer’s back office, not a sales channel. Organizers create a raffle, print the booklets, and record in-person sales as volunteers make them. The platform runs the draw, syncs live scores, picks the winning tickets, and produces the report the treasurer needs. Patrons follow their tickets on a phone with nothing to download. No money moves through the platform, by design and by statute.
SundaySquares is a multi-tenant Next.js application with Supabase for Postgres, auth and realtime, Drizzle for schema and migrations, and hand-authored row-level security. It ships as a progressive web app so patrons never install anything. Every push runs the unit suite, a database harness that replays all migrations from scratch, and an end-to-end run before anything is promoted to production. The original online payment path was removed outright rather than left dormant, so the code cannot drift into the one thing the statute forbids.
The most important product decision here was what not to build. Every comparable product monetizes the money flow. The statute made that decision for us, and the product is better for it: because the platform never touches a sale, nothing it does can put a council out of compliance. The harder call was the second one, removing the payment code entirely instead of leaving it switched off. Switched-off code gets switched back on eventually.