There are lot many opensources available in building a soccial networking site. Its not about having the code is mean to build, so many factors are depends on it to starting a successful network. First of all we have to come up with a solid social networking concept ( Unique idea ). Next step is to select an opensource application suitable for our requirements.
There are plenty of opensource applications available to build your community website that includes N.Sandwich, Dolphin, Joomla community website, Elgg – Opensource networking, PHPBB, Mahara, Lovd by Less & few others.
It requires better analysis to select before you start the code. We have to analyze our requirements based on the customization of existing opensource application. N.Sandwich is a very good example for customization of your opensource application.
There are also some CMS based social networking sites like buddy press for wordpress, Joomla community site builder, Drupal social module, N.Sandwich ( a platform can be integrated with any opensource platform ).
So its your choice to go ahead.