Lots of Google info on "software development contract" including boilerplate contracts. As I have seen over and over again, the success of a hot software product is usually tied up with the skills of one brilliant programmer. If he jumps ship, the product atrophies. If he is of a particular mind, you will get to know too many lawyers. Success + Money + Multiple_People = Conflict. The stories I could tell, and the ones I can remember all end badly. A few my old professional programming buddies are doing very well with "apps" but in every case they are both Chief Programmer and CEO, that's what you need to stay sane.