One thing that makes Hoodie attractive for new projects is how easy it is to start. However when a project needs to store uploaded files the developer hits a wall - there exist no plugins for this functionality (that I could find) and it is not a part of the core functionality.
I propose that Hoodie ships with a standardized file API, e.g. hoodie.files. This would default to saving to a subdirectory in the project directory, e.g. myproject/uploads. The client side API would then be complemented with a server side API that offers a standard way for plugins to overwrite where the files are saved (S3, Dropbox, Google Drive, wherever...). That way the developer could switch to a production environment for the files without any change in the app code.
Considering the offline first philosophy the files API could save files in the local storage untill they are uploaded to the server. This should probably have some file size limit (100kb? 1mb?) so the local storage is not filled when the user wants to upload very large files (like a photo album or a video file). If the app is offline when the user tries to upload a larger file the operation would fail.
I haven't given any thought to security and these is just early thought on the matter. Any thoughts? :)
One thing that makes Hoodie attractive for new projects is how easy it is to start. However when a project needs to store uploaded files the developer hits a wall - there exist no plugins for this functionality (that I could find) and it is not a part of the core functionality.
I propose that Hoodie ships with a standardized file API, e.g. hoodie.files. This would default to saving to a subdirectory in the project directory, e.g. myproject/uploads. The client side API would then be complemented with a server side API that offers a standard way for plugins to overwrite where the files are saved (S3, Dropbox, Google Drive, wherever...). That way the developer could switch to a production environment for the files without any change in the app code.
Considering the offline first philosophy the files API could save files in the local storage untill they are uploaded to the server. This should probably have some file size limit (100kb? 1mb?) so the local storage is not filled when the user wants to upload very large files (like a photo album or a video file). If the app is offline when the user tries to upload a larger file the operation would fail.
I haven't given any thought to security and these is just early thought on the matter. Any thoughts? :)