foundathon
foundathon 3.0 needed a way for close to 1,000 people to sign up as teams and grab a track before its slots ran out. i built most of it in about three weeks.

how signing up worked
- sign in with google
- fill in your team, srm or non-srm, with each member's details
- lock one of 10 problem statements. the server hands back a signed token that's good for 30 minutes
- register. if that track still has room, you get a team dashboard with a qr ticket and a place to upload your ppt
admins got a setting for how many teams each track takes, a review screen to accept or reject teams, mass mails for decisions and ppt reminders, and two stats dashboards with csv exports.
the tech is standard: next.js on supabase for auth, postgres and file storage, zod for validation, and resend for email. before it opened i did a security pass: rate limits on upstash, origin checks on every write, and ppt uploads checked by their first bytes instead of their file extension.
the hard part
every track had a cap, and the check ran in app code: count the teams on that track, then insert. two teams going for the last slot at the same moment could both pass the count. i wrote a postgres function that takes a lock per track and does the count and the insert together:
perform pg_advisory_xact_lock(
hashtext(p_event_id::text),
hashtext(p_problem_statement_id)
);then i never wired it in. it's still the first unchecked todo in the readme. no track went over its cap, but only because no two teams hit a last slot at the same moment. next time the cap check lives in the database from day one.
contributors
- greeenboi: set up the project and supabase, built the landing page animations, and reviewed prs
- mohakdev: the first supabase integration and auth pass, and a fix for the team dashboard
- saranshbangar: validation and ui fixes on the register page
- yatinannam: reviewed and merged most of the prs