BACK TO PROJECTS
2026-07-11

PASMUN Alpha — Conference Operations Portal

Digital operations and automated delegate allotment portal for PASMUN, featuring Keystatic CMS, live Google Sheets API syncing, and a multi-constraint cost-heuristic committee allocation algorithm.

Next.jsReactTypeScriptKeystaticTailwind CSSGoogle APIsNodemailer
[ Source Code ]✓ VERIFIED STABLE
[ Target Hardware ]Microcontroller / Edge Node

Anyone who has ever helped organize a Model United Nations conference knows the sheer, unadulterated nightmare of delegate allotments. You open registration, collect hundreds of responses, and suddenly the Secretariat is stuck staring at bloated Google Sheets at 2:00 AM, arguing over which school lobby gets the UN Security Council, trying to stop six best friends from the same class section from taking over the Human Rights Council, and manually cross-referencing delegate preferences against committee vacancies. I built PASMUN Alpha as the full digital infrastructure and operational backbone for PASMUN Bokaro specifically to automate that chaos out of existence.

The public face of the platform is built on Next.js 16.2.10, React 19.2.4, and Tailwind CSS, backed by Keystatic CMS (@keystatic/core ^0.5.51). Keystatic lets our executive board edit committee background guides, country matrix rules, executive staff bios, and conference schedules without touching GitHub or needing an external database. For delegate intake, custom registration forms validate student inputs and stream them straight into Google Sheets using the official googleapis SDK (^173.0.0). I also implemented a pre-conference countdown holding gate at /(gate)/hold to freeze traffic until registration officially went live.

The technical crown jewel of PASMUN Alpha is the automated cost-heuristic committee allocation engine in src/app/api/admin/allocate/route.ts (implemented in commit d80a693 "feat: implement balanced class divisions and star student system with cost heuristic committee assignment"). Instead of random portfolio lotteries or biased manual picks, the algorithm balances four strict, competing operational constraints:

  1. Grade 7 Delegate Cap: Younger middle-school delegates need balanced room dynamics so they don't get drowned out or clustered together. The algorithm enforces a hard ceiling: grade7Cap = Math.ceil(totalGrade7 / 3), ensuring junior delegates are distributed smoothly across introductory committees.
  2. Star Student Distribution: Seasoned delegates (isStar: true) who have won past best delegate gavels can completely distort debate if they all pile into the same crisis council. The system splits delegates into star and non-star tiers, runs a Fisher-Yates shuffle (shuffle()), and distributes veteran speakers evenly across all committee rooms.
  3. Class Section De-Clustering: To prevent cliquey voting blocs and friendly procedural lobbying, the allocator tracks real-time section tallies (classCounts) and heavily penalizes assigning delegates from the same school class section to the same committee.
  4. Three-Tier Preference Cost Optimization: The solver maps each applicant's 1st, 2nd, and 3rd committee preferences (committeePref1..3) into a weighted cost matrix. It minimizes aggregate disappointment while strictly respecting the committee capacity and balance constraints.

Once the allocation matrix is finalized, an automated transactional email pipeline (originally built with Resend and Nodemailer, then migrated to dedicated Gmail SMTP in commit 9d10332) batch-dispatches personalized allotment letters, committee matrices, and payment verification receipts directly to delegates. It turned an agonizing three-day administrative headache into a single-click serverless function.