Hello,
We are setting an app using Laravel in backend and React.JS + Redux in front end. So looking for solution for server side rendering (for SEO).
Found this solution: https://github.com/tz5514/Laravel-Redux-Isomorphic but it seems like in backend it using express.js to render.
So i doubt will it be a good decision to go with such solutions?
Thanks.
Hey Vivek, How did the approach Vlad mentioned worked for you? Did you end up implementing it? I mean Laravel API consumed by Express JS + React + Redux app.
Vlad Nicula
React is javascript, so it needs a javascript engine in order to run, so one way to see a laravel project is to think of it as the 'backend' api server, which is completely separated from the 'frontend' server which uses node to run the javascript part of the application.
In other words, you have two apps, the one with laravel that exposes an api which could be used by any other service in the infrastructure, and the reactjs app which is a nodejs app that consumes that api, and handles the magic of react + redux.
The way your site is actually accessed from the outside world is thru the express/nodejs app, which calls the laravel api for data persistence and other business logic.
The laravel app handles sessions, oauth, the database, file access to the hardrive and so on, while the nodejs app handles the actual website routing, the templates, the css and javascript part.