Is there a way to sync PWA web client IndexedDB data to OneDrive? - progressive-web-apps

I am developing a PWA web client app. The data is stored on local IndexedDB.
Is there a way to sync the IndexedDB data to OneDrive with its api? Or I have to develop my own server for syncing data.
I have checked the OneDrive api, and I know it supports files sync. I don't know how draw.io does, seems like it saves the file to OneDrive.
Right now I am considering to change the app to Chrome extension with google sync or make an Electron app to use OneDrive to sync the data.

Related

How to save Flutter web file_picker selections to host directory

There are numerous examples online for using file_picker and uploading to Firestore, SQL etc; but it appears there are none for uploading right to the webhost directory where index.html is being served (i.e ./uploads).
As I am using flutter web in a corporate environment my options for spinning up remote storage options are nearly nil. I merely want my flutter web app to allow users to upload to our own environment (I host my web build off Sharepoint and it works perfect).
The solution for posting to web found here (https://stackoverflow.com/a/65759028/82856) is very close to what I need except for the http.MultipartRequest part as I don't have a server API listening for POST requests. What other options do I have for merely writing uploads to a directory like ./upload? Thanks in advance.

NativeScript : I have to develop an offline app for Android + iOS + Web app. Offline data will be stored in SQLite DB

Using native script, it is possible to access SQLite DB. But is it possible to use SQLite DB from NativeScript + Angular web app?
Anthing you can do in NativeScript Core, you can also do with NativeScript Angular, so yes you can access a SQLite database with NativeScript Angular as all you need is access to the local file system to store the SQLite database.
On the other hand, you mentioned "web app" so not sure if you meant to ask, "Can you access a SQLite database from a shared mobile/web app, using NativeScript Angular for the mobile app, and regular Angular for the web browser app?" If that is what you meant, then no, you wouldn't be able to access a SQLite database from the web app becuase SQLite databases are stored locally as a regular file, so there would be no way for an Angular web app in a web browser to access the same SQLite database file as a mobile app. For this situtation, you would need a traditional database server setup like MySQL, MariaDB, or PostgreSQL, hosted on an external server, where both the mobile app, and the web browser app can access that same database over a network connection. You could easily have the Angular web app, and the database cluster, hosted from the same server.
I personally use a PostgreSQL database server with a shared NativeScript Angular mobile app/Angular web app in production and it works really well. It is really nice to be able to share a lot of the Angular code (mostly core services) between the mobile and web app.

Migrate ionic app in a server as a website

I have an ionic app that is connected to the mySQL database from a server and I want to migrate this app to the same server. I want to use this application as a website, which will continue to extract data from the mySQL database. How can I do that?
Thank you.
First I think you should probably split this into two projects:
the Ionic app, which communicates with the server via the API
the server side API (PHP file) with connection to the database
Usually these two would be in separate (Git) repositories.
You can then execute ionic build --prod to build the Ionic app for the web. The deployable files will be in the www directory once the command has finished. You can copy the files in this directory to a webserver like Apache or nginx, or you can easily deploy it to Firebase Hosting for example as well. It's just static files (HTML, CSS, JS, images, etc.).
You can find more information about deploying an Ionic app as a PWA (progressive web app) here. It also shows you how to deploy to Firebase Hosting, which has a free plan to get started with.

Can I read from a private google cloud storage bucket from the client frontend

I have a cordova app running on android with a spring boot backend.
In the app the client can upload a photo.
At the moment the file is uploaded to google cloud storage via the backend, who has a service credentials file.
When we want to display a photo in the app should the photo be read from google cloud platform via the spring boot app?
Or can we read directly from the google cloud bucket, (in this case how do we authenticate)?
I would say it's simplest to read the data from GCS in the Java code, and then serve the data from your application.
An alternative you could consider is to generate a signed URL in your backend; the client can then use that signed URL to fetch the data. The Google Cloud Storage client library should make generating the signed URL fairly straightforward. You'll want to regenerate each time the client loads a page of photos though, as signed URLs (deliberately) have a limited lifespan.

Progressive web app unable to download files

Good day
I am currently trying to develop a progressive web app for a Moodle site, but I am unable to download files from the Moodle site.
I made use of https://www.pwabuilder.com/ to build the PWA and generate the service workers. I added the service workers to the https Moodle site, as required. The service workers are registered as they should be when using the PWA.
The PWA work perfectly for opening external links soos as URLs (URLs open in the app browser as needed).
I am however unable to download any files such as pdf documents from the moodle site.
I tried to develop an Ionic app with a basic iframe which embeds the Moodle site in order to determine if that would work. I was able to open external links as well, but still unable to open/download documents.
I then embedded the following website http://www.pdfpdf.com/samples/ in an iframe in an Ionic app, which hosts some sample pdf files. I was then able to download the pdf documents as needed.
I them embedded another website from another server that we have, but was also unable to download any documents
When emulating the Ionic app in a browser, I have always been able to download files as needed, as it is just another "browser" accessing the files.
So my guess is that some configuration on the server is blocking the download of files when requested from an app such as a progressive web app?
Any help or pointers would be highly appreciated.