Entities
Entity modules live in packages/db/src/entities/<domain>/<entity>/.
This is the main architectural unit of @life-manager/db. Each entity owns its types, schema, query hooks, actions, raw mutations, mutation hooks, guards, and workflows.
Canonical Runtime Pipeline
Section titled “Canonical Runtime Pipeline”query state -> build operation input -> workflow resolution -> mutation enforcement -> raw mutation -> local DB writeThat pipeline is what the rest of this section explains.
Domains
Section titled “Domains”appointmentfolderprojecttime-entrytime-tracker
Finance
Section titled “Finance”bank-accountcontactfinance-projectpayoutproject-adjustmentrecurring-cashflowsingle-cashflowtag
System
Section titled “System”notificationprofilesettings
What “Same Contract” Means
Section titled “What “Same Contract” Means”Every entity is expected to follow the same conceptual shape, even if the logic is trivial.
guardsdefine domain truthworkflowsconvert that truth into typed UI next stepsactionsbuild live inputs from query state and orchestrate interactionsuse-*-mutationsenforce hard invariants before writing- raw mutations stay low-level and transaction-oriented
Simple entities do not get a different architecture. They get a simpler implementation of the same architecture.
Best Reference Entities
Section titled “Best Reference Entities”The strongest current examples are:
finance/single-cashflowfinance/recurring-cashflowwork/time-entrywork/project
See Reference Entities for what each one demonstrates.