Single Page Applications can be written in many ways with many frameworks, I have decided to concentrate on reading about React. In many cases, the standard application where an application is mounted in to a point in an almost empty html document is sufficient. I have previously written about the possibility to include a react app only in a part of a web site.
Single Page Application written in React are popular in the IT industry and many projects I have seen is about creating an application for use internally in an organisation. It is then fine to use the boilerplate «create-react-app» and just write an API for the app. But if you are creating an online experience today you might want to look into server side rendering.
I have been struggling to find a good architecture but yesterday I found efforts online to server side render using PHP. I have seen efforts on node.js before but let’s face it – most web hotels use PHP and I feel that still using PHP perhaps with a framework is most suitable if you want your code to be reused or sold on a broad scale.
I will look into this more carefully by writing some example code if I have time. It turns out there is a PHPJsV8 extension and there are several ways of rendering React directly with PHP. With the extension installed in React-PHP-V8Js and there is also an effort from the Symfony community that seems not to need the extension called ReactRenderer.