
LiveRegulation as code · in productionCase study
Halqat Wasl
A behavioural note used to travel on paper between four offices for days. Now it reaches the guardian as an approved message — through the exact path the regulation defines.
01The real problem
A teacher’s behavioural note was written on paper and walked between the teacher, the deputy, the counsellor and the principal. It took days. The guardian heard late, or not at all — and when a decision was contested, there was no record to return to.
The regulation itself was never the hard part. The official Conduct and Attendance Rules are precise. The hard part is making forty screens and four roles obey them every single time.
02Decisions
Every constraint maps to an article. The system is built on the Conduct and Attendance Rules (5th edition), and each rule it enforces is traceable to the article that requires it — so a principal can ask why and get a citation, not an opinion.
Approval is structural. No message reaches a guardian before the principal approves it. This is a code path, not an administrative agreement — there is no button that skips it, because there is no route that skips it.
Refuse loudly, not silently. For a first minor offence the regulation requires escalation before a guardian is notified. The system blocks the notice — and tells the principal exactly why, instead of failing with no explanation.
Four roles, genuinely separated. Teacher, student-affairs deputy, counsellor, principal. Each sees only what their role owns. The three school stages are isolated: primary staff cannot see intermediate or secondary data.
The safest field is the one that does not exist. Under the Personal Data Protection Law (PDPL) the system stores no address and no phone number for any student. Not hidden — absent. The only contact numbers it keeps belong to the guardian. Every screen also carries a confidentiality classification and a watermark.
03Built for a real building
School buildings have dead zones. So the system is offline-first: a note recorded with no signal is kept on the device, the screen shows the teacher how many notes have not yet reached the server, and everything syncs the moment the network returns.
Underneath: a progressive web app in plain modern JavaScript, a Cloudflare Workers backend with a D1 database, and bidirectional sync that resolves conflicts and preserves deletions across devices — because a note deleted on one phone must not resurrect from another.
04Outcome
Delivered, configured and in daily use: 22 staff (19 teachers, the student-affairs deputy, the counsellor and the principal), 103 students, and more than 1,300 documented events in the action log — each recording who acted, when, and in what capacity.
Handover included data setup, staff training, a usage handbook and post-launch support.
05What it cost, and what it does not solve
Offline-first sync is the hardest part of the system and the easiest to get subtly wrong. Conflict resolution and deletion propagation had to be designed deliberately; a naive last-write-wins would have silently lost data.
And a system that holds behavioural records about minors is a high-value target by definition. Minimising what is stored is the strongest control available — which is why the absent fields matter more than any encryption on the present ones. It is a control, not a guarantee: a system that holds behavioural records about minors can reduce its exposure, never remove it.
06Screens9
Demo dataEvery name and figure in these screens is demonstration data created for display.
07What you can check yourself
Each row is a source you can open or a method you can repeat.
- LinkAn internal school system — there is no public page to link to.
- Screens9 screensEvery name and figure in these screens is demonstration data created for display.
Talk about this project
For judges, mentors and security teams — WhatsApp and email reach me directly, and I reply myself. Open to mentorship and cybersecurity programmes.