Database Architecture
Lumio uses TypeORM with migration-driven schema changes and explicit entity definitions.
Entity model
The backend defines 50+ entities under backend/src/entities. Highlights:
statement,transaction,import_sessionfor ingestionworkspace,workspace_member,userfor tenancyaudit_event,notification,report_historyfor governanceintegration_token,gmail_settings,dropbox_settings,google_sheetfor integrations
Migrations
- Stored under
backend/src/migrations - Schema changes are always migration-based (
synchronize: false) - Idempotency checks are run in CI by applying migrations twice
Data safety patterns
- Soft deletes for recoverable data removal
- SHA-256 hashes to prevent duplicate statement imports
- Idempotency keys for integration and webhook calls
Indexing and performance
Transaction-heavy tables include indices for workspace, date, and hash fields. Deduplication uses both hash comparisons and similarity thresholds (date, amount, text).
Next: Parsing Pipeline