Tangerine-Community / Tangerine

Digitize your offline data collection. Create your Forms online with Tangerine Editor, conduct them offline with the Tangerine Android App. All results you collect can be exported as a CSV file, easy for processing in a spreadsheet. Tangerine has been used in over 1 million assessments and surveys in over 60 countries and in 100 languages.
http://www.tangerinecentral.org/
GNU General Public License v3.0
49 stars 29 forks source link

Form Developer uses Tangerine Preview PWA to preview content (as opposed to CLI) #2326

Open rjcorwin opened 4 years ago

rjcorwin commented 4 years ago

With the Native Filesystem API releasing from behind a flag in the next Chrome version, we could alleviate the need to use the command line to start tangerine-preview by offering it as a PWA.

We could publish the Tangerine Preview PWA to something like https://app.tangerinecentral.org, https://tangerine-preview.tangerinecentral.org... or the https://tangy.app URL I scooped up when the .app TLDN launched.

rjcorwin commented 4 years ago

In the Tangerine client app, we would need to support detection of not having an assets folder (a check for ./assets/app-config.json would do), if it doesn't exit then forward the user to a route showing a "content import" screen. The content import page would utilize the Native Filesystem API to select and gain read access to the local content folder. Then the trick would be using a Service Worker to proxy HTTP requests to ./assets/* over to the contents of the local content folder.

rjcorwin commented 4 years ago

Three parts...

  1. Detect lack of content folder and do a redirect.
  2. Content import screen to gain access to the local hard drive.
  3. Service Worker to proxy local content folder on hard drive to ./assets/.