The technical stack matters very little: you can do the necessary things with almost any webdev stack.
IMHO, federation is important if you want to replace Facebook and not just build a small-scale hub (which is a totally valuable thing to do too!), and for that you're going to need common protocols. Mastodon gets a lot of it right for making a Twitter-like, but there is no reason you couldn't build a Facebook-like on the same protocols (ActivityPub) too.