Silverfeelin / SkyGame-Planner

Sky:CotL unlock planner/tracker
Other
17 stars 3 forks source link

Multi Device Integration #87

Closed ChakraaThePanda closed 2 months ago

ChakraaThePanda commented 2 months ago

As it stands right now, the information on our collection is saved through some kind of cookie on our browser.

It is exportable, yes, but it would be a lot more conveniant if we had the ability to login and save the database on an "account", to check out progress on all our devices, whether it be on Mobile, PC, PS5, etc.

Exporting/Importing all the time could result in lost data if we forget one day, and is a pain to do between all devices.

Many similar types of websites use the Discord API to create such accounts to save info.

Silverfeelin commented 2 months ago

Hi, thank you for your suggestion!

To allow the website to be hosted for free I wrote everything to be served through static files and to store everything locally. Having a back-end would quickly result in me having to pay for servers to keep the website running, so this is a much safer option.

I had actually looked at using cloud storage services like Dropbox (#60) to allow you to connect Sky Planner and have it automatically back up the data to your account. That way you'd be able to sign in to your Dropbox on multiple devices and have everything work smoothly. Since the data is currently stored in the browser storage (not cookies but somewhat similar) it's actually troublesome to support such a feature. Because fetching data takes time I'd have to restructure quite some things to allow the website to "wait" for the data before showing it. Plus implementing authorization, storing that data securely, handling situations like the access being revoked externally, keeping data synced across multiple browser tabs.. it all gets quite complicated.

I'm not familiar with the Discord API. I don't see how you'd be able to store your own settings through it because I figure the API would be more targeted at things like Discord bots?

Right now there's some other things I'm working on. Like tools to more easily update the website when new content is added to Sky and a season / event calculator. But I welcome any ideas in the meantime because I do plan on figuring this out when I have the time and motivation.

Silverfeelin commented 2 months ago

@ChakraaThePanda I've been hard at work on changing all of the code to allow for storing data in the cloud.

There is an experimental version available at: https://p-dropbox.sky-planner.pages.dev/

You can try it out by going to: Settings > Go to Storage > Use Dropbox > Link to Dropbox. After linking an account you can click on: Go to Dashboard

From then on whenever you load this website and make any changes it will use your Dropbox account instead of localStorage. Whenever you unlock anything it will show a cloud symbol that will save after a few seconds of not unlocking anything.

You should also be able to try the same steps on another device and see it in action! Keep in mind that by having the website open on two devices at the same time whichever will save last will be the source of truth.

There's still some new problems that I have to solve like new import/export options but I'd love to hear your feedback in the meantime!