The shape of the system
Casa Conect is a single codebase, a monorepo, containing a small number of deployable applications and a larger set of internal libraries that they share. Everything is written in TypeScript in strict mode, and every piece of external data is validated against a schema at the boundary.Applications
Libraries
Each library has one responsibility and a narrow public surface.Design principles
Narrow surfaces
Narrow surfaces
Libraries expose small, specific entry points rather than general-purpose clients. The cache is not a generic key-value client, but some thirty modules, each owning one concern. Storage is a single gateway. There is exactly one code path that writes to a Word document from the add-in.
One implementation for each concern
One implementation for each concern
Every route by which a document arrives passes through the same indexing function. Every version, from any surface, lands in one history. There is one agent for every situation, configured per request, rather than a family of agents that could drift apart.
Fail closed where it matters, fail open where it is safe
Fail closed where it matters, fail open where it is safe
Security decisions fail closed: an incomplete malware scan, a failed safety review, a limiter that is down during PIN entry. Protective conveniences fail open, with a log entry: a general rate limiter backed by the edge firewall, or a cache read.
Honest degradation
Honest degradation
When something cannot be done exactly, the user is told. A font that cannot be matched is named. A Word construction that cannot be represented produces a notice. A document that is not yet indexed is reported as such.
Bounded work
Bounded work
Every unit of background work has a time limit, a retry policy and a concurrency cap. Agent turns have step budgets. Queues apply backpressure before anything falls over.
Infrastructure as code
Infrastructure as code
The cloud environment is defined in Terraform, with state and runs managed remotely and cloud access through short-lived federated credentials. There are no static keys. Production changes are applied manually after review. Database migrations are applied by the deployment pipeline, never from a developer’s machine.
Technology at a glance
Next
Data flows
Four journeys through the system, end to end.
Security overview
The same system, from a security point of view.