← All selected work

Case study 01 / Public-service regulation

RegMais

Patients reach the right specialist care, in the right order.

In production

My contribution

Designed, built and taken to production independently, to the client’s specification: multi-tenant workflows, the web interface and deployment safeguards.

Core stack

  • React / TypeScript
  • FastAPI
  • SQLAlchemy / Alembic

The 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.

  1. Waiting list

    Specialty · priority · waiting time

  2. Allocation preview

    Compatible patients · available slots

  3. Operator confirms

    Explicit action before allocation

Interaction flow. Previewing compatible patients does not itself allocate them.

Engineering decisions

01

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.

02

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.

03

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.

RegMais allocation preview showing that no compatible patient is waiting, and that the queue remains unchanged until confirmation.
Actual interface captured during earlier local QA. Empty allocation state; no patient records are shown. Portuguese is the product’s operating language.

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.