To avoid the privacy violations of Facebook (and other big internet companies), an online social network could be created that is distributed on the computers of the users. Every user has their own profile and the shared posts of their friends on their computer. When a user posts something new, it is put in a queue, to be shared with each designated friend when both the poster’s and the friend’s computers are online. Each pair of friends could have a different password for sharing data.
This would also make it difficult for dictatorships to track the activity of protesters and dissidents. Everyone would only know their own and their friends’ data, so there is no single database through which to easily spy on many people.
The distributed network may not need coding from scratch. Some existing programs can perhaps be modified to serve, e.g. torrents or version control software. The posts of a user are like a torrent updated from time to time and shared only with some people (or publicly if the user chooses). Or the posts and comments are like a collaboratively edited document (think Google Docs).
I am unlikely to be the first with this idea, but I didn’t search for similar ones.