Use a source control like SVN or GIT to allow multiple developers to work on different or even the same pieces of code.
This will also allow you to restrict access to some developers only.
Find out more
here[
^].
Regarding chat, you will find some links on the internet.
Here you can find an example -
https://css-tricks.com/jquery-php-chat/[
^].