Case study · 2026
IN DEVELOPMENTMeritus
A university merit and event platform — student, staff and admin portals, a QR attendance app and one API — built, audited, and held back from pilot on the audit’s own verdict.
- Commits
- 159
- Web routes
- 132
- Entities
- 66
- Tests
- 67
Role · Sole engineer — domain model, API, web portals, mobile client, audit
Context
Co-curricular records decide things that matter to students: scholarship eligibility, awards, graduation clearance. In most institutions they still live in a spreadsheet that someone updates after an event, from a signed attendance sheet, by hand.
Meritus was meant to replace that loop: students register for events, check in by QR, accrue merit points, and receive a certificate that anyone can verify. Staff create events, approve them and report on participation; administrators see the whole institution.
It is a monorepo: a Next.js portal for three roles, a NestJS API, PostgreSQL underneath and a Flutter app for the scanner at the door. It was built through 2026 and then audited against its own release gates. The audit said no. That verdict is the most useful thing in this study, so it is not buried.
The problem
Merit is a ledger, not a counter
Points accrue from attendance, convert into tiers, and are later read by a leaderboard, a transcript and an award report. If more than one table holds the number, the platform can show a student three different totals and be wrong in a way nobody can trace.
Attendance and eligibility are different claims
Registering is not attending. A certificate rule that keys on registration issues certs to no-shows, and a verifier that ignores revocation keeps calling withdrawn certificates valid long after the mistake.
Roles are coarse; events are not
A role guard answers "is this an organizer". It cannot answer "is this organizer allowed to touch this event", and the second question is the one that matters when two clubs run events in the same term.
Constraints
- The university owns hosting and data residency — no managed cloud database
- No third-party auth provider: accounts, sessions and revocation are the platform’s problem
- Deployment had to fit the institution’s own container host, not the other way round
- Merit bands, tiers and approval rules are institution-specific: configuration, not branches
- No real student data in any environment I control — synthetic records only
Decisions
The choices that carried most of the system. Each one lists the alternative that was on the table and the bill that came with the choice.
A modular monolith: one NestJS API, 27 feature modules and 66 entities behind a single deployment.
- Not this
- Splitting events, merit, certificates and reporting into separate services.
- Why
- Merit is written by attendance and read by certificates, transcripts and reporting. Those flows need one transaction boundary, and one engineer cannot operate four deploys and a message bus for a first release.
- The cost
- Module boundaries are conventions, not walls, and they eroded exactly where the pressure was: four modules were built but never composed into the application root while the UI called their routes. The audit found that, not the compiler.
PostgreSQL on the institution’s own host, managed through their container panel.
- Not this
- Managed Postgres — the faster default, with backups and failover included.
- Why
- Data residency was a stated institutional requirement, and IT wanted administrative control of the database itself. That is a legitimate constraint even when it is the more expensive engineering answer.
- The cost
- Backups, restore rehearsals, upgrades and failover are mine and IT’s to run. At audit there was no demonstrated restore of the database or of uploaded files — a gap that blocks a real-data pilot no matter how good the schema is.
Custom JWT sessions inside the API: short-lived access tokens, refresh tokens stored server-side and rotated on use.
- Not this
- A hosted auth provider, which is what I would choose for a product with no residency constraint.
- Why
- The institution would not route identity through a third party, and accounts are institutional email addresses rather than social logins. Owning the session means owning revocation, which a provider would have handled.
- The cost
- Rotation, revocation and reuse detection are now code with edge cases: mobile rotation was incomplete at audit, and a shared seeded credential shipped in a bundle before it was removed.
An append-only merit ledger with snapshot leaderboards.
- Not this
- Recomputing totals live from event records on every read.
- Why
- Official numbers have to stay reproducible after a rule changes, and a leaderboard that recomputes is a leaderboard that rewrites history when a band moves.
- The cost
- Two representations of the same fact, which have to reconcile. At audit merit was still split across an awards table and a ledger table, so the rule was documented before it was enforced — the exact failure the decision was meant to prevent.
How it is put together
- Clients
- Next.js 14 portals for students, staff and administrators — 132 routes — plus a Flutter app for QR check-in and manual overrides, 12 screens.
- API
- NestJS REST monolith: 38 controllers, 56 services and 27 feature modules, with JWT and role guards applied at the boundary.
- Domain
- 66 TypeORM entities and 47 registered migrations covering events, registrations, attendance, the merit ledger, tiers, approvals, certificates and institutional reporting.
- Data
- PostgreSQL on the institution’s host, with file metadata separated from file bytes — the storage decision was object storage, the implementation at audit was container-local disk.
- Operations
- Docker images deployed through the institution’s panel; a CI workflow exists in the repository but was disabled, so nothing enforced the gates between a commit and a deploy.
What broke, and what it taught
A case study that only lists wins is a sales page. These are the defects the audit found in my own system, how each surfaced, and what fixing it takes.
Defect
Public self-registration created an active student account without proving mailbox ownership or enrolment.
Found by
A self-audit on 31 July 2026 walking the registration-to-login path as an outsider would.
Fix
New accounts land in a pending state that cannot log in until the address and enrolment are verified; unrestricted registration stays off until that flow is tested.
Defect
Report access was role-based, not event-scoped — one organizer could read or modify another organizer’s report.
Found by
The same audit, mapping every guard against the route table instead of trusting that a guard existed.
Fix
An event-scoped policy check in the service layer, with negative tests per role: the test asserts a refusal, not a success.
Defect
Certificate eligibility counted registered and pending users, and the legacy public verifier reported revoked certificates as valid.
Found by
Reading the issuance query and then the verifier that answers for a certificate number.
Fix
Eligibility derives from attendance records only, and verification reads revocation state — two queries, two tests, one of them asserting a revoked certificate fails.
Defect
Merit was split across two tables while several admin actions were simulated no-ops that reported success.
Found by
Reconciling the five read paths — rewards, portfolio, leaderboard, reports, transcript — against each other on the same synthetic student.
Fix
One ledger becomes the source of truth and the rest derive from it; simulated actions are either implemented or hidden behind a flag so no screen can claim a record changed when it did not.
Evidence
- 159 commits and 2,099 tracked files in a private monorepo, checked 30 November 2026
- 132 web routes, 66 entities, 47 migrations, 27 feature modules and 12 mobile screens, counted from the repository tree
- 67 automated tests in 7 files — 40 API, 25 web, 2 mobile — passing at audit on 31 July 2026
- A written engineering and security audit with a NO-GO verdict and ten named blockers, which is why no pilot ran
- No public host exists to overstate: the documented domain does not resolve
Checked 30 November 2026. Private repository, no deployment. The platform was audited against its own release gates and held back from a student-data pilot; walkthrough on request.