foundathon

registration for foundathon 3.0, our club's hackathon. teams sign up, grab one of 10 tracks before it fills, and submit a ppt.

2026-02-01 | hack

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.

foundathon 3.0 monopoly edition banner with the founders club logo
the event's social card

how signing up worked

  1. sign in with google
  2. fill in your team, srm or non-srm, with each member's details
  3. lock one of 10 problem statements. the server hands back a signed token that's good for 30 minutes
  4. 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:

create_foundathon_registration_with_cap
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
projects