Need to Deploy Laravel + Reactjs (SEO friendly ) application - reactjs

I have to create an application where users will have their unique usernames and profiles like "website.com/JohnDoe". for that the client asked me to develop it in any good PHP framework and client also need an android/ios app (which he disclosed after 2nd meeting) . so I was(before 2nd meeting) going to use Laravel totally. but since he said he wanted a mobile app too, so I decided to use Laravel as backend API, for Web frontend I will use Reactjs and for Mobile I would use ReactNative ( I've done same before). since Laravel provides react support so my I was planning to use React within the laravel.
Then client said he is more concern about SEO of his website. so I had two options
Use laravel as API provider only. and create ReactJS app totally separate from Laravel.
In this case I will need Nodejs server. Then I thought If I have a nodejs server than why would I go for laravel, I could use Express.
Use ReactJS within laravel and use any SSR package to cope with ssr.
If I am going for second option, can anyone point me to already live website which uses React Helmet SSR or Laravel-react-ssr?
Laravel react-ssr: https://github.com/spatie/laravel-server-side-rendering
React Helmet-ssr: https://github.com/nfl/react-helmet#server-usage
I have read both, and I am too confused. I am beginner in both Laravel and React(node) so I am unable to understand what both are proposing.

i deployed your 2 option mentioned let me give you the site https://v3.topviewnyc.com/, i created a microservice which would take care of SSR besides my hooks and components are build on react so am totally able of enjoy the SPA frontend side with react using components and get data via laravels API

Related

Using both Django template and React

Hi guys I’m trying to bulid a website which django works as an rest-api and react works as a front side. I manage to do the whole thing just fine and about to deploy it using aws. But there is one thing I couldn’t really get. Inside my django project I have an app that uses only django template to render things to front. And other apps are working only as apis to get and post things via react. Is it possible to deploy this kind of structure without any special options? I searched internet for a while but I couldn’t really find an example that fits my situation. Thanks!
Yes, you should be able to deploy it without extra options: you can have one Django template view to host the React app entry point, and the rest would be Rest API views that are accessed by React.

The best way to connect Next.js CSR React app, Django and PostgreSQL

My question concerns programming a full-stack app.
On the frontend, I have a Next.js React app. I want to render it on the client-side and probably use SWR. On the backend, I have a Django app with a PostgreSQL database.
I have seen two approaches to make all of these work together.
The first one is to use Django to serve Next.js React app with django-webpack-loader and then to load React app within Django template.
The second one is to build two separate apps - frontend (Next.js) and backend (Django + PostgreSQL) and deploying them on two servers (e.g. Docker container).
I have read this article and it makes me lean towards the second option. However, it is a pretty old solution and maybe some things have changed since then.
What is the most optimal solution when it comes to connecting Next.js React Client-side rendered, Django and PostgreSQL?
Opinions may differ, but based on reading and personal experience, I consider using separate Next.js and Django apps to be preferable. This (1) helps with separation of concerns, (2) helps avoid making Django or Next.js do anything that their designers did not anticipate, and (3) is simple with Docker.
Here's an example project that uses docker-compose to manage services including a Next.js frontend, Django backend, and Postgres database: https://github.com/ModularHistory/modularhistory

React js + laravel deploy

So I got reactJs as frontend and Laravel as backend.In local laravel is running on a t.test domain and reactJs is running on localhost:3000 but I want to deploy them now on the same domain on a sharing host.So how can I set this up?Putting laravel in the react or putting reactJs in public folder of laravel will that work?
Since reactJS is frontend and Laravel is Backend, you simply have to put react in the front line. so in an example, if you have mydomain.com react can run there directly and then you can let Laravel run on a seperate location. example backendservice.mydomain.com.
then configure your url calls from react to the laravel backend.
That is it. you do not need to put them all together. I personally advise you to kep them seperate.
That way, versioning in the future could have a version 1.0 backend and version 2.5 frontend (basically, it becomes simple)
Here is a reference you could use. https://developer.okta.com/blog/2018/12/06/crud-app-laravel-react
I hope I was clear enough. if not, am willing to clarify further.

React Web App to React Native

I currently have a web app/api built using React, Node, Mongo & Express. I would also like to develop a react native clien that shares an API. Does having an existing react web client make the react-native mobile development any easier? My biggest concern is authentication & authorization. Can you recommend any tutorials, frameworks, packages that could make it easier? As you can tell.. I am very new to development.
You can utilize the same backend that you use for your Web app, in React-Native.
You can even use the same packages like Axios or superagent.
React-Native's built in one is called Fetch().
You are simply pinging your RESTful backend from a different device.
React-Native code is not at all a one for one with React Code. They are very different and only follow the same architecture Design Principals.
This question has been asked many times.

Create Lumen 5.5 - React Project from scratch

I need to create a new project using reactJS and lumen 5.5 and i was installed lumen 5.5 and reactJS. but then i was stuck, so i have some questions:
where is the position of the reactJS folders should be?
how i can add a react component in the home page with data-source from lumen api?
how we can integrate between them?
what the content of package.json should be?
i will appreciate any clear answer, because i was spent alot of time to make an integration between them without any results.
Lumen isn't intended to have views, it's primarily intended to be a lightweight API framework. If you want views and a front end, you should use Laravel. Which also comes with a react preset to get you started right away. Laravel also has API routes built in that you can use for your API. The good news is that your code from Lumen should be fairly easy to transfer over to a Laravel project.

Resources