For backend, it was quite straight forward for me, because a light-weight/fast PHP MVC framework (i.e. YAF) coupled with an advanced relational database management system (i.e. PostgreSQL) would do the job perfectly. There has been battles for many years among PHP frameworks; but module/controller/action structure, views (and/or a template engine) and plugins (regardless of the terms e.g. “dependency injections”) and PDO were my selected parts of the solution; more or less same approach by most developers.
Template engines are inseparable parts of frontend programming especially if you want programmer to write code and user-interface designers and developers prepare user-interface components, elements, sections, partials, fragments, widgets, etc., you name it. Mustache, Handlebars and Dust are worth mentioning here.
Then, nice separation of your code is a must. The way I see it is like this: