Skip to content

refactor(budget-tool): Use supabase for budget storage and code sharing functionality #500

@chrismclarke

Description

@chrismclarke

Is your feature request related to a problem? Please describe.
We are planning to remove the legacy firestore database, that is currently used solely for sharing budget codes. We want to keep the sharing functionality, and so need to add support within supabase for this instead

Describe the solution you'd like
Likely a single budgets table that can be used to store budget data with additional column to populate sharing code.
2 Backend endpoints to enable creating a share code (e.g. /budget/share) and importing from a code (e.g. /budget/import)

Keep the db schema reasonably minimal - we don't need individual columns for all the budget data, can most likely just store created_at updated_at share_code and data columns, where the last data column can store all the data that is currently stored for a budget (the full IBudget type). This will result in nested data.data, but I think that's fine for now

Additional context

  • Once migrated we should be able to convert the legacy database to readonly and mark for future deletion.

  • For now I think we can consider only uploading budget to supabase when the user wants to share (by default all budgets just stay on user device). But in the future we may want to consider auto-uploading all user budgets if useful.

  • Don't worry too much about handling local budget storage, currently budgets are stored in a legacy db system using dexie (not rxdb), and so we won't worry about creating any new rxdb schemas right now (future task).

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

Next Priority

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions