The CMS part was tough because it had to be one codebase to host multiple sites as well as the security stuff. But I think I've sorted out a good design pattern which is nice :) It mainly uses JSON to layout the CMS backend per-site and then you get to override everything else using Classes within each site's "theme" folder.
Not spectacular to look at atm but here is the Github repo: github.com/thejokersthief/GraniteCMS