Skip to content
← All work

Miva Open University (M.IT project) · Nov 2026

ZEGA: campus maintenance requests

Role: Designer and sole developer

ZEGA is a maintenance request platform for a university: students and staff report faults, maintenance officers work them on a board, and administrators assign, monitor and report on every request. One state machine governs every status change, and a hash-chained audit trail records who did what.

The problem

On a university campus, faults such as a broken socket, a leaking pipe or a dead projector are reported by phone call, paper form or WhatsApp message. Requests get lost, nobody can see their status, and there is no record of who did what or how long it took.

Constraints

  • Four roles with different rights: students and staff report, maintenance officers work jobs, administrators assign and report
  • A request must never skip a step or be closed by the wrong person, and every change has to be traceable afterwards
  • Most reports are made on a phone, standing next to the fault
  • One developer, free-tier hosting (Vercel and Neon) and no separate services to run

Decisions and why

  1. One state machine for every status change

    A single module decides which status changes each role may make. The API enforces it and the interface reads it to show only the actions that are valid, so the rules live in one place and cannot drift between front end and back end. Unit tests cover every transition for every role.

  2. A tamper-evident audit trail in the database

    A PostgreSQL trigger records every change with a JSON diff and links each row to the previous one with a SHA-256 hash, so a record edited after the fact breaks the chain. Administrators can verify the chain from the interface. Putting it in a trigger means no code path can forget to log.

  3. The API contract is generated, not written by hand

    Routes are declared with Zod schemas that both validate requests and produce the OpenAPI 3.1 document, with errors in RFC 9457 Problem Details format. The documentation cannot fall out of date with the code.

  4. Live updates without extra infrastructure

    PostgreSQL LISTEN/NOTIFY triggers drive Server-Sent Events, so a status change appears on the work board and the tracking page without a separate message broker.

  5. Tests against a real database

    API and database tests run every route in-process against PostgreSQL (PGlite) with the real migrations, triggers and seed data, so permission denials, transitions and the audit chain are tested as they run in production. Playwright covers the full lifecycle across roles on desktop and mobile.

Result

Deployed with a live demo and generated API documentation. 28 test files cover unit, database, component and end-to-end tests, and CI runs lint, types, tests and a production build on every push. In the November 2026 Playwright run, all 16 end-to-end tests passed.

As of Nov 2026

Stack

  • TypeScript
  • Next.js
  • Hono
  • PostgreSQL
  • Drizzle ORM
  • Better Auth
  • OpenAPI
  • Vitest
  • Playwright
  • GitHub Actions

Evidence and links