Skip to content

Web app

公彦赤屋先 edited this page Aug 12, 2024 · 3 revisions

Oshi web app

What, and why?

As much as you don't have to pay anything to install third-party apps on android, iOS users have to pay a yearly fee to install apps from sources other than the App Store, use half-assed solutions like AltStore or rely on the app developer to pay $100/year for a dev account with TestFlight support.

The web app mode is a solution to that problem, allowing you to install apps on your iOS device without the need for a Mac, a dev account, or a jailbreak. It's the same as the regular app, but it runs in a browser. No data is stored on the server, as there is no server the app is served directly from GitHub and only runs on your device.

Again, the site is static and everything happens on your own device, no one's going to steal your passwords or look at your pathetic grades. (Or pity you for the 10th warning in a row for merely existing.)

Initial setup

  1. Open the PWA page and click 'Share'
  2. From the share menu, select 'Add to Home Screen'
  3. Click Add, and continue with further app setup

App setup

Some sites the app's going to scape use Lax Cookie headers, which block us from interacting with them and their data. To overcome this, you'll need to set up a simple proxy server on render.com to bypass this restriction. The whole setup won't take you longer than 5 minutes, no credit card or coding is required.

Render.com setup guide

Collapsed to save space, click to expand!

Setup Instructions

To set up Dairi with render.com, follow these steps:

  1. Sign up for an account on render.com if you haven't already

  2. Create a new web service on render.com and choose 'Public Git Repository'
    Screenshot

  3. Paste Dairi's link under the 'Public Git Repository' field
    Screenshot

  4. Set upp all properties as shown in the image below, and choose your own service name
    Screenshot

  5. Select the 'Free' tier for 750h of uptime each month, which is just about enough for us (31.25 days)
    Screenshot

  6. Click 'Deploy Web Service' and grab the URL of the service once it's deployed
    Screenshot
    Screenshot

  7. In the Oshi web app, paste the proxy endpoint address to use your new service image

  8. Do some testing to ensure that you can now make cross-origin requests

Anything else?

As the installed web app isn't guaranteed to always have some background service available* (more on that later), background refresh is not supported when using it. You may also notice some changes in rendering and visual styles — however, that's just how flutter rendering works, let's hope nothing breaks and carry further on.

The *

Remember your personal web service that you a great developer, set up all by yourself use to bypass the CORS-related cookie issues?

We can use this server to periodically refresh data on its side (or listen to notifications from other services) and send push notifications to the installed PWA, which are going to be handled by your web browser. Right now, there's no implementation of such service available for public usage (or cloned runners, like render.com).

This feature is planned and will require some additional work to include necessary security measures — as much as multi-user support. It is also possible to implement such feature by making the flutter app server-side, which would probably replace the proxy but require additional authentication measures, like accounts or passkeys. In this case, though, the whole thing would be much less secure than it is now.

Clone this wiki locally