I want to build a house and put solar panels on my roof. What angle do I need to build my roof at so I can just place solar panels flat on my roof? Which direction does the solar panels need to be facing?

(may be broke/outdated!)
I want to build a house and put solar panels on my roof. What angle do I need to build my roof at so I can just place solar panels flat on my roof? Which direction does the solar panels need to be facing?