I think an easy way to do this would be to make use of the wordpress template structure, take a look at Codex: Templates and Codex: Template Hierarchy for a general overview. But namely you could use the author templates – Codex: Author Templates – for this, so likely you will adapt the author.php
file to fit your needs.
Additionally you want to change the rewrite structure for the author template to match your goals. General information can be found at Codex: Rewrite API and Codex: Class Reference/WP_Rewrite. Besides that this has been answered several times here on WPSE, no need to duplicate this, so take a look at: Diplay a registered user profile page and/or How to custom change author base without $this->front?.