Project 04
Law & Trial Association Competition App
Runs the mock trial competition I launched at the Law & Trial Association, the pre-law organization I founded at UT Dallas, from sign ups and team building to judges' ballots and a live leaderboard.
Who uses it
The association's officers, who run the competition from the officer console, plus the student competitors, volunteer judges and visiting witness schools, who each get their own sign up, confirmation or ballot page.
Why it was built
The mock trial competition outgrew spreadsheets and group chats: teams, dues, two days of trials, judges, witnesses, event staff and scoring all had to line up. I built it into the association's existing site so it shares the same members, sign in, email and database instead of becoming another tool to keep in sync.
What it does
Students sign up behind UT Dallas sign in, name the partners they want, and acknowledge the dues. Officers build teams with a drag and drop board that shows each person's year, experience and partner requests, and a team locks automatically once everyone on it has paid. Judges and witness schools register without an account and claim seats on specific trials until every seat is filled, and judges get a confirmation email with a private link to change their trials. On the day, officers run a two day schedule with per person check in, a staff shift rota, and ballots that judges fill in from a private per round link. Scores roll into a leaderboard that seeds the final rounds, shown on a public live page and a courtroom projector view with a QR code.
What it serves
It lets a small team of student officers run a two day mock trial competition from one console instead of spreadsheets and group chats. Success is every team, judge, witness and staff shift accounted for before the day, and results that reach the live board the moment a ballot is saved.
Under the hood
It lives inside the association's Next.js 15 and Supabase codebase, with the officer tabs under the console route and the public pages under /competition, backed by its own migrations for teams, rounds, matches, ballots, rubric, shifts, check ins and registrations. Ballot scoring, round results and rankings are pure functions shared by the console, the judges' ballot route and the public live feed, so all three always agree, and they are covered by node:test suites. Seat claims for judges and witness schools run in Postgres functions that lock the trial row first, so two people racing for the last seat are handled one after the other. A plan checker works out everything that looks wrong from the data alone, such as conflicts, overlaps and open seats, and shows it on both the overview and the schedule.
Flow
- Sign up
- Team
- Trial
- Ballot
- Score
- Leaderboard
Built with
- Next.js 15
- React 19
- TypeScript
- Supabase
- Postgres functions
- Resend
- Tailwind CSS
- node:test
- Vercel
How I built it
- I wrote a design spec for the competition sign up and homepage section first, then built the form and moved sign up behind member login and off Airtable.
- I added the logistics module with teams, a two day schedule with suggested pairings and conflict checks, judges and staff, witness schools and a printable schedule.
- I built the live side next: check in, scoring with ballots entered from paper or by judges from private links, a tested ranking function that fills the final rounds, and a public live leaderboard kept hidden behind a flag until competition week.
- I added the drag and drop team builder, the staff shift rota, judge and witness school registration with atomic seat claims, and dues tracking that locks teams once everyone has paid.
- I wired team emails and dues notices into the existing email editor, then added a team CSV import with a preview, a dry run script and undo, a competitor confirmation form and a roster status page.
- I finished with per trial judge seats, confirmation emails with a private manage link, and officer controls for seats and visibility with CSV export.
Key decisions
- I put ballots, round results and rankings in one module of pure functions with only type imports, so node --test can load it directly and the console, ballot links and public board can never disagree.
- Each round has a lead and a shadow ballot, and a team's round score is the average of the two, with ties going to ballots won and then the tiebreak category, which matches how the competition is judged.
- Judges score from a private per round link whose token decides which ballot it writes, so a judge can only fill in their own, and the link goes read only once the round is complete.
- Seat claims run in security definer Postgres functions that row lock the trial and can only be called by the server, which keeps registration correct under simultaneous sign ups.
- The public live feed reads straight from the tables officers write and returns only team names, schools, times and scores, so there is no publish step and no personal data on the public page.
- Team logistics emails carry no unsubscribe link or bulk header, because they go to people who registered and should not be filed under Promotions.
