Almost as importantly, and a lot less complicated and expensive, should be the development of community militias, and the abolition of military, replacing it with a council of generals and other administrative types to coordinate broad, multi-region action/responses.
Would be very cool to see that, I don't know how many places still have this kind of militia, I think Switzerland is still a little this way. If there was an option open for a global south country having this kind of setup it would be my first choice for where to relocate.
It's a very difficult bootstrap to achieve, but sooner or later it has to happen.
History shows over and over, nations that do this, survive, and don't get conquered, if they have resources worth fighting over.