Junior Bootcamp CMU
Chiang Mai University’s training portal for junior researchers: cohorts, modules, QR check-in, timed exams, certificates and live monitors for admins and teachers.
- Role
- Solo
- Stack
- Next.js 16 · Prisma 7 · PostgreSQL · SSE

- Problem
- Hundreds of people sit the exam at once; the system can’t fall over mid-exam, and check-in has to be quick.
- What I did
- Built the whole system, then load-tested production with k6 until it broke, and tuned it before the real day.
- Result
- 600 concurrent exam-takers with 0% errors — and a known breaking point at 800, before the real day.
Results
May → Jul 2026 · built solo- Load test, 200 users browsing: 31,635 checks passed (100%), p95 66 ms
- Full exam simulation: 600 concurrent users with 0% errors (but slow); it broke at 800 — the limit was known before exam day
- 28 of 28 targeted E2E tests passed
How it works
- 01
QR check-in
A large projector-ready QR that expires and matches on every device.
- 02
Timed exams
Scheduled open and close, auto-submit, and pre-test before post-test.
- 03
Live monitoring
SSE streams progress live to admins and teachers.
What went wrong — and how I fixed it
Real problems from the commit history, not a highlight reel.
- 01Problem
A capacity ceiling: 10 DB connections over Tailscale, which also dropped idle ones.
How I fixed itPool raised to 25 with keepAlive and timeouts, then load-tested again.
- 02Problem
A refresh or a second device showed a different check-in QR.
How I fixed itOne token per module and action, upserted in the database.
- 03Problem
Timed exams had to close on time and block re-entry.
How I fixed itAuto-close force-submits open attempts; questions are shuffled once and the order saved, so a refresh resumes.
- 04Problem
The live monitor went stale after a dropped connection.
How I fixed itSSE plus a refetch on reconnect or when the tab becomes visible.
Screens
8 screens · click to enlarge- The whole system: Next.js, API, database
- Email OTP and sign-in security
- Load tests and E2E tests