vanila-io / wireflow

Wireflow - user flow chart real-time collaborative tool
https://wireflow.co
MIT License
3.99k stars 376 forks source link

Save progress in localstorage #59

Open entrptaher opened 3 years ago

entrptaher commented 3 years ago

We should have a simplified way of saving the state in localstorage in case the page is reloaded. Once it's done, we can think of saving them on server and realtime collaboration at a later stage.

We can also try sqlite, indexdb, webSQL etc, though it's unsure if it's going to work on mobile devices.

charliedua commented 3 years ago

Ok, so I was looking into how we can do this, there seems to be a way when a new node is added to the canvas we can save it in storage. Another idea would be to have a file-based saving, where a user can save and load their diagrams from a file, as rn we are saving as image, we can save the diagram as a JSON file and have an option of import diagram.

shtefcs commented 3 years ago

Another idea would be to have a file-based saving, where a user can save and load their diagrams from a file, as rn we are saving as image, we can save the diagram as a JSON file and have an option of import diagram.

That might be a good idea before we introduce user accounts, database, and server thing.

Currently one of the team members had some progress on saving it in local storage https://www.loom.com/share/170a5a884ae84807b7b4c137b1fb6afe

charliedua commented 3 years ago

Oh, this looks promising, I was looking around in the code of FlowCanvas component and was thinking of saving it from there. I guess this works.

heyakyra commented 3 years ago

realtime collaboration at a later stage

yes please!

wzulfikar commented 3 years ago

Hello folks! I saw there's a PR to add local storage (#61) but it's still not merged. Since I want to start using it, I deployed one in https://wireflow.wzulfikar.com. Please feel free to use it if you want.

https://user-images.githubusercontent.com/7823011/108244728-79557000-718a-11eb-8bc8-c4f6fc504f2e.mp4

Deployment is in sync with https://github.com/wzulfikar/wireflow/tree/wireflow.wzulfikar.com

Duckbilled commented 2 years ago

Maybe related to this, it would be really nice if a project could be exported to later be imported again. I don't know if that is like a super complicated request, but it would make sure the progress is 'safe' for a long period of time and I could continue between different browsers/laptops.