Case study 01 / Public-service regulation
RegMais
Patients reach the right specialist care, in the right order.
In productionThe problem
Public-sector staff coordinate demand against limited appointment capacity. An allocation interface must explain who is eligible and why they appear in the queue, while preserving a clear boundary between reviewing a proposal and changing patient records.
System structure
A boundary worth making explicit.
The React client presents patients, service demands, queues and agendas. FastAPI routes manage the relational records. Tenant-scoped entities and API checks keep each tenant’s data separate; production configuration guards reject insecure defaults.
- Waiting list
Specialty · priority · waiting time
- Allocation preview
Compatible patients · available slots
- Operator confirms
Explicit action before allocation
Engineering decisions
Separate preview from commitment
The interface fetches the queue when the preview opens, filters waiting patients by specialty and limits the proposal to available slots. The allocation action is separate, so the operator can inspect the proposal first.
Treat unsafe configuration as an error
Production startup validation rejects the default session secret, insecure cookies, SQLite and an empty CORS allowlist. Configuration mistakes are made visible before the service starts.
Protect records with history
Patient and queue deletion routes check linked operational history. This puts the consequences of deletion into the domain workflow rather than leaving them to a generic delete button.

Verification & current state
Repository tests exercise tenant isolation using synthetic tenants. The allocation component implements loading, unavailable-queue, no-agenda and no-compatible-patient states. The deployment workflow includes explicit release gates and health checks.
The public-sector regulation workflows are in production. Each new deployment requires environment configuration, release verification and authorization to handle real patient data.