Save everything when the app is closed

It seems you made a wrong start. First learn the basics of any blockbuilder and then think about making a more complicated project like what you are doing it seems.

You also have not much reading time on the community. It has a lot of topics you can learn from.