The practical flow in the @life-manager/db package:
| Table | Key Fields |
|---|
work_project | title, salary, currency, folder_id, color |
work_folder | title, parent_folder (hierarchical) |
work_time_entry | start_time, end_time, project_id, paid |
work_project_tag | project-tag mapping |
| Table | Key Fields |
|---|
appointment | title, start_date, end_date, status (optionally linked to work) |
| Table | Key Fields |
|---|
bank_account | title, currency, saldo |
single_cashflow | amount, date, bank_account_id, contact_id, tag_id |
recurring_cashflow | amount, interval, start_date, bank_account_id |
finance_project | title, start_amount (groups related cashflows) |
finance_project_adjustment | adjustments to finance projects |
finance_project_tag | project-tag mapping |
| Table | Key Fields |
|---|
tag | reusable tags for categorization |
contact | contacts for transactions |
| Table | Key Fields |
|---|
profiles | id, username, full_name, email, avatar_url |
notification | system notifications |
work_project -> work_folder (hierarchical organization)
work_time_entry -> work_project (time tracking per project)
appointment <-> work_time_entry (optional linking)
single_cashflow -> bank_account, contact, tag
payout -> work_project (converts work to payment)
| What | Import from |
|---|
PowerSync schema (AppSchema) | @life-manager/db/schema |
Supabase types (Tables, Enums, Constants) | @life-manager/db/supabase |
| Domain types | @life-manager/db/types/work, @life-manager/db/types/finance, @life-manager/db/types/system |
| Query hooks | @life-manager/db/hooks/queries/* |
| Action hooks | @life-manager/db/hooks/actions/* |
| Mutation hooks | @life-manager/db/entities/<domain>/<entity> |
| Zod schemas | @life-manager/db/schemas |
| Platform | Package | SQLite Backend |
|---|
| Web | @powersync/web | wa-sqlite |
| Mobile | @powersync/react-native | @powersync/op-sqlite |
Both share the schema from @life-manager/db/schema.
- Types auto-generated:
packages/db/src/supabase.types.ts
- Regenerate:
bun run generate-types from root
- Auth handled via
@supabase/ssr for SSR compatibility