How the concept of Offline POD works?

From my understanding about SOLID so far, an applications that makes use of SOLID has to be connected to web if the application dependent on a POD storage provider. I was thinking, Is there a way to make a PC based solid app work both online and offline? Like storing a copy of app data folder locally and synchronising with the POD when online. (I know it might contradict the goals of SOLID but there have to be a way to make Offline apps work). Or am i missing something about offline PODs? It will be great if someone could shed light on the whole offline concept.

What you are imagining is feasible and I think @Jeffz has done work on using local storage so this can sync with a pod.

I think that is still work in progress, but another way to use Solid offline is to run your own server, either on your client machine, or on your local network.

1 Like

Solid-Rest can, for many purposes, treat the local file system as a Solid pod when used from nodejs or the command line. This is built into solid-auth-cli and rdflib and works now. Solid-Rest also works in the browser using localStorage, and that is also working now.

2 Likes

Thank you.

Thanks for your reply. Lets say i have an app in PC which makes use of a POD from solid community. I also downloaded the POD locally to provide the offline support. But in the app when i make a reference, i usually refer to a file using URI. How can this be solved? possible to use any mapping table?

One more question, Is it possible to access a POD from an android app? I want to create a mobile application which can store data to a solid POD. I am not sure how to implement the solid auth client and the file manager.

Files in the local file system are addressed via file:// URIs with file:/// being the root of your local filesystem. Files in the browser’s localStorage are addressed with app:// URIs with app:/// being the root (simulated) folder in the localStorage system for that app. In terms of android. From the command line or script (e.g. using termux) nodejs and therefore solid-auth-cli, rdflib,solid-file-client, etc. should run. For a browser-based app in android, I would think using CDN to solid-auth-client and friends would be the way to go or local copies of them for offline use.

1 Like

Thanks a lot for your reply. Will give it a try.

Does ths mean there should be a meta system tracking the syncing of online POD (containing resources with https:// scheme) and local POD (with app:// or file://).

When app first initiated, it creates local POD, and progressively download resources from online POD to local POD. All user request will sent to online POD.
When second time a resources is being fetched, app will replace https:// with file://, and try to refresh resource if it is not offline.

I assume that replace https:// with file:// is easy.

Yes that can work the way you describe. The new Solid-Shell using the new Solid-File-Client - both due out later this week - can do batch uploading/downloading so with a chron job could easily be used to implement a sync.

1 Like

Could you please explain me the diff between solid-rest & solid-rest-file ?

With solid-rest, I was able to put some file on my Android/termux.


Could you give me a simple browser example to access this file ?

Thxs

Very cool! If solid-rest works, then solid-auth-cli, solid-file-client and solid-shell probably also work.

“Could you please explain me the diff between solid-rest & solid-rest-file ?”

Solid-Rest is an umbrella package that does the Solid formatting of requests and responses but the actual request and response come from a plugin specific to a particular backend, The plugin that handles the file-system backend was originally called solid-rest-file but that is obsolete (I should archive it) and now that backend is provided by solid-rest/src/file.js and comes with Solid-Rest.

Could you give me a simple browser example to access this file ?

A normal browser can not directly access a local file-system with JavaScript. Solid Rest is better suited for console-based apps which could use solid-file-client or solid-shell. But there are two in-browser options it could be used for : :

#1, A normal browser can not access files on the file system via JavaScript. It can be done with a customized express browser as I do in Data Kitchen which presents a browser that can access both the local file system and remote solid pods. It would be quite cool if you can get the Data Kitchen working on android.

#2. There are a variety of other in-browser storage mechanisms, none of which can access the full local file system the way a node or express package can - localStorage, indexedDB, file API (which is actually a sandboxed file system, not the full local file system. There is a plugin for Solid Rest (browserFS.js) that handles all of those storage systems as well as others such as Dropbox. These can be run in the regular browser without an express pacakge.

I don’t know much about Android so there may be Android specific solutions I’m not mentioning.

If I wasn’t clear or you have more questions, please ask again.

1 Like

Well, I understand that js can’t access filesystem, but if something like this https://web.dev/native-file-system/ would be implemented in a nice webapp could we interact with the files created by solid-rest the same way as we do with a pod ?:crazy_face:

Yes, the BrowserFS plugin for Solid Rest works with the Native File System API.

1 Like