ben-ryder / localful

Build single-user local-first web apps with a focus on simplicity, interoperability and longevity.
GNU Affero General Public License v3.0
1 stars 0 forks source link

Add multi resource support #11

Open ben-ryder opened 1 year ago

ben-ryder commented 1 year ago

Describe the feature Currently the server only supports one set of changes per user, meaning that applications can't support mutliple resources at the same time.

A "resources" feature could be added which does the following:

Resources could be a more standard API resources and would not be 'local-first' in the same way that data contained within changes are.
A change would have a relationship to a resource entity via an additional resourceId field and the userId would be removed from changes in favour of using the ownerId on the vault for access control checks.
On the deletion of a resource this should cascade to deleting all related changes, and on deleting a user this should cascade to deleting all resources (and changes).

Additional context I need to consider if adding a 'resourceId' field to changes would be enough, or if this seperate API resource would be useful.