For greywater you can’t go wrong with Art Ludwig’s “Create an Oasis Out of Greywater”. I used it for my system and it was more than enough info.
For rainwater check out “Rainwater Harvesting for Drylands and Beyond” by Brad Lancaster, it’s a good overview.
If you’re going to build a cistern you could look at Volumes 2 and 3 of the Rainwater Harvesting book, but I just bought Art Ludwig’s “Water Storage” and that seems to be enough.
All told that’s about $50–60 on Amazon and it’s all the info you’ll ever need to build any system you want.
Shop around for tanks if you buy one, you can find stuff super cheap if you’re patient.
The systems are simple and bombproof, the main thing being to spend plenty of time on design. Think about maintenance. One thing I’ll do with my next greywater hook up (from laundry to front yard) is to install a Jandy 3 way pool valve instead of a 3 way PVC valve. The Jandy is supposed to be super simple to turn instead of the 3 way PVC that I had to build a special wooden jig to turn it because it’s so stiff.
The valves are installed so I can switch easily between sending greywater to my garden and sending greywater to the city/septic. If you’re a total hippie and never use any bleach or other nasty chemicals you’ll be fine, otherwise install it.
As far as soap, Art makes a big deal about bio-compatible suds; I’ve just used normal soap (Dr. Bronner’s or some other semi-natural stuff) and my plants LOVE it.
I didn’t pay attention to any codes or try to get any permits. Not sure what the situation is out there but from my limited experience the main thing that the gov’t wants out of you is money, and they don’t trade you anything for it; no expertise, no knowledge, nada.
Bottom line: This shit is simple to do, just take your time and think it out.
If you have any questions feel free to call or email.