←back to thread

200 points dcu | 3 comments | | HN request time: 0.653s | source
Show context
TekMol ◴[] No.44456461[source]
Do we still need a back-end, now that Chrome supports the File System Access API on both desktop and mobile?

I have started writing web apps that simply store the user data as a file, and I am very pleased with this approach.

It works perfectly for Desktop and Android.

iOS does not allow for real Chrome everywhere (only in Europe, I think), so I also offer to store the data in the "Origin private file system" which all browsers support. Fortunately it has the same API, so implementing it was no additional work. Only downside is that it cannot put files in a user selected directory. So in that mode, I support a backup via an old-fashioned download link.

This way, users do not have to put their data into the cloud. It all stays on their own device.

replies(5): >>44456656 #>>44456687 #>>44457268 #>>44457361 #>>44460545 #
nico ◴[] No.44457268[source]
> Do we still need a back-end, now that Chrome supports the File System Access API on both desktop and mobile?

Could this allow accessing a local db as well? Would love something that could allow an app to talk directly to a db that lives locally in my devices, and that the db could sync across the devices - that way I still get my data in all of my devices, but it always stays only in my devices

Of course this would be relatively straightforward to do with native applications, but it would be great to be able to do it with web applications that run on the browser

Btw, does Chrome sync local storage across devices when logged in?

replies(2): >>44457578 #>>44460208 #
1. porridgeraisin ◴[] No.44457578[source]
> Btw, does Chrome sync local storage across devices when logged in?

No, but extensions have an API to a storage which syncs itself across logged-in devices. So potentially you can have a setup where you create a website and an extension and the extension reads the website's localStorage and copies it to `chrome.storage.sync`.

Sounds like an interesting idea actually.

replies(1): >>44458046 #
2. nico ◴[] No.44458046[source]
That's a clever solution

I've been playing with chrome extensions recently, and have made them directly talk to a local server with a db. So using extensions, it's relatively easy to to store data locally and potentially sync it across devices

I like the idea of leveraging chrome.storage.sync though, I wonder what the limitations are

replies(1): >>44458110 #
3. porridgeraisin ◴[] No.44458110[source]
> I wonder what the limitations are

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Web...

says that there is a 100kb limit, and a 512 KV pair limit per extension.

Quite limiting, but if this pattern becomes popular I don't see why it can't be expanded to have the same limit as localStorage (5MB)