The only part that was unique to PHP was twig, but there is a pure-js implementation of twig now: https://github.com/twigjs/twig.js. The REST server could easily be accomplished with Express or equivalent. A pure JS implementation would remove the dependency on PHP.