Context
When someone dies without a will, their family has to sort out the estate during the worst month of their lives.
The build goes after the smallest version of fixing that which is still worth shipping: draft a will and a living will through a guided wizard, generate the print-ready documents, version and register them, and release the right documents to the right people once a death is verified.
The problem
Two constraints decide the whole architecture, and they are not negotiable.
The first is legal. A will is either valid or it is not. That is not a judgement you delegate to a model. If a model invents a clause or quietly drops a residual beneficiary, the output is not a bad autocomplete you can shrug at. It is a defective legal document that surfaces years later, when the person who could have corrected it is dead.
The second is POPIA. Personal data, and the processing of it, has to stay inside South Africa. That rules out many of the convenient managed backends, and it rules out sending the data to commercial models that run abroad.
What I did
I split the system along the line the law draws, not the line the framework suggests.
The Wills Act validity checks are ordinary auditable code in the NestJS core, organised as a module per problem area: will, living-will, legal, vault, audit, rbac, rls, death, dha, retention, document. The will text is assembled from versioned clauses looked up by rule, and the clauses are placeholders until a legal owner signs them off. Documents go into HTML and then to PDF via Gotenberg, and every generated PDF is hashed into an append-only, hash-chained audit log. Tenant isolation is row-level security in Postgres rather than a WHERE clause somebody can forget.
The design keeps one service as the only route to an external model, with personal data removed before a request leaves the country. That service is scaffolded and not built yet.
The deterministic rules decide what lands in the document. AI-guided interviewing is a later phase and is not built.
The result
Documents are version-controlled and recorded in a hash-chained audit log.
The status is worth stating plainly, because the temptation in this category is to overstate it. This is a greenfield MVP. The review deployment has been taken down and nothing is hosted. It is not publicly live and not yet legally signed off. An adversarial review of the spec produced a set of do-not-ship findings, each mapped to the phase it gates, and the Home Affairs death verification is still a stub. The rule the design rests on is that no model output goes into legal text.

