I did all of them for the endings, but really you can tell long before the points of no return for each faction if you can go with their ideology or not.
One of my biggest gripes with the
faction line is that there's about a billion things you should be asking them before you join up, but it's all just ignored and glossed over. BoS make their genocide-everything-not-human stance pretty clear, and the Minutemen are a straightforward local friendly militia type - I don't recall them doing anything remotely evil, or even that dark-side-of-grey.